Repository: bitcoin/bitcoin
File: ci/test/00_setup_env_mac_cross.sh (Shell)

Code before:
#!/usr/bin/env bash
#
# Copyright (c) 2019-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}

export CONTAINER_NAME=ci_macos_cross
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/clang (version 19, similar to guix) can cross-compile
export HOST=arm64-apple-darwin
export PACKAGES="clang lld llvm zip"
export XCODE_VERSION=15.0
export XCODE_BUILD_ID=15A240d
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DBUILD_KERNEL_LIB=ON -DREDUCE_EXPORTS=ON"


Review comment (bug):
This lead to a failure: https://github.com/maflcko/bitcoin-core-nightly/actions/runs/19550555322/job/55988016546#step:12:25:

```

stdout:
2025-11-20T22:23:58.576632Z TestFramework (INFO): PRNG seed is: 4045980459550867813
2025-11-20T22:23:58.577475Z TestFramework (INFO): Initializing test directory /Users/runner/work/_temp/test_runner_₿_🏃_20251120_220520/tool_bitcoin_chainstate_201
2025-11-20T22:23:59.071213Z TestFramework (INFO): Testing bitcoin-chainstate ['/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/bin/bitcoin-chainstate'] with datadir: /Users/runner/work/_temp/test_runner_₿_🏃_20251120_220520/tool_bitcoin_chainstate_201/node0
2025-11-20T22:23:59.083094Z TestFramework (INFO): STDERR: dyld[26686]: Library not loaded: libbitcoinkernel.dylib
  Referenced from: <4C4C4422-5555-3144-A14F-EA2BABC42000> /Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/bin/bitcoin-chainstate
  Reason: tried: 'libbitcoinkernel.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibbitcoinkernel.dylib' (no such file), 'libbitcoinkernel.dylib' (no such file), '/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file), '/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file)
2025-11-20T22:23:59.083212Z TestFramework (ERROR): Unexpected exception
Traceback (most recent call last):
  File "/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_framework.py", line 142, in main
    self.run_test()
    ~~~~~~~~~~~~~^^
  File "/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/tool_bitcoin_chainstate.py", line 43, in run_test
    self.add_block(datadir, block_one, "Block has not yet been rejected")
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/tool_bitcoin_chainstate.py", line 34, in add_block
    raise AssertionError(f"Expected stderr output {expected_stderr} does not partially match stderr:\n{stderr}")
AssertionError: Expected stderr output Block has not yet been rejected does not partially match stderr:
dyld[26686]: Library not loaded: libbitcoinkernel.dylib
  Referenced from: <4C4C4422-5555-3144-A14F-EA2BABC42000> /Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/bin/bitcoin-chainstate
  Reason: tried: 'libbitcoinkernel.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibbitcoinkernel.dylib' (no such file), 'libbitcoinkernel.dylib' (no such file), '/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file), '/Users/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/libbitcoinkernel.dylib' (no such file)



Code after:
#!/usr/bin/env bash
#
# Copyright (c) 2019-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}

export CONTAINER_NAME=ci_macos_cross
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/clang (version 19, similar to guix) can cross-compile
export HOST=arm64-apple-darwin
export PACKAGES="clang lld llvm zip"
export XCODE_VERSION=15.0
export XCODE_BUILD_ID=15A240d
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
export BITCOIN_CONFIG="\
 --preset=dev-mode \
 -DWITH_USDT=OFF \
 -DREDUCE_EXPORTS=ON \
"