ci: Check DLL imports of cross-built `bitcoind.exe` #35931

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:260807-ci-win-imports changing 2 files +32 −0
  1. hebasto commented at 2:12 PM on August 7, 2026: member

    Run dumpbin.exe /imports on the cross-built bitcoind.exe in the "Windows, test cross-built" jobs to list the imported DLLs and to ensure the executable is linked against the expected C runtime.

    This came up during a discussion in #35877 (here and here). Inspired by the analogous CI steps in https://github.com/hebasto/bitcoin-core-nightly.

  2. hebasto added the label Windows on Aug 7, 2026
  3. hebasto added the label Tests on Aug 7, 2026
  4. DrahtBot commented at 2:12 PM on August 7, 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/35931.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, jeanpablojp

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. ci: Check DLL imports of cross-built `bitcoind.exe`
    Run `dumpbin.exe /imports` on the cross-built `bitcoind.exe` in the
    "Windows, test cross-built" jobs to list the imported DLLs and to
    ensure the executable is linked against the expected C runtime.
    67fee5bf44
  6. hebasto force-pushed on Aug 7, 2026
  7. DrahtBot added the label CI failed on Aug 7, 2026
  8. maflcko commented at 3:05 PM on August 7, 2026: member

    lgtm ACK 67fee5bf440c24eb708bfc40da46c23595e5a4f4

  9. DrahtBot removed the label CI failed on Aug 7, 2026
  10. jeanpablojp commented at 7:39 PM on August 9, 2026: none

    ACK 67fee5bf440c24eb708bfc40da46c23595e5a4f4

    I have tested the code: I ran check_imports from the branch against a stand-in dumpbin.exe fed with this PR's own CI output (run 31188572449). The parsed list matches what both jobs printed, and the cases CI does not reach fail as they should: wrong CRT either way, both runtimes at once, and an empty DLL list all exit 1. So the check fails closed if dumpbin's output format ever changes.

  11. hebasto merged this on Aug 12, 2026
  12. hebasto closed this on Aug 12, 2026

  13. in .github/ci-windows-cross.py:48 in 67fee5bf44
      43 | +    dlls = {name.lower() for name in dlls}
      44 | +    uses_msvcrt = "msvcrt.dll" in dlls
      45 | +    uses_ucrt = any(name.startswith("api-ms-win-crt-") for name in dlls)
      46 | +    crt = os.environ["CRT"]
      47 | +    if crt == "msvcrt":
      48 | +        crt_ok = uses_msvcrt and not uses_ucrt
    


    fanquake commented at 9:01 AM on August 12, 2026:

    Can any of these mixed runtime conditions actually happen? These checks seem a bit convoluted.


    hebasto commented at 9:19 AM on August 12, 2026:

    Can any of these mixed runtime conditions actually happen?

    Maybe due to a bug in one of the build tools?


    fanquake commented at 9:30 AM on August 12, 2026:

    Maybe due to a bug in one of the build tools?

    Ok, so these are "tests" for a broken system packager, or OS? That seems a bit out of scope here.


    hebasto commented at 9:45 AM on August 12, 2026:

    The test is intended to verify the list of linked libraries against the expected subset, without enumerating the exact causes of a possible mismatch.

  14. in .github/ci-windows-cross.py:52 in 67fee5bf44
      47 | +    if crt == "msvcrt":
      48 | +        crt_ok = uses_msvcrt and not uses_ucrt
      49 | +    elif crt == "ucrt":
      50 | +        crt_ok = uses_ucrt and not uses_msvcrt
      51 | +    else:
      52 | +        sys.exit(f"Unexpected CRT value: {crt!r}")
    


    fanquake commented at 9:01 AM on August 12, 2026:

    How could this happen?


    hebasto commented at 9:22 AM on August 12, 2026:

    fanquake commented at 9:36 AM on August 12, 2026:

    Ok. Maybe we can write these checks in a way where the crt values are used, so any problem is a runtime failure, rather than additional code to check for typos.


    hebasto commented at 9:53 AM on August 12, 2026:

    Perhaps someone could address this in a follow-up?

  15. hebasto deleted the branch on Aug 12, 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-08-31 17:51 UTC

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