ci: Skip read-write of default env vars #31678

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2501-ci-skip changing 1 files +1 −3
  1. maflcko commented at 12:13 pm on January 17, 2025: member

    If they remain unset, they use the default anyway. Except for USER, but this seems unused anyway.

    Can be checked via:

    0sh-5.2# touch /tmp/empty_env
    1sh-5.2# podman run --rm --env-file /tmp/empty_env 'ubuntu:24.04' env
    2PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    3container=podman
    4HOME=/root
    5HOSTNAME=19ece5c9e052
    
  2. DrahtBot commented at 12:13 pm on January 17, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31678.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK 0xB10C

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    No conflicts as of last run.

  3. DrahtBot added the label Tests on Jan 17, 2025
  4. 0xB10C commented at 12:37 pm on January 17, 2025: contributor

    Concept ACK

    I want to check if this helps #30852 (comment) when used with #31545 by not having to keep the base images around anymore.

  5. in ci/test/02_run_container.sh:15 in fa8401f2cb outdated
    11+set -o errexit -o pipefail -o xtrace
    12 
    13 if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
    14   # Export all env vars to avoid missing some.
    15   # Though, exclude those with newlines to avoid parsing problems.
    16   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"
    


    maflcko commented at 2:20 pm on January 17, 2025:

    For reference, the exclusion is still needed to avoid the error from #27739 (comment). Diff to reproduce the error:

     0diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh
     1index 4181e68..168ab51 100755
     2--- a/ci/test/02_run_container.sh
     3+++ b/ci/test/02_run_container.sh
     4@@ -12,7 +12,7 @@ set -o errexit -o pipefail -o xtrace
     5 if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
     6   # Export all env vars to avoid missing some.
     7   # Though, exclude those with newlines to avoid parsing problems.
     8-  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"
     9+  python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value]' | tee "/tmp/env-$USER-$CONTAINER_NAME"
    10 
    11   # Env vars during the build can not be changed. For example, a modified
    12   # $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an
    

    CMD: env -i HOME="$HOME" PATH="$PATH" USER="$USER" MAKEJOBS="-j$( nproc )" FILE_ENV="./ci/test/00_setup_env_native_tidy.sh" ./ci/test_run_all.sh

  6. ci: Skip read-write of default env vars
    Also, set pipefail while touching the script.
    fa952acdb6
  7. DrahtBot added the label Needs rebase on Jan 20, 2025
  8. maflcko force-pushed on Jan 20, 2025
  9. DrahtBot removed the label Needs rebase on Jan 20, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-01-21 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me