mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#31678: ci: Skip read-write of default env vars
fa952acdb6
ci: Skip read-write of default env vars (MarcoFalke) Pull request description: If they remain unset, they use the default anyway. Except for `USER`, but this seems unused anyway. Can be checked via: ``` sh-5.2# touch /tmp/empty_env sh-5.2# podman run --rm --env-file /tmp/empty_env 'ubuntu:24.04' env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=podman HOME=/root HOSTNAME=19ece5c9e052 ACKs for top commit: 0xB10C: ACKfa952acdb6
Prabhat1308: utACK [fa952ac
](fa952acdb6
) Tree-SHA512: fe0c173b23cfda3025306303a44ffe32ecc57c2e0e1a2376594696f9887ed22f5105da84e898e790041bf15a4aa42a365fba016710ad269d439dda691977be90
This commit is contained in:
commit
534414ca9d
1 changed files with 1 additions and 3 deletions
|
@ -7,14 +7,12 @@
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
export CI_IMAGE_LABEL="bitcoin-ci-test"
|
export CI_IMAGE_LABEL="bitcoin-ci-test"
|
||||||
|
|
||||||
set -ex
|
set -o errexit -o pipefail -o xtrace
|
||||||
|
|
||||||
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
||||||
# Export all env vars to avoid missing some.
|
# Export all env vars to avoid missing some.
|
||||||
# Though, exclude those with newlines to avoid parsing problems.
|
# Though, exclude those with newlines to avoid parsing problems.
|
||||||
python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee "/tmp/env-$USER-$CONTAINER_NAME"
|
python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee "/tmp/env-$USER-$CONTAINER_NAME"
|
||||||
# System-dependent env vars must be kept as is. So read them from the container.
|
|
||||||
docker run --platform="${CI_IMAGE_PLATFORM}" --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME"
|
|
||||||
|
|
||||||
# Env vars during the build can not be changed. For example, a modified
|
# Env vars during the build can not be changed. For example, a modified
|
||||||
# $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an
|
# $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an
|
||||||
|
|
Loading…
Add table
Reference in a new issue