ci: Run base install at most once #27429

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2304-ci-base-install-once- changing 2 files +18 −11
  1. maflcko commented at 9:00 AM on April 6, 2023: member

    This should avoid errors when running it twice. For example, network errors on the second invocation of 'apt update'; or unguarded modifications such as APPEND_APT_SOURCES_LIST, which will append the same string repeatedly.

    The base install may be run twice in Cirrus CI with dockerfiles, or locally when running twice with DANGER_RUN_CI_ON_HOST specified.

  2. DrahtBot commented at 9:00 AM on April 6, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK josibake

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

  3. DrahtBot added the label Tests on Apr 6, 2023
  4. maflcko force-pushed on Apr 6, 2023
  5. maflcko force-pushed on Apr 6, 2023
  6. in ci/test/04_install.sh:72 in fafe94a139 outdated
      73 | +CI_EXEC rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" || echo "CI base install missing"
      74 | +CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
      75 | +CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base"
      76 | +# Fixes permission issues when there is a container UID/GID mismatch with the owner
      77 | +# of the git source code directory.
      78 | +CI_EXEC git config --global --add safe.directory '*'
    


    josibake commented at 9:43 AM on April 6, 2023:

    I think double quotes is the safest, although I can't remember where I saw that..

  7. maflcko force-pushed on Apr 6, 2023
  8. maflcko commented at 9:48 AM on April 6, 2023: member

    For testing:

    # (Obviously only run this in a throw-away VM) # DANGER_RUN_CI_ON_HOST="1" MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" ./ci/test_run_all.sh
    

    Before:

    Running on host system without docker wrapper
    Hit:1 http://deb.debian.org/debian buster InRelease
    Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
    Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
    Get:4 http://deb.debian.org/debian buster-backports InRelease [51.4 kB]
    Fetched 108 kB in 1s (122 kB/s)
    Reading package lists... Done
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:8
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:8
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:9
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:9
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:8
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:8
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:9
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list:9
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Skipping automake, it is already installed and upgrade is not set.
    Skipping autotools-dev, it is already installed and upgrade is not set.
    Skipping bison, it is already installed and upgrade is not set.
    Skipping bsdmainutils, it is already installed and upgrade is not set.
    Skipping build-essential, it is already installed and upgrade is not set.
    Skipping ca-certificates, it is already installed and upgrade is not set.
    Skipping ccache, it is already installed and upgrade is not set.
    Skipping libtool, it is already installed and upgrade is not set.
    Skipping pkg-config, it is already installed and upgrade is not set.
    Skipping procps, it is already installed and upgrade is not set.
    Skipping python3, it is already installed and upgrade is not set.
    Skipping python3-zmq, it is already installed and upgrade is not set.
    Skipping curl, it is already installed and upgrade is not set.
    Skipping git, it is already installed and upgrade is not set.
    Skipping clang-8, it is already installed and upgrade is not set.
    Skipping libc++-8-dev, it is already installed and upgrade is not set.
    Skipping libc++abi-8-dev, it is already installed and upgrade is not set.
    Skipping llvm-8, it is already installed and upgrade is not set.
    Skipping rsync, it is already installed and upgrade is not set.
    0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
    ...
    

    After:

    Skip base install
    ...
    
  9. ci: Run base install at most once
    This should avoid errors when running it twice. For example, network
    errors on the second invocation of 'apt update'; or unguarded
    modifications such as APPEND_APT_SOURCES_LIST, which will append the
    same string repeatedly.
    
    The base install may be run twice in Cirrus CI with dockerfiles, or
    locally when running twice with DANGER_RUN_CI_ON_HOST specified.
    fa5af94de6
  10. maflcko force-pushed on Apr 6, 2023
  11. in ci/test/04_install.sh:72 in fa5af94de6
      73 | +CI_EXEC rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" || echo "/ci_base_install/ missing"
      74 | +CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
      75 | +CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base"
      76 | +# Fixes permission issues when there is a container UID/GID mismatch with the owner
      77 | +# of the git source code directory.
      78 | +CI_EXEC git config --global --add safe.directory \"*\"
    


    josibake commented at 11:13 AM on April 6, 2023:

    if you run this without docker, won't this change the user's local git config? probably fine since you should be running with docker if running locally, but might be worth mentioning in the comment


    maflcko commented at 11:21 AM on April 6, 2023:

    Yes, DANGER_RUN_CI_ON_HOST is called that way to discourage people from trashing their system


    maflcko commented at 11:22 AM on April 6, 2023:

    (This applies to all CI_EXEC lines, so I don't think anything is gained from mentioning it here)

  12. fanquake merged this on Apr 7, 2023
  13. fanquake closed this on Apr 7, 2023

  14. maflcko deleted the branch on Apr 7, 2023
  15. sidhujag referenced this in commit fc71022789 on Apr 8, 2023
  16. bitcoin locked this on Apr 6, 2024
Labels

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: 2026-04-18 12:13 UTC

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