test-in-container: Do not set GCONV_PATH, LOCPATH
Commit Message
These environment variables are incorrect inside the container.
2019-05-20 Florian Weimer <fweimer@redhat.com>
test-in-container: Do not set GCONV_PATH, LOCPATH.
* Makeconfig (run-program-env-container): New variable.
(run-program-env): Use it.
* Rules ($(tests-container:%=$(objpfx)%.out)): Update comment.
Use $(run-program-env-container) instead of $(run-program-env).
@@ -743,10 +743,13 @@ run-via-rtld-prefix = \
else
run-via-rtld-prefix =
endif
+# Test-in-containers need fewer environment variables.
+run-program-env-container = LC_ALL=C
# $(run-program-env) is the default environment variable settings to
# use when running a program built with the newly built library.
run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \
- LOCPATH=$(common-objpfx)localedata LC_ALL=C
+ LOCPATH=$(common-objpfx)localedata \
+ $(run-program-env-container)
# $(run-program-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the build system on which "make" is run, runs that
@@ -273,10 +273,15 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
# Any tests that require an isolated container (filesystem, network
# and pid namespaces) in which to run, should be added to
# tests-container.
+#
+# Note: Outer use of $(run-program-env-container) instead of
+# $(run-program-env) assumes that support/test-container does not use
+# locales or gconv modules.
$(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) > $@; \
+ $(test-wrapper-env) $(run-program-env-container) \
+ $(run-via-rtld-prefix) \
+ $(common-objpfx)support/test-container env $($*-ENV) \
+ $(host-test-program-cmd) $($*-ARGS) > $@; \
$(evaluate-test)