lint: detect arch for mlc binary #34832

pull willcl-ark wants to merge 1 commits into bitcoin:master from willcl-ark:lint-arch changing 1 files +2 −3
  1. willcl-ark commented at 11:01 am on March 16, 2026: member

    In testing #34547 it has been observed that the lint container does not run on aarch64-linux without qemu binfmt (or similar).

    This is because some tools are hardcoded to download x64 linux binaries. This has meant the linter works fine on:

    • x64 linux
    • aarch64 MacOS (via Rosetta)
    • platforms using qemu

    But does not work on e.g. aarch64-linux without qemu.

    shellcheck`` offer many platforms: https://github.com/koalaman/shellcheck/releases/tag/v0.11.0 and mlc` offers are least x64 and aarch64 linux https://github.com/becheran/mlc/releases/tag/v1.2.0.

    Try to download the correct binary for the platform using uname detection. This should see the linter work on native aarch64 + amd64, whilst maintaining current (emulated) compatibility.

  2. DrahtBot commented at 11:02 am on March 16, 2026: 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 maflcko
    Concept ACK fanquake

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  3. fanquake renamed this:
    Lint arch
    lint: detect arch for mlc binary
    on Mar 16, 2026
  4. DrahtBot added the label Tests on Mar 16, 2026
  5. in ci/lint/01_install.sh:50 in b34be032fa
    46@@ -47,12 +47,20 @@ ${CI_RETRY_EXE} pip3 install \
    47   ruff==0.15.5
    48 
    49 SHELLCHECK_VERSION=v0.11.0
    50-curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \
    51+curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" | \
    


    maflcko commented at 11:49 am on March 16, 2026:
    0curl --fail -L "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" | \
    

    nit: Instead of --silent it could make more sense to --fail. Otherwise, an http error will silently be ignored. E.g.

    0sh-5.3$ curl --fail -L "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" 
    1curl: (22) The requested URL returned error: 404
    2sh-5.3$ echo $?
    322
    4sh-5.3$ curl -L "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" 
    5Not Foundsh-5.3$ echo $?
    60
    
  6. willcl-ark force-pushed on Mar 16, 2026
  7. fanquake commented at 1:45 am on March 17, 2026: member
    Concept ACK - seems fine with / without the fallback. I doubt this is being run on anything other than x86_64 & aarch64.
  8. in ci/lint/01_install.sh:64 in f6f92650a5
    61+case "$MLC_ARCH" in
    62+  x86_64|aarch64) ;;
    63+  *) MLC_ARCH="x86_64" ;;
    64+esac
    65+MLC_BIN="mlc-${MLC_ARCH}-linux"
    66 curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
    


    maflcko commented at 6:00 am on March 17, 2026:
    0curl --fail -L "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/mlc-${uname --machine}-linux" -o "/usr/bin/mlc"
    

    Same here (about –fail), and using –machine.

    I think it is fine to fail on riscv64 et al. I’d doubt anyone runs on those platforms, and if they did, I am sure they must specify this diff either way (with this pull or without it):

    0diff --git a/ci/lint.py b/ci/lint.py
    1index 6c7e0e8ad4..e788c71770 100755
    2--- a/ci/lint.py
    3+++ b/ci/lint.py
    4@@ -46,3 +46,3 @@ def main():
    5         "build",
    6-        "--platform=linux",
    7+        "--platform=linux/amd64",
    8         f"--tag={container}",
    
  9. willcl-ark force-pushed on Mar 17, 2026
  10. in ci/lint/01_install.sh:55 in c8d0061058
    53 mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
    54 
    55 MLC_VERSION=v1.2.0
    56-MLC_BIN=mlc-x86_64-linux
    57-curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
    58+MLC_BIN="mlc-${MLC_ARCH}-linux"
    


    maflcko commented at 8:00 am on March 17, 2026:
    unused? Can remove and squash commits?
  11. willcl-ark force-pushed on Mar 17, 2026
  12. DrahtBot added the label CI failed on Mar 17, 2026
  13. fanquake added the label Needs Backport (31.x) on Mar 17, 2026
  14. fanquake commented at 9:26 am on March 17, 2026: member

    https://github.com/bitcoin/bitcoin/actions/runs/23184345448/job/67364105546?pr=34832:

    0[16](https://github.com/bitcoin/bitcoin/actions/runs/23184345448/job/67364105546?pr=34832#step:6:4017)
    189.61 + MLC_VERSION=v1.2.0
    289.61 /install.sh: line 55: [https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/mlc-${uname](https://github.com/becheran/mlc/releases/download/$%7BMLC_VERSION%7D/mlc-$%7Buname) --machine}-linux: bad substitution
    
  15. maflcko commented at 9:29 am on March 17, 2026: member

    lol, sorry, I can’t write Bash. I guess the { should be (

    edit: Could rewrite the Bash to python after #34547 :sweat_smile:

  16. ci: Use arch-appropriate binaries in lint install
    Replace the hardcoded x86_64 binary name with $(uname --machine) so the
    correct binary is downloaded when building the lint container, where at
    all possible.
    551875360c
  17. willcl-ark force-pushed on Mar 17, 2026
  18. maflcko commented at 10:01 am on March 17, 2026: member
    lgtm ACK 551875360cdb3b9997dded22b929039eac635fd0
  19. DrahtBot requested review from fanquake on Mar 17, 2026
  20. willcl-ark commented at 10:10 am on March 17, 2026: member

    lol, sorry, I can’t write Bash. I guess the { should be (

    No, it’s my fault for trying to fix too quickly before leaving the house. Fixed (and tested!) now.

  21. DrahtBot removed the label CI failed on Mar 17, 2026
  22. fanquake commented at 1:33 pm on March 17, 2026: member
    ack 551875360cdb3b9997dded22b929039eac635fd0
  23. fanquake merged this on Mar 17, 2026
  24. fanquake closed this on Mar 17, 2026

  25. fanquake referenced this in commit a69f8c329e on Mar 17, 2026
  26. fanquake removed the label Needs Backport (31.x) on Mar 17, 2026
  27. fanquake commented at 1:39 pm on March 17, 2026: member
    Backported to 31.x in #34800.

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-04-05 12:13 UTC

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