ci: Print inner env, Make ccache config more flexible #30869

pull maflcko wants to merge 5 commits into bitcoin:master from maflcko:2409-ci-stuff changing 11 files +14 −12
  1. maflcko commented at 11:05 am on September 11, 2024: member

    The outer env is printed when the /tmp/env-$USER-$CONTAINER_NAME is created. There is also a separate env printed when building the container image (usually with default values).

    To confirm that the inner container env is correctly derived from the outer env, and not from the default build env, print it a third time.

  2. DrahtBot commented at 11:05 am on September 11, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, willcl-ark

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #30634 (ci: Use clang-19 from apt.llvm.org by maflcko)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Tests on Sep 11, 2024
  4. maflcko commented at 12:34 pm on September 11, 2024: member

    Example output: https://cirrus-ci.com/task/6430334932221952?logs=ci#L360

      0SHELL=/bin/bash
      1CCACHE_TEMPDIR=/tmp/.ccache-temp
      2CIRRUS_OS=linux
      3FILE_ENV=./ci/test/00_setup_env_native_tsan.sh
      4CIRRUS_PR_LABELS=Tests
      5CCACHE_MAXSIZE=200M
      6CIRRUS_ARCH=amd64
      7BASE_OUTDIR=/ci_container_base/ci/scratch/out
      8RUN_UNIT_TESTS=true
      9TSAN_OPTIONS=suppressions=/ci_container_base/test/sanitizer_suppressions/tsan:halt_on_error=1
     10CIRRUS_CHANGE_TIMESTAMP=1726052712753
     11CI_NODE_INDEX=6
     12CIRRUS_BUILD_ID=6309268394082304
     13CI_RETRY_EXE=retry --
     14TERMCAP=SC|screen.xterm-256color|VT 100/ANSI X3.64 virtual terminal:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:li#53:co#238:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:mb=\E[5m:md=\E[1m:mh=\E[2m:mr=\E[7m:me=\E[m:ms:Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:vb=\Eg:G0:as=\E(0:ae=\E(B:ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:po=\E[5i:pf=\E[4i:Km=\E[<:k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:kB=\E[Z:kh=\E[1~:@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:kI=\E[2~:kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:km:
     15CIRRUS_TASK_NAME=TSan, depends, gui
     16CIRRUS_PR_DRAFT=true
     17CI_IMAGE_LABEL=bitcoin-ci-test
     18OS=linux
     19WINDOW=0
     20BINS_SCRATCH_DIR=/ci_container_base/ci/scratch/bins/
     21CIRRUS_WORKING_DIR=/tmp/cirrus-build
     22TEST_RUNNER_TIMEOUT_FACTOR=40
     23PACKAGES=clang-18 llvm-18 libclang-rt-18-dev libc++abi-18-dev libc++-18-dev python3-zmq
     24CIRRUS_CHANGE_TITLE=ci: Print inner env
     25CONTINUOUS_INTEGRATION=true
     26MAKEJOBS=-j10
     27CIRRUS_USER_PERMISSION=read
     28CONTAINER_NAME=ci_native_tsan
     29PWD=/ci_container_base
     30CIRRUS_REPO_CLONE_HOST=github.com
     31LOGNAME=root
     32CIRRUS_BASE_BRANCH=master
     33XDG_SESSION_TYPE=tty
     34CCACHE_DIR=/tmp/ccache_dir
     35CI_BASE_PACKAGES=build-essential libtool autotools-dev automake pkg-config curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake
     36CIRRUS_USER_COLLABORATOR=true
     37CIRRUS_CI=true
     38CIRRUS_CHANGE_IN_REPO=fa7dac315318617acc31dd60942f7c85a8cbf642
     39CIRRUS_BRANCH=pull/30869
     40CIRRUS_ENV=/tmp/cirrus-env-task-6430334932221952-10ca8770-bfba-4740-a5e5-f1b39a7a3412
     41container=podman
     42MOTD_SHOWN=pam
     43TEST_RUNNER_PORT_MIN=14000
     44HOME=/root
     45BASE_ROOT_DIR=/ci_container_base
     46LANG=en_US.UTF-8
     47DEPENDS_DIR=/ci_container_base/depends
     48RUN_FUNCTIONAL_TESTS=true
     49CIRRUS_PR=30869
     50CIRRUS_LAST_GREEN_BUILD_ID=4666774803709952
     51CIRRUS_REPO_OWNER=bitcoin
     52SSH_CONNECTION=89.204.139.41 8825 65.21.243.33 22
     53GOAL=install
     54CIRRUS_PR_TITLE=ci: Print inner env
     55CCACHE_COMPRESS=1
     56ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
     57RUN_TIDY=false
     58XDG_SESSION_CLASS=user
     59LSAN_OPTIONS=suppressions=/ci_container_base/test/sanitizer_suppressions/lsan
     60CIRRUS_CLONE_DEPTH=1
     61TERM=xterm-256color
     62HOST=x86_64-pc-linux-gnu
     63BRANCH=pull/30869
     64RUN_FUZZ_TESTS=false
     65CIRRUS_REPO_CLONE_TOKEN=HIDDEN-BY-CIRRUS-CI
     66USE_BUSY_BOX=false
     67CIRRUS_REPO_ID=6264162542157824
     68BOOST_TEST_RANDOM=1
     69CIRRUS_BASE_SHA=0725a374941355349bb4bc8a79dad1affb27d3b9
     70PACKAGE_MANAGER_INSTALL=apt-get update && apt-get install -y
     71BITCOIN_CONFIG=-DWITH_ZMQ=ON -DSANITIZERS=thread -DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'
     72SHLVL=5
     73CIRRUS_BUILD_SOURCE=github
     74CIRRUS_TASK_ID=6430334932221952
     75DIR_QA_ASSETS=/ci_container_base/ci/scratch/qa-assets
     76CIRRUS_LAST_GREEN_CHANGE=df3f63ccfa0338ee38644b4a3c48f721fc28c2a2
     77CIRRUS_DEFAULT_BRANCH=master
     78XDG_SESSION_ID=4
     79CI_FAILFAST_TEST_LEAVE_DANGLING=1
     80UBSAN_OPTIONS=suppressions=/ci_container_base/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1
     81CI_IMAGE_NAME_TAG=docker.io/ubuntu:24.04
     82BASE_SCRATCH_DIR=/ci_container_base/ci/scratch
     83XDG_RUNTIME_DIR=/run/user/0
     84BASE_READ_ONLY_DIR=/tmp/cirrus-build
     85CCACHE_NOHASHDIR=1
     86SSH_CLIENT=89.204.139.41 8825 22
     87RESTART_CI_DOCKER_BEFORE_RUN=1
     88CI_NODE_TOTAL=12
     89LC_ALL=C.UTF-8
     90CIRRUS_OIDC_TOKEN=HIDDEN-BY-CIRRUS-CI
     91PATH=/path_with space:/ci_container_base/ci/scratch/bins/:/ci_container_base/ci/retry:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     92STY=2065.pts-0.debian-8gb-hel1-3
     93PREVIOUS_RELEASES_DIR=/ci_container_base/prev_releases
     94CIRRUS_REPO_FULL_NAME=bitcoin/bitcoin
     95CI=true
     96DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
     97DEP_OPTS=CC=clang-18 CXX='clang++-18 -stdlib=libc++'
     98SSH_TTY=/dev/pts/0
     99CIRRUS_REPO_CLONE_URL=https://github.com/bitcoin/bitcoin.git
    100CIRRUS_RESOLUTION_STRATEGY=MERGE_FOR_PRS
    101CIRRUS_HTTP_CACHE_HOST=127.0.0.1:12321
    102DEBIAN_FRONTEND=noninteractive
    103CIRRUS_REPO_NAME=bitcoin
    104OLDPWD=/
    
  5. maflcko renamed this:
    ci: Print inner env
    ci: Print inner env, Make ccache config more flexible
    on Sep 11, 2024
  6. maflcko marked this as ready for review on Sep 11, 2024
  7. DrahtBot added the label CI failed on Sep 11, 2024
  8. DrahtBot removed the label CI failed on Sep 11, 2024
  9. in ci/test/02_run_container.sh:54 in fa7233d184 outdated
    47@@ -48,6 +48,12 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
    48     CI_PREVIOUS_RELEASES_MOUNT="type=bind,src=${PREVIOUS_RELEASES_DIR},dst=$PREVIOUS_RELEASES_DIR"
    49   fi
    50 
    51+  if [ "$DANGER_CI_ON_HOST_CCACHE_FOLDER" ]; then
    52+    # Same as above, but only for ccache
    53+    mkdir -p "${CCACHE_DIR}"
    54+    CI_CCACHE_MOUNT="type=bind,src=${CCACHE_DIR},dst=$CCACHE_DIR"
    


    l0rinc commented at 9:31 pm on September 11, 2024:

    nit: are you using the two separate variable reference styles because the second one doesn’t have any characters after it? To be fair, the first also ends with a , so I think we can simplify this:

    0    CI_CCACHE_MOUNT="type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR"
    

    maflcko commented at 10:35 am on September 12, 2024:
    Nah, it was just copy-pasted from above. Fixed the style here.
  10. maflcko force-pushed on Sep 12, 2024
  11. in ci/test/00_setup_env.sh:56 in fad32a5c76 outdated
    52@@ -53,7 +53,7 @@ export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
    53 export BOOST_TEST_RANDOM=${BOOST_TEST_RANDOM:-1}
    54 # See man 7 debconf
    55 export DEBIAN_FRONTEND=noninteractive
    56-export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-100M}
    


    l0rinc commented at 8:23 am on September 12, 2024:
    This is sourced usually through test_run_all.sh, right? What was the reason for such low values before?

    maflcko commented at 10:35 am on September 12, 2024:

    Yes.

    I do not know. I presume this is just the initial value that was set when there were no debug builds or builds with sanitizers (which are larger).

  12. in ci/test/00_setup_env.sh:61 in fa8bd77d03 outdated
    57@@ -58,7 +58,7 @@ export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp}
    58 export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
    59 # The cache dir.
    60 # This folder exists only on the ci guest, and on the ci host as a volume.
    61-export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
    62+export CCACHE_DIR="${CCACHE_DIR:-$BASE_SCRATCH_DIR/ccache}"
    


    l0rinc commented at 8:25 am on September 12, 2024:
    the dot is dropped since it’s not a home dir, right?

    maflcko commented at 10:34 am on September 12, 2024:
    Thanks, adjusted commit message.
  13. in .cirrus.yml:1 in fa58bb74bb outdated


    l0rinc commented at 8:26 am on September 12, 2024:

    nit: commit message has subject-verb agreement problem

    the build paths are constant


    maflcko commented at 10:34 am on September 12, 2024:
    Thanks, adjusted commit message.
  14. l0rinc approved
  15. l0rinc commented at 8:33 am on September 12, 2024: contributor
    utACK facb8f16389d1fbf27ee70f887de9cb082028374
  16. ci: Print inner env fa7ca182a9
  17. cirrus: Drop CCACHE_NOHASHDIR
    Now that the build path is constant again after commit fa193f5dfc9
    normalized all folders, this can be dropped.
    aaaa7cf8ba
  18. ci: Bump default CCACHE_MAXSIZE to 500M
    This also allows to drop individually hardcoded values, which are
    impossible to overwrite and hard to maintain.
    fa146904e1
  19. ci: Remove hardcoded CCACHE_DIR in cirrus
    This makes it easier to overwrite the value.
    
    Also, drop the dot in the CCACHE_DIR fallback value, because the folder
    in the scratch dir does not need and probably should not be hidden.
    fa252da0b9
  20. maflcko force-pushed on Sep 12, 2024
  21. l0rinc commented at 10:53 am on September 12, 2024: contributor
    utACK 2222b44d35c092b5aaefed12bc5ca608e6e78760
  22. DrahtBot added the label CI failed on Sep 13, 2024
  23. DrahtBot removed the label CI failed on Sep 13, 2024
  24. maflcko force-pushed on Sep 16, 2024
  25. in ci/test/02_run_container.sh:52 in fac255a189 outdated
    47@@ -48,6 +48,15 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
    48     CI_PREVIOUS_RELEASES_MOUNT="type=bind,src=${PREVIOUS_RELEASES_DIR},dst=$PREVIOUS_RELEASES_DIR"
    49   fi
    50 
    51+  if [ "$DANGER_CI_ON_HOST_CCACHE_FOLDER" ]; then
    52+    # Same as above, but only for ccache
    


    l0rinc commented at 2:48 pm on September 16, 2024:
    this doesn’t seem to be the case anymore, the above ones recreate the folders

    maflcko commented at 2:56 pm on September 16, 2024:

    I meant the “bind-mount” part, not the folder creation. (I think creating the folder is best required to be done outside the script, as permission bits need to be set appropriately)

    I guess I can just remove the comment?

  26. maflcko force-pushed on Sep 16, 2024
  27. ci: Allow CCACHE_DIR bind mount
    This may be useful. For example, to store the directory in a specific
    place, instead of having to use a volume.
    
    Possibly, but not limited to sharing a cache:
    https://ccache.dev/manual/4.10.1.html#_sharing_a_local_cache
    fa99e4521b
  28. maflcko force-pushed on Sep 16, 2024
  29. l0rinc commented at 3:50 pm on September 16, 2024: contributor
    utACK fa99e4521b6fc0e7f6636d40bc0d6a7325227374
  30. fanquake requested review from willcl-ark on Sep 16, 2024
  31. in ci/test/03_test_script.sh:35 in fa7ca182a9 outdated
    29@@ -30,6 +30,10 @@ df -h
    30 # Tests that run natively guess the host
    31 export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
    32 
    33+echo "=== BEGIN env ==="
    34+env
    35+echo "=== END env ==="
    


    willcl-ark commented at 1:17 pm on September 17, 2024:

    This does work, but seems to come out a little garbled in the raw logs on CI itself. It didn’t happen for me locally and it does not appear to be fault of the script itself, so I guess just GitHub UI processing stdout slowly or something, e.g.

     02024-09-16T15:22:03.4198819Z + echo '=== END env ==='
     12024-09-16T15:22:03.4199084Z + tee /dev/fd/63
     22024-09-16T15:22:03.4199339Z ++ patch -p1
     32024-09-16T15:22:03.4199590Z + '[' false = true ']'
     42024-09-16T15:22:03.4199872Z + '[' true = true ']'
     52024-09-16T15:22:03.4200388Z + export DIR_UNIT_TEST_DATA=/home/runner/work/_temp/ci/scratch/qa-assets/unit_test_data/
     62024-09-16T15:22:03.4201123Z + DIR_UNIT_TEST_DATA=/home/runner/work/_temp/ci/scratch/qa-assets/unit_test_data/
     72024-09-16T15:22:03.4201953Z + '[' '!' -d /home/runner/work/_temp/ci/scratch/qa-assets/unit_test_data/ ']'
     82024-09-16T15:22:03.4202600Z + mkdir -p /home/runner/work/_temp/ci/scratch/qa-assets/unit_test_data/
     92024-09-16T15:22:03.4204159Z + retry -- curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o /home/runner/work/_temp/ci/scratch/qa-assets/unit_test_data//script_assets_test.json
    102024-09-16T15:22:03.4205183Z === END env ===
    
  32. willcl-ark approved
  33. willcl-ark commented at 1:24 pm on September 17, 2024: member

    ACK fa99e4521b6fc0e7f6636d40bc0d6a7325227374

    Making ccache mor configurable in CI seems like a reasonable change overall. Hopefully in the future this could help us if we moved to some more powerful CI runners (with bigger ccache!)

  34. fanquake merged this on Sep 19, 2024
  35. fanquake closed this on Sep 19, 2024

  36. maflcko deleted the branch on Sep 19, 2024

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: 2024-12-22 00:12 UTC

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