From patchwork Fri Nov 12 10:41:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 47513 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A82A385800F for ; Fri, 12 Nov 2021 10:42:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A82A385800F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636713726; bh=3x0OnHiQ8Tzw5X1iIkUY85+g/PZe1fMAv4jCyeGZYyY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ghGCMJcFQbtgnKGffa5gBWVqTRr+wp3R1QTuBl9e3SYoftTAkRNxMAhIb2+PQhXKn ucfDReEpu1IkvHsLxfNpfnl60MzuJG89zAi/SU+vbBPLeiINz1VXngRZ9qRBBH3myc +afC8Ic5rElY/sZtD/ORbuk2d2e+1rF5rK93TVJo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 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-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-Patchwork-Original-From: Arjun Shankar via Libc-alpha From: Arjun Shankar Reply-To: Arjun Shankar Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 \