git: 3c9a2f383fc2 - main - Ping: Make build reproducible
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Oct 2025 02:52:52 UTC
The branch main has been updated by cperciva:
URL: https://cgit.FreeBSD.org/src/commit/?id=3c9a2f383fc25cdffa80c1348cb5388290e0f283
commit 3c9a2f383fc25cdffa80c1348cb5388290e0f283
Author: Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2025-10-13 15:58:10 +0000
Commit: Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-14 02:52:35 +0000
Ping: Make build reproducible
As recently fixed in sockstat (9934558460e4), having tests/Makefile
include files from the parent directory with SRCS= ../foo.c results
in a race condition as the parent build and the tests build try to
produce the same object file but contain different paths.
Use .PATH to tell make to find sockstat.c in the parent directory
but place the object file in the current object directory.
Reviewed by: emaste, jrtc27, kevans
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53075
---
sbin/ping/tests/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sbin/ping/tests/Makefile b/sbin/ping/tests/Makefile
index 0520b1d634cf..7d3ab02b9a86 100644
--- a/sbin/ping/tests/Makefile
+++ b/sbin/ping/tests/Makefile
@@ -1,5 +1,6 @@
ATF_TESTS_C+= in_cksum_test
-SRCS.in_cksum_test= in_cksum_test.c ../utils.c
+.PATH: ${.CURDIR:H}
+SRCS.in_cksum_test= in_cksum_test.c utils.c
PACKAGE= tests