ci: Use Homebrew’s gcc in native macOS task #1402

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:230816-brew-gcc changing 2 files +8 −0
  1. hebasto commented at 10:32 am on August 16, 2023: member

    Fixes an issue noticed in #1394 (comment):

    This uses the wrong GCC, namely Clang

    When CC=gcc:

    0+ gcc -v
    1Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    2Target: arm64-apple-darwin22.5.0
    3Thread model: posix
    4InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    
    • with this PR:
    0+ gcc -v
    1Using built-in specs.
    2COLLECT_GCC=gcc
    3COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/aarch64-apple-darwin22/13/lto-wrapper
    4Target: aarch64-apple-darwin22
    5Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 13.1.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=aarch64-apple-darwin22 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
    6Thread model: posix
    7Supported LTO compression algorithms: zlib zstd
    8gcc version 13.1.0 (Homebrew GCC 13.1.0) 
    
  2. hebasto cross-referenced this on Aug 16, 2023 from issue ci, gha: Run "x86_64: macOS Ventura" job on GitHub Actions by hebasto
  3. in .cirrus.yml:141 in 7fdfb6ed43 outdated
    139+    - env: {WIDEMUL: int128,  RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc-13}
    140     - env: {WIDEMUL: int128,  RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CPPFLAGS: -DVERIFY}
    141     - env: {BUILD: distcheck}
    142   brew_script:
    143-    - brew install automake libtool gcc
    144+    - brew install automake libtool gcc@13
    


    real-or-random commented at 10:42 am on August 16, 2023:
    nit: What about keeping “gcc” (without @13) and simply adding ln -sf /usr/local/bin/gcc-* /usr/bin/gcc? This is independent of the version, and it will make it easier not to screw up in the future?

    hebasto commented at 10:49 am on August 16, 2023:
    Thanks! Done.

    hebasto commented at 11:30 am on August 16, 2023:

    nit: What about keeping “gcc” (without @13) and simply adding ln -sf /usr/local/bin/gcc-* /usr/bin/gcc? This is independent of the version, and it will make it easier not to screw up in the future?

    0ln -sf /usr/local/bin/gcc-* /usr/bin/gcc
    1ln: /usr/bin/gcc: Read-only file system
    

    real-or-random commented at 11:44 am on August 16, 2023:

    Oh, it fails, sorry. (“Read-only file system”) I suggest this instead:

    0ln -s /opt/homebrew/bin/gcc-?? /opt/homebrew/bin/gcc
    

    (Tested to work using Cirrus CI console.)


    hebasto commented at 1:08 pm on August 16, 2023:
    Done.
  4. hebasto force-pushed on Aug 16, 2023
  5. real-or-random commented at 11:19 am on August 16, 2023: contributor

    We could add this to cirrus.sh to prevent these issues in the future:

    0# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang)
    1if [[ $CC == *gcc* ]] && ! $CC -v 2>&1 | grep -q "gcc version"; then exit 1; fi
    
  6. real-or-random added the label ci on Aug 16, 2023
  7. hebasto force-pushed on Aug 16, 2023
  8. hebasto commented at 1:08 pm on August 16, 2023: member

    We could add this to cirrus.sh to prevent these issues in the future:

    0# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang)
    1if [[ $CC == *gcc* ]] && ! $CC -v 2>&1 | grep -q "gcc version"; then exit 1; fi
    

    Adopted for https://github.com/bitcoin-core/secp256k1/blob/eedd781085b1f6587ba6e91656fada5f6861a693/ci/cirrus.sh#L1 and implemented.

  9. ci: Use Homebrew's gcc in native macOS task
    Co-authored-by: Tim Ruffing <crypto@timruffing.de>
    d62db57427
  10. hebasto force-pushed on Aug 16, 2023
  11. real-or-random approved
  12. real-or-random commented at 2:29 pm on August 16, 2023: contributor
    ACK d62db57427f60da57f936cbe049ee27b10c3f8d4, it works: https://cirrus-ci.com/task/6200190252613632?logs=test#L27
  13. real-or-random merged this on Aug 16, 2023
  14. real-or-random closed this on Aug 16, 2023

  15. hebasto deleted the branch on Aug 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 03:15 UTC

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