public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] test-container: Set /bin up as a symbolic link to /usr/bin
@ 2021-11-12 10:41 Arjun Shankar
  2021-11-12 12:25 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Arjun Shankar @ 2021-11-12 10:41 UTC (permalink / raw)
  To: libc-alpha

From: Arjun Shankar <arjun@redhat.com>

This makes the container environment more compatible with various
operating systems.

For example, prior to this commit tst-vfork3 would fail when building
the glibc package for RHEL 9.  This was because _CS_PATH is "/usr/bin"
there instead of the default "/bin:/usr/bin", causing the test to try
to execute /usr/bin/echo in the container where echo was located in /bin
instead.  While this could be fixed in the test itself, this commit
seems like a more general solution.
---
 Makefile | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index a49870d3d1..d738bd07d2 100644
--- a/Makefile
+++ b/Makefile
@@ -598,15 +598,17 @@ $(tests-container) $(addsuffix /tests,$(subdirs)) : \
 $(objpfx)testroot.pristine/install.stamp :
 	test -d $(objpfx)testroot.pristine || \
 	  mkdir $(objpfx)testroot.pristine
-	# We need a working /bin/sh for some of the tests.
-	test -d $(objpfx)testroot.pristine/bin || \
-	  mkdir $(objpfx)testroot.pristine/bin
+	test -d $(objpfx)testroot.pristine/usr/bin || \
+	  mkdir -p $(objpfx)testroot.pristine/usr/bin
+	# We need a /bin for some of the tests, so we symlink it to /usr/bin
+	test -e $(objpfx)testroot.pristine/bin || \
+	  ln -s usr/bin $(objpfx)testroot.pristine/bin
 	# We need the compiled locale dir for localedef tests.
 	test -d $(objpfx)testroot.pristine/$(complocaledir) || \
 	  mkdir -p $(objpfx)testroot.pristine/$(complocaledir)
-	cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/bin/sh
-	cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/bin/echo
-	cp $(objpfx)support/true-container $(objpfx)testroot.pristine/bin/true
+	cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/usr/bin/sh
+	cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/usr/bin/echo
+	cp $(objpfx)support/true-container $(objpfx)testroot.pristine/usr/bin/true
 ifeq ($(run-built-tests),yes)
 	# Copy these DSOs first so we can overwrite them with our own.
 	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-12 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 10:41 [PATCH] test-container: Set /bin up as a symbolic link to /usr/bin Arjun Shankar
2021-11-12 12:25 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).