Skip to content

feat(rustup-init/sh): add env var to print arch detection result #4183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Feb 15, 2025

This PR tries to achieve #3830's goal...

fetch the rustup script [..] and then source it from the caller script, so I can access/execute the get_architecture function [..]

... but in a more proper way:

> RUSTUP_INIT_SH_PRINT=arch ./rustup-init.sh
aarch64-apple-darwin

> ./rustup-init.sh
# The installer executes normally

This is inspired by rustc's own dry-run mode which is controlled by the --print=<field> option, but I made it an env var instead because ./rustup-init.sh --help is always redirected to ./rustup-init --help as you might have noticed.

In the future we could possibly add support for more info if needed.

cc @onur-ozkan for review, and I'm really sorry for the huge delay! 🙇

@rami3l rami3l requested review from djc and ChrisDenton February 15, 2025 03:03
@rami3l rami3l force-pushed the feat/rustup-init-print branch from 505fb80 to 427d7d6 Compare February 15, 2025 03:04
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@rami3l rami3l added this pull request to the merge queue Feb 16, 2025
Merged via the queue into rust-lang:master with commit e9fef8f Feb 16, 2025
29 checks passed
@rami3l rami3l deleted the feat/rustup-init-print branch February 16, 2025 16:23
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.

3 participants