aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2025-10-13 15:58:10 +0000
committerColin Percival <cperciva@FreeBSD.org>2025-10-14 02:52:35 +0000
commit3c9a2f383fc25cdffa80c1348cb5388290e0f283 (patch)
tree8c2f2cffbd4ccc05171ff33c028e573f3a821f38
parent16155cccc4bf42a5a76806128e7ef637f9ae61fe (diff)
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
-rw-r--r--sbin/ping/tests/Makefile3
1 files changed, 2 insertions, 1 deletions
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