ci: add OpenBSD Clang cross job #35397

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:openbsd_clang_cross changing 4 files +61 −0
  1. fanquake commented at 3:27 PM on May 27, 2026: member

    This adds a Linux cross job for OpenBSD; similar to #34491 (FreeBSD).

  2. DrahtBot added the label Tests on May 27, 2026
  3. DrahtBot commented at 3:27 PM on May 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35397.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto, willcl-ark
    Concept ACK sedited

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. fanquake commented at 3:27 PM on May 27, 2026: member

    bitcoin-chainstate and test_kernel currently fail to link

    cc @sedited

  5. DrahtBot added the label CI failed on May 27, 2026
  6. DrahtBot commented at 4:24 PM on May 27, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task OpenBSD Cross: https://github.com/bitcoin/bitcoin/actions/runs/26520966708/job/78111604124</sub> <sub>LLM reason (✨ experimental): ld.lld failed to link bitcoin-chainstate due to “non-exported symbol” errors from the OpenBSD SDK’s libc.a (e.g., __cxa_atexit, malloc, memcpy, strlen).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. sedited commented at 5:50 PM on May 27, 2026: contributor

    Concept ACK

    I guess a similar treatment could also be done for freebsd.

  8. fanquake commented at 9:03 AM on May 28, 2026: member

    I guess a similar treatment could also be done for freebsd.

    Do you mean NetBSD? We added a Clang cross FreeBSD job in #34491.

  9. fanquake force-pushed on May 28, 2026
  10. in .github/workflows/ci.yml:540 in 44d10a78eb outdated
     550 | +            warp-runner: 'warp-ubuntu-latest-x64-16x'
     551 |              fallback-runner: 'ubuntu-24.04'
     552 |              timeout-minutes: 120
     553 |              file-env: './ci/test/00_setup_env_native_msan.sh'
     554 |  
     555 | +          - name: 'OpenBSD Cross'
    


    maflcko commented at 4:34 PM on May 28, 2026:

    nit: Can you move this one up, so that the bsd ones are nicely grouped?


    fanquake commented at 4:38 PM on May 28, 2026:

    Moved up

  11. in .github/workflows/ci.yml:542 in 44d10a78eb outdated
     552 |              timeout-minutes: 120
     553 |              file-env: './ci/test/00_setup_env_native_msan.sh'
     554 |  
     555 | +          - name: 'OpenBSD Cross'
     556 | +            warp-runner: 'warp-ubuntu-latest-x64-8x'
     557 | +            fallback-runner: 'ubuntu-24.04'
    


    maflcko commented at 4:35 PM on May 28, 2026:

    unrelated nit: Seems odd that wrap is using -latest-, but fallback is using Noble.

    Could add a prepare-commit to move all GH fallback ones to -latest as well?


    maflcko commented at 4:36 PM on May 28, 2026:

    Also, since you are touching "CI", could address the nit from #35378#pullrequestreview-4382590112? but feel free to ignore those nits, not important


    fanquake commented at 8:07 AM on May 29, 2026:

    Put both into #35408

  12. fanquake force-pushed on May 28, 2026
  13. fanquake force-pushed on May 28, 2026
  14. fanquake commented at 4:39 PM on May 28, 2026: member

    Depends Qt builds, but CMake can't seem to find it, so I have dropped Qt for now.

    cc @hebasto, you might want to have a look here.

  15. fanquake force-pushed on May 29, 2026
  16. maflcko commented at 9:20 AM on May 29, 2026: member

    I guess a similar treatment could also be done for freebsd.

    Do you mean NetBSD?

    Yeah, given that apparently all three of them can run into unrelated/orthogonal(?) build issues, it could make sense to check all of them

  17. sedited commented at 9:23 AM on May 29, 2026: contributor

    Do you mean NetBSD? We added a Clang cross FreeBSD job in #34491.

    Yes, not sure why I confused them.

  18. fanquake commented at 1:42 PM on May 29, 2026: member

    Put up something for NetBSD here: #35412.

  19. fanquake referenced this in commit 214ad1761b on May 29, 2026
  20. fanquake force-pushed on May 29, 2026
  21. hebasto commented at 5:01 PM on May 31, 2026: member

    Depends Qt builds, but CMake can't seem to find it, so I have dropped Qt for now.

    cc @hebasto, you might want to have a look here.

    Sure. Pleas check out #35427.

  22. hebasto commented at 5:39 PM on May 31, 2026: member

    9bb19b65bf4ec0a65d091aaafac193e59099f198 breaks compilation on OpenBSD:

    $ uname -rs
    OpenBSD 7.8
    $ gmake -C depends -j 10 libevent
    <snip>
    [ 39%] Linking C static library lib/libevent_core.a
    Error running link command: no such file or directorygmake[3]: *** [CMakeFiles/event_core_static.dir/build.make:389: lib/libevent_core.a] Error 2
    gmake[2]: *** [CMakeFiles/Makefile2:97: CMakeFiles/event_core_static.dir/all] Error 2
    gmake[1]: *** [Makefile:136: all] Error 2
    gmake[1]: Leaving directory '/home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.8/libevent/2.1.12-stable-1e1062d7183/build'
    gmake: *** [funcs.mk:343: /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.8/libevent/2.1.12-stable-1e1062d7183/build/.stamp_built] Error 2
    gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
    
  23. fanquake commented at 5:58 PM on May 31, 2026: member

    https://github.com/bitcoin/bitcoin/commit/9bb19b65bf4ec0a65d091aaafac193e59099f198 breaks compilation on OpenBSD: Error running link command: no such file or directory

    That looks more like a misconfigured environment, or you've forgotten a build dependency?

  24. hebasto commented at 8:26 PM on May 31, 2026: member

    9bb19b6 breaks compilation on OpenBSD: Error running link command: no such file or directory

    That looks more like a misconfigured environment, or you've forgotten a build dependency?

    I believe this demo run clearly isolates the issue:

    • On the master branch: the build passes.
    • On this PR branch: the build fails.

    UPDATE, I got the result in my comment above locally, not in the GHA environment.

  25. fanquake commented at 8:34 PM on May 31, 2026: member

    I believe this demo run clearly isolates the issue:

    It's still the same error as above: Error running link command: no such file or directory. gmake is trying to run the archiver (llvm-ar), and it's failing. Did you install llvm, so that llvm-ar is available?

  26. hebasto commented at 9:15 PM on May 31, 2026: member

    I believe this demo run clearly isolates the issue:

    It's still the same error as above: Error running link command: no such file or directory. gmake is trying to run the archiver (llvm-ar), and it's failing. Did you install llvm, so that llvm-ar is available?

    The list of the installed packages is exactly as documented:https://github.com/bitcoin/bitcoin/blob/fbe628756cc417dd4b6ccd9d3a709ca8e2f6023c/depends/README.md?plain=1#L52-L55

    If this PR introduces a new build dependency (llvm) when building on OpenBSD, that constitutes a regression and should be fixed.

  27. rustaceanrob referenced this in commit eee9e69ff2 on Jun 5, 2026
  28. fanquake commented at 10:50 AM on June 12, 2026: member

    Now based on #35427, and dropped some of the llvm usage.

  29. fanquake force-pushed on Jun 12, 2026
  30. fanquake force-pushed on Jun 12, 2026
  31. fanquake force-pushed on Jun 12, 2026
  32. fanquake force-pushed on Jun 12, 2026
  33. fanquake force-pushed on Jun 12, 2026
  34. fanquake force-pushed on Jun 12, 2026
  35. hebasto commented at 7:50 AM on June 14, 2026: member

    a6b89a59b1a334830a1ad47791edab37db7d1945

    Now based on #35427...

    It seems that not only the ranlib fixes were taken from 260531-openbsd-qt-cross, but the top commit was included as well, which is incorrect.

    It should actually be taken from #35427, which includes files like depends/patches/freetype/openbsd_versioning.patch.

  36. hebasto commented at 10:38 AM on June 14, 2026: member

    https://github.com/bitcoin/bitcoin/actions/runs/27414843225/job/81025003056:

    <snip>
    ld.lld: error: undefined symbol: XML_ParserCreate
    >>> referenced by fcxml.c
    >>>               fcxml.o:(FcConfigParseAndLoadFromMemoryInternal) in archive /home/runner/work/_temp/depends/x86_64-unknown-openbsd/lib/libfontconfig.a
    
    <snip>
    

    It seems the issue is that, despite the --disable-static configure option, the fontconfig package was still configured as a static library:

    <snip>
    checking if libtool supports shared libraries... no
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes
    <snip>
    
  37. fanquake force-pushed on Jun 15, 2026
  38. fanquake force-pushed on Jun 25, 2026
  39. fanquake commented at 12:13 PM on June 25, 2026: member

    Dropped the QT changes back out, as well as most of the /depends changes. Marked reviewable.

  40. fanquake marked this as ready for review on Jun 25, 2026
  41. fanquake force-pushed on Jun 25, 2026
  42. DrahtBot removed the label CI failed on Jun 25, 2026
  43. fanquake force-pushed on Jun 26, 2026
  44. fanquake commented at 3:08 PM on June 26, 2026: member

    Fixed this for BUILD_KERNEL_LIB/BUILD_UTIL_CHAINSTATE.

  45. Kino1994 referenced this in commit 58aa6f27f9 on Jun 28, 2026
  46. depends: add openbsd_LDFLAGS 5404b62074
  47. ci: add openBSD cross CI job d64ea15824
  48. fanquake force-pushed on Jun 29, 2026
  49. in ci/test/01_base_install.sh:135 in d64ea15824
     130 | +      ${CI_RETRY_EXE} curl --location --fail "https://cdn.openbsd.org/pub/OpenBSD/${OPENBSD_VERSION}/amd64/${OPENBSD_SDK_FILENAME}" -o "$OPENBSD_SDK_PATH"
     131 | +    fi
     132 | +    tar -C "${DEPENDS_DIR}/SDKs/${OPENBSD_SDK_BASENAME}" -xf "$OPENBSD_SDK_PATH"
     133 | +    (
     134 | +      # The SDK has versioned shared libs, but no unversioned libfoo.so symlink,
     135 | +      # which breaks linking the kernel with lld. Create the symlinks.
    


    hebasto commented at 3:21 PM on June 29, 2026:

    Is this an lld's issue?


    fanquake commented at 4:14 PM on June 29, 2026:

    Not sure I understand the question?


    hebasto commented at 4:17 PM on June 29, 2026:

    "The SDK has versioned shared libs, but no unversioned libfoo.so symlink..." -- this is a standard on OpenBSD.

    "... which breaks linking the kernel with lld" -- Why does the standard naming of shared libraries break linking?


    fanquake commented at 4:32 PM on June 29, 2026:

    Why does the standard naming of shared libraries break linking?

    Because here we are using an lld that doesn't have OpenBSDs patches applied to it, i.e :https://github.com/openbsd/ports/blob/master/devel/llvm/22/patches/patch-lld_ELF_DriverUtils_cpp.

  50. in ci/test/00_setup_env_openbsd_cross.sh:16 in d64ea15824
      11 | +export APT_LLVM_V="22"
      12 | +export HOST=x86_64-unknown-openbsd
      13 | +export OPENBSD_VERSION=7.9
      14 | +export OPENBSD_SDK_BASENAME="openbsd-${HOST}-${OPENBSD_VERSION}"
      15 | +export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld"
      16 | +export SYSROOT="--sysroot=${DEPENDS_DIR}/SDKs/${OPENBSD_SDK_BASENAME}"
    


    hebasto commented at 4:13 PM on June 29, 2026:

    In this PR, the --sysroot option is externalized, whereas in #34491 it was hardcoded in the host-specific include file in depends.

    Could you clarify the reasoning behind this difference in approach?


    fanquake commented at 4:14 PM on June 29, 2026:

    I'll likely change the FreeBSD build to match what's being done here, and with NetBSD.


    hebasto commented at 6:29 PM on June 30, 2026:

    ... similar to #34491 (FreeBSD).

    This part in the PR description seems outdated now.


    fanquake commented at 2:03 PM on July 3, 2026:

    Followed up in #35649.

  51. BigcoinBGC referenced this in commit 225fdde042 on Jun 30, 2026
  52. hebasto commented at 6:23 PM on June 30, 2026: member

    It seems the issue is that, despite the --disable-static configure option, the fontconfig package was still configured as a static library:

    <snip>
    checking if libtool supports shared libraries... no
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes
    <snip>
    

    A note for my future self:

    I believe this is a Libtool bug. The fix was introduced in 323d8a5dfd80b9e3eb649cdf2a08a7cb9d6ba833 and is available in v2.5.4.

    The first fontconfig version to bundle the fixed Libtool in its source tarball is 2.16.0.

  53. hebasto approved
  54. hebasto commented at 6:27 PM on June 30, 2026: member

    ACK d64ea158240ce030995e4bc38d077685c241e931.

  55. DrahtBot requested review from sedited on Jun 30, 2026
  56. hebasto commented at 6:27 PM on June 30, 2026: member
  57. willcl-ark approved
  58. willcl-ark commented at 7:56 AM on July 1, 2026: member

    ACK d64ea158240ce030995e4bc38d077685c241e931

  59. hebasto merged this on Jul 1, 2026
  60. hebasto closed this on Jul 1, 2026

  61. fanquake deleted the branch on Jul 1, 2026
  62. fanquake referenced this in commit 81e77ee95f on Jul 3, 2026
  63. fanquake referenced this in commit ed83c0dfbd on Jul 3, 2026

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-07-09 06:47 UTC