Skip to content

Use isolated rustup on Windows#29

Merged
terasakisatoshi merged 2 commits into
mainfrom
windows-isolated-rustup
Apr 26, 2026
Merged

Use isolated rustup on Windows#29
terasakisatoshi merged 2 commits into
mainfrom
windows-isolated-rustup

Conversation

@terasakisatoshi
Copy link
Copy Markdown
Member

@terasakisatoshi terasakisatoshi commented Apr 26, 2026

Summary

  • avoid installing the full Windows Rust tarball through Julia Artifacts
  • install the Rust version from Artifacts.toml via isolated rustup on Windows
  • keep RUSTUP_HOME and CARGO_HOME under a package scratchspace without modifying PATH
  • document the special Windows installation path in the README
  • add a small unpacked-dist installer test

Verification

  • julia --project -e "using Pkg; Pkg.test()"

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d5f6451d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/RustToolChain.jl
Comment on lines +120 to +121
download(_windows_rustup_init_url(), rustup_init)
run(setenv(`$rustup_init --default-toolchain none --no-modify-path -y`, env))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add integrity check for downloaded rustup-init

The Windows bootstrap path downloads rustup-init.exe and executes it immediately, but there is no checksum or signature verification before run(...). This removes the artifact-level hash pinning the package otherwise relies on and allows a compromised endpoint/proxy/CA path to run arbitrary code during installation. Please verify the installer against a pinned digest (or fetch it through a hashed artifact) before execution.

Useful? React with 👍 / 👎.

Comment thread src/RustToolChain.jl
end

function _windows_rustup_init_url()
arch = Sys.ARCH === :aarch64 ? "aarch64" : "x86_64"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Map i686 Windows to the correct rustup architecture

This architecture mapping falls back to "x86_64" for every non-aarch64 target, so Sys.ARCH == :i686 will incorrectly download/use x86_64 tooling. On 32-bit Windows hosts this breaks toolchain installation even though Artifacts.toml includes an i686 Windows target. Add an explicit i686 mapping (and a hard error for unsupported arches) instead of defaulting to x86_64.

Useful? React with 👍 / 👎.

@terasakisatoshi terasakisatoshi merged commit e252d51 into main Apr 26, 2026
8 checks passed
@terasakisatoshi terasakisatoshi deleted the windows-isolated-rustup branch April 26, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant