-
Notifications
You must be signed in to change notification settings - Fork 861
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
add NO_OP mode to rustup-init.sh #3830
base: master
Are you sure you want to change the base?
Conversation
When calling this script, it immediately starts the download process. This change is mostly useful for when we want to source this file from another script file. Signed-off-by: onur-ozkan <work@onurozkan.dev>
What are you actually trying to achieve? I'm not inclined to add complexity to this script in order to support niche use cases like this. You can just copy the source code of the rustup-init.sh. |
fwiw initially I tried adding "--no-op/-n" argument, but passing arguments wasn't working well when sourcing the script file. |
We are replacing the python sources from bootstrap with shell scripts in order to remove python dependency on bootstrap. Which means we need to figure out the target triple and download its stage0 artifacts.
The change is quite simple actually. Do you think copying part of this source will be better in terms of maintainability? It seems much complex solution IMO. |
@djc I think the goal is to reuse Rustup's host triple resolution as a shell script module. @onur-ozkan I guess |
Correct.
I can duplicate the script, I thought it would be much better to import the script right away (as the change we are adding here simply quits the process, it should be stable enough) so we don't have to maintain/sync the another copy. But I see your point, I can copy it as a start. |
@onur-ozkan I mean I don't see why we cannot both depend on some same thing in the end. If you have found out the right boundaries to make the split, we can depend on you instead :) PS: This functionality is especially interesting for our downstreams as well. |
As part of one of my tasks I need to resolve the target triple at the shell script level during the initial bootstrap phase (before rustc is available). The functionality is already implemented in the rustup script and I don't want to duplicate it in the upstream rust repository. My plan is to fetch the rustup script from https://sh.rustup.rs using curl and then
source
it from the caller script, so I can access/execute theget_architecture
function. However, this is not possible because it immediately initiates the download process. As a solution to that, I propose this PR (which is a dead-simple change) that allows us to source this file easily (likeNO_OP=1 . ./rustup-init.sh
) without runnig the actual workflow.