-
Notifications
You must be signed in to change notification settings - Fork 81
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
Is it possible to request an x86_64 download while on an ARM Mac? #1720
Comments
Looks like this was intentional (and recent) from I wonder if we could have a way to opt out of this? Unfortunately github doesn't provide a pure intel mac runner, so it will always be an ARM mac that this call is run from |
hey @DavisVaughan ! thank you so much for the detailed issue, i think your conclusion is correct that it forces the intel installer. i hadn't considered your usecase but it makes sense! my initial thought is that we might want to introduce an env var that can force the arch (similar to ones we support for install location)... do you think that would work? if you'd be interested in contributing we'd happily mentor you on how to do it! |
I thought about this a bit more and realized that it is possible we were sort of abusing cargo-dist's intended purpose here. AFAICT, cargo-dist's main purpose is to help get you set up to run the tool, and in that case I think outsmarting Rosetta emulation as cargo-dist currently does is probably the right move. In our particular case, we were just using the installer script as a really smart and easy file downloader, which helped us then bundle the binary into the right place. It was fairly easy to reproduce that ourselves, since we know which platform we are downloading for already posit-dev/air#201. I looked at the shell installers a bit more and I'm not even entirely sure what the environment variable would look like. Would it be unix only? It seems like on windows there are quite a few architectures to pick from ( cargo-dist/cargo-dist/templates/installer/installer.ps1.j2 Lines 179 to 185 in f5d0250
So all in all I'm mostly convinced this was us just using it wrong. I'll let you all decide if you want to keep this issue open or not! Thanks for the quick response though! |
I think it makes sense for cargo-dist to download the native version whenever possible, given that the goal of the installers is to install it for the system. It might make more sense for downloading the files to be done via a small independent tool. Downloading archives from GitHub and optionally extracting some common formats (at least .zip, .tar.gz, .tar.xz) can definitely be done entirely in Rust. (I've made a tool for downloading files from GitHub Releases before, but it's in Python, and it looks like your project already involves 3 languages -- so I can't say I'd recommend it.) Unless such a tool exists as an executable that doesn't need a separate runtime, I think the change you made is probably the best option. |
I'm going to go ahead and close this since it seems like the best answers are "use |
Agreed @duckinator, thanks for taking a look! |
Consider the following
I was actually expecting to get the
x86_64-apple-darwin
binary here, but I think this part of the installer script thwarts thiscargo-dist/cargo-dist/templates/installer/installer.sh.j2
Lines 946 to 958 in 318d14d
At least, that's my understanding based on comparing this output to the script
In my use case, I have a github actions script that is supposed to be downloading the x86_64 and aarch64 artifacts from the release page to be bundled into a VS Code extension
https://github.com/posit-dev/air/blob/dde788fe6a840bd63854c082eff062c44d086ea1/.github/workflows/release-vscode.yml#L28-L52
It currently doesn't work right because I forgot to specify with
arch -x86_64 curl
vsarch -arm64 curl
, but it seems like based on my above experience that also won't do the right thing because the installer script "sees through" thearch -x86_64
and downloads the ARM build anyways.So, I guess the question is: How could I download the x86_64 build on arm mac?
The text was updated successfully, but these errors were encountered: