Skip to content

rust: fix host build on x64 Darwin#29688

Merged
BKPepe merged 1 commit into
openwrt:openwrt-25.12from
httpstorm:rust_2026-06-09_v25.12
Jun 9, 2026
Merged

rust: fix host build on x64 Darwin#29688
BKPepe merged 1 commit into
openwrt:openwrt-25.12from
httpstorm:rust_2026-06-09_v25.12

Conversation

@httpstorm

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @lu-zero

Description:
cherry-pick: aa32dd2 original PR: #29685

rust/host fails to compile on macOS running on Intel x64 because the host target triple is autogenerated to be arm64-unknown-linux-. Rust doesn't have such a target triple, thus the build fails because there are no pre-built artefacts for bootstrapping.

Fix this by setting RUSTC_HOST_ARCH to x86_64-apple-darwin in case our host is HOST_ARCH=x86_64 and HOST_OS=Darwin. This fix is based on the existing fix for Apple silicon [1].

Fixes:

make package/feeds/packages/rust/host/compile -j 1 V=s
…
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/x.py", line 53, in <module>
    bootstrap.main()
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/src/bootstrap/bootstrap.py", line 1377, in main
    bootstrap(args)
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/src/bootstrap/bootstrap.py", line 1342, in bootstrap
    build.download_toolchain()
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/src/bootstrap/bootstrap.py", line 684, in download_toolchain
    download_component(download_info)
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/src/bootstrap/bootstrap.py", line 517, in download_component
    get(
  File "/Volumes/pepe/_/openwrt/build_dir/target-x86_64_musl/host/rustc-1.90.0-src/src/bootstrap/bootstrap.py", line 58, in get
    raise RuntimeError(
RuntimeError: src/stage0 doesn't contain a checksum for dist/2025-08-07/rust-std-1.89.0-x86_64-unknown-linux-darwin24.6.0.tar.xz. Pre-built artifacts might not be available for this target at this time, see https://doc.rust-lang.org/nightly/rustc/platform-support.html for more information.

[1] 105fa39
[2] #21837


🧪 Run Testing Details

  • OpenWrt Version: openwrt-24.10 and main (I have not tested build on openwrt-25.12 yet)
  • OpenWrt Target/Subtarget: x64
  • OpenWrt Device: x64
  • Build tested: macOS 15.7.7 Intel

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@robimarko @PolynomialDivision @BKPepe

rust/host fails to compile on macOS running on Intel x64
because the host target triple is autogenerated to be
'arm64-unknown-linux-'. Rust doesn't have such a target triple, thus the
build fails because there are no pre-built artefacts for bootstrapping.

Fix this by setting RUSTC_HOST_ARCH to 'x86_64-apple-darwin' in case
our host is HOST_ARCH=x86_64 and HOST_OS=Darwin.
This fix is based on the existing fix for Apple silicon [1].

Fixes:
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/x.py", line 53, in <module>
    bootstrap.main()
    ~~~~~~~~~~~~~~^^
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/src/bootstrap/bootstrap.py", line 1418, in main
    bootstrap(args)
    ~~~~~~~~~^^^^^^
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/src/bootstrap/bootstrap.py", line 1366, in bootstrap
    build.download_toolchain()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/src/bootstrap/bootstrap.py", line 697, in download_toolchain
    download_component(download_info)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/src/bootstrap/bootstrap.py", line 529, in download_component
    get(
    ~~~^
        download_info.base_download_url,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        verbose=download_info.verbose,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Volumes/pepe/py/openwrt/build_dir/target-x86_64_musl/host/rustc-1.96.0-src/src/bootstrap/bootstrap.py", line 58, in get
    raise RuntimeError(
    ...<6 lines>...
    )
RuntimeError: src/stage0 doesn't contain a checksum for dist/2026-04-16/rust-std-1.95.0-x86_64-unknown-linux-darwin24.6.0.tar.xz. Pre-built artifacts might not be available for this target at this time, see https://doc.rust-lang.org/nightly/rustc/platform-support.html for more information.

[1] openwrt@105fa39

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
(cherry picked from commit aa32dd2)
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
@BKPepe BKPepe merged commit 63c8410 into openwrt:openwrt-25.12 Jun 9, 2026
2 checks passed
@github-actions github-actions Bot added the OpenWrt 25.12 Issues/PR on branch 25.12 label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OpenWrt 25.12 Issues/PR on branch 25.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants