From patchwork Fri Dec 6 04:19:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 36550 Received: (qmail 106769 invoked by alias); 6 Dec 2019 04:21:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 106740 invoked by uid 89); 6 Dec 2019 04:21:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HTo:U*fw X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575605968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=6xBVi9jgrTuh/pN3MSlSBSeKAKdmU9rbTGXzeutzFhc=; b=VhzFpIILgaQvy9+uhqbJQO4XoKd/gjolIdx1HaHub9ubTiuKtObXlpi6ZAioGDSyZokrAK 8Pcb0KcFcmg7uZts+cWvO6ygW7yc8D8JDwRgHNzvssQP5PgXTfKFEVGBT/P+o1CxQYKfSG t3fDk1tMACa8WqNOV44YVVGL/llF1tE= From: DJ Delorie To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: RFC: test-in-container vs ld.so In-Reply-To: <87wocavneb.fsf@mid.deneb.enyo.de> (message from Florian Weimer on Fri, 08 Nov 2019 08:27:08 +0100) Date: Thu, 05 Dec 2019 23:19:22 -0500 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Florian Weimer writes: > I suspect the removalof LC_*, LANG etc. variables should be done in > test-container, just for convenience. This is what I ended up with. All tests pass, but as I mentioned in a previous email, very few tests run in the container. This blocks the outer variables from coming in, while letting the test itself set them again if needed. I'm not sure what kind of test we could run in the container to make sure we're *not* accidentally using the build-tree file, though. diff --git a/Rules b/Rules index 8dbac56ce6..9ca5e14092 100644 --- a/Rules +++ b/Rules @@ -275,8 +275,8 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence. # tests-container. $(tests-container:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)% $(test-wrapper-env) $(run-program-env) $(run-via-rtld-prefix) \ - $(common-objpfx)support/test-container env $(run-program-env) $($*-ENV) \ - $(host-test-program-cmd) $($*-ARGS) > $@; \ + $(common-objpfx)support/test-container env $($*-ENV) \ + $(built-program-file) $($*-ARGS) > $@; \ $(evaluate-test) diff --git a/support/test-container.c b/support/test-container.c index 5d08979df3..9b0b1c7631 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -712,6 +712,12 @@ main (int argc, char **argv) --argc; } + /* We don't want to inherit these from the ld.so wrapper we were + invoked with, but the test can still provide a test-specific + value via the "env" we pretend to run. */ + unsetenv ("GCONV_PATH"); + unsetenv ("LOCPATH"); + if (strcmp (argv[1], "env") == 0) { ++argv;