ci: cleanup of CI_EXEC & CI_EXEC_ROOT #27333

pull vstoyanov wants to merge 1 commits into bitcoin:master from vstoyanov:bitcoin#27321 changing 1 files +25 −32
  1. vstoyanov commented at 12:38 pm on March 26, 2023: none

    Basically it removes the above-mentioned env-vars as per MarcoFalke’s instructions. The only deviation from the plan laid out there was that I double-quoted the last instance of $ANDROID_HOME for the sake of consistency and future-proofing and the rest of the non-quoted vars due to lint failing the build.

    Fixes #27321.

  2. DrahtBot commented at 12:38 pm on March 26, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK josibake, hernanmarino
    Concept ACK Ayush170-Future
    Stale ACK MarcoFalke

    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 Mar 26, 2023
  4. vstoyanov force-pushed on Mar 26, 2023
  5. vstoyanov force-pushed on Mar 26, 2023
  6. vstoyanov force-pushed on Mar 26, 2023
  7. vstoyanov force-pushed on Mar 26, 2023
  8. in ci/test/01_base_install.sh:15 in f52d482408 outdated
    10-# replaced by a bash -c "command" directly, where needed.
    11-# For now, they are named aliases to aid review with --color-moved=dimmed-zebra.
    12-CI_EXEC_ROOT () { bash -c "$*"; }
    13-CI_EXEC()       { bash -c "$*"; }
    14-export -f CI_EXEC_ROOT
    15-export -f CI_EXEC
    


    hernanmarino commented at 10:25 pm on March 26, 2023:
    Aren’t there other scripts relying on the exported aliases ? Won’t they fail ?

    vstoyanov commented at 6:08 am on March 27, 2023:

    Yes, but the next time they are used in ci/test/04_install.sh, they are already redefined on lines 79-84:

    CI_EXEC () { $CI_EXEC_CMD_PREFIX bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*" } CI_EXEC_ROOT () { $CI_EXEC_CMD_PREFIX_ROOT bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*" }

    This PR only relates to their usage in base ci/test/01_base_install.sh and potentially the env-var definitions in ci/test/00_setup_env_*.sh


    maflcko commented at 7:31 am on March 27, 2023:
    I am thinking that the second user account can be removed completely. I think it is fine to run all tests as root. The reason for #25900 (./depends/ being owned by root) no longer applies as ./depends/ is a docker/podman volume. However, this is probably for a follow-up.

    josibake commented at 5:20 pm on March 27, 2023:
    iirc, ./depends was the only folder affected, so removing the second user account and running as root seems fine.

    maflcko commented at 6:34 am on March 31, 2023:
  9. maflcko commented at 7:33 am on March 27, 2023: member
    lgtm ACK f52d482408af68458f0b5c2775b8a1dffc380466
  10. in ci/test/01_base_install.sh:16 in f52d482408 outdated
    21 
    22 if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
    23-  ${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y install epel-release
    24-  ${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y --allowerasing install "$CI_BASE_PACKAGES" "$PACKAGES"
    25+  ${CI_RETRY_EXE} bash -c "dnf -y install epel-release"
    26+  ${CI_RETRY_EXE} bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES"
    


    maflcko commented at 7:39 am on March 27, 2023:
    0  ${CI_RETRY_EXE} dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES
    

    I guess I know nothing about bash, but putting it this way may also work at no downside?


    vstoyanov commented at 5:06 pm on March 27, 2023:

    It is basically the same trick described in #27321 to be used for apt, dnf is basically the Redhat package manager The other option would be to arrayify PACKAGES and CI_BASE_PACKAGES. I have that in my git stash too, but even though it is a cleaner way of doing it, it actually adds a couple extra lines when initialising the defaults. I value both cleanness and simplicity, so I cannot choose myself which way is better.

    The interesting question is whether I should do the same for pip3 - otherwise the guy who adds a second python package would have to do the same research as me.


    maflcko commented at 7:37 am on March 28, 2023:

    whether I should do the same for pip3

    You are already doing what I suggested for pip3, which is why I left the comment here. I think it makes sense to use the same approach for all three pkg managers (dnf, apt, pip3)

  11. maflcko approved
  12. maflcko commented at 7:40 am on March 27, 2023: member
    left a question/nit, feel free to ignore
  13. vstoyanov closed this on Mar 27, 2023

  14. vstoyanov force-pushed on Mar 27, 2023
  15. vstoyanov commented at 5:01 pm on March 27, 2023: none
    Apologies, could we reopen this one? I tried rebasing to retrigger Cirrus CI
  16. vstoyanov reopened this on Mar 27, 2023

  17. vstoyanov force-pushed on Mar 27, 2023
  18. josibake commented at 5:25 pm on March 27, 2023: member

    Concept ACK

    lgtm (although, CI is failing). happy to re-review once passing. also happy to review any follow-ups to remove the extra user account, since that was only introduced to solve the problem of CI changing file permissions on depends when running CI locally (which seems to no longer be an issue per #27333 (review))

  19. ci: cleanup of CI_EXEC & CI_EXEC_ROOT (refs #27321) b5ef1419ec
  20. vstoyanov force-pushed on Mar 27, 2023
  21. Ayush170-Future commented at 7:14 pm on March 27, 2023: contributor

    ACK on the concept.

    I’ve been following this since the start and have reviewed the changes once again. The approach followed looks good to me. If the checks fail again, I’d be happy to re-review (they are running currently).

  22. DrahtBot requested review from maflcko on Mar 28, 2023
  23. fanquake renamed this:
    ci: cleanup of CI_EXEC & CI_EXEC_ROOT (refs #27321)
    ci: cleanup of CI_EXEC & CI_EXEC_ROOT
    on Mar 28, 2023
  24. hernanmarino approved
  25. hernanmarino commented at 2:33 pm on March 28, 2023: contributor
    untested ACK b5ef1419ece77db77cc196eb541f99a72360a607. LGTM
  26. Ayush170-Future approved
  27. maflcko commented at 5:09 pm on March 30, 2023: member
    Meta note: The author needs to reply to the open discussions. Any reply is fine, but maintainers are likely waiting for it.
  28. fanquake merged this on Mar 30, 2023
  29. fanquake closed this on Mar 30, 2023

  30. fanquake referenced this in commit 5c2bb2b54c on Mar 31, 2023
  31. sidhujag referenced this in commit 99235b18a0 on Apr 1, 2023
  32. bitcoin locked this on Mar 30, 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-10-04 22:12 UTC

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