From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from anamika.lostca.se (anamika.lostca.se [65.21.75.227]) by sourceware.org (Postfix) with ESMTPS id 680BD385840B for ; Fri, 12 Nov 2021 10:41:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 680BD385840B Received: from localhost (mail.lostca.se [65.21.75.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: spectre) by anamika.lostca.se (Postfix) with ESMTPSA id 9E057D930 for ; Fri, 12 Nov 2021 10:41:42 +0000 (UTC) Date: Fri, 12 Nov 2021 10:41:42 +0000 From: Arjun Shankar To: libc-alpha@sourceware.org Subject: [PATCH] test-container: Set /bin up as a symbolic link to /usr/bin Message-ID: <20211112104142.GA30371@lostca.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2021 10:41:45 -0000 From: Arjun Shankar 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