-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
binstall
installs x86_64 binaries on macOS aarch64 without Rosetta 2 enabled
#857
Comments
I guess we assume you've got Rosetta, but that's not guaranteed |
(To be clear, if you've got Rosetta, x86 is compatible with arm64.) |
Thanks for spotting this bug! Regarding cargo-outdated, you might be able to download that from quickinstall, given that they will build popular crates and crates requested by cargo-quickinstall and cargo-binstall. |
Yeah and we probably want to add another check for this. |
Seems like MacOS provides no API to check whether Rosetta is enabled, so we will have to fallback to running a x86-64 binary to see if it can be run. |
Ah, I completely forgot about Rosetta; I'm not running any x86_64 apps/binaries on my system and haven't enabled it.
I see a couple different options:
This could also inform the user about other options like quickinstall.
On my machine this check fails (as expected) like this:
|
binstall
installs incompatible x86_64 binaries on macOS aarch64binstall
installs x86_64 binaries on macOS aarch64 without Rosetta 2 enabled
Fixed #857 Run `arch -arch x86_64 /usr/bin/true` to check whether rosetta2 is enabled and working. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Hi there 👋
New to using
cargo-binstall
so I hope I'm not misunderstanding the behaviour here, but it seems to be downloading binaries that I can't run on macOS aarch64 (e.g.,aarch64-apple-darwin
).I wanted to try installing https://github.com/kbknapp/cargo-outdated (which apparently - at least at time of writing - doesn't have prebuilt
aarch64-apple-darwin
artifacts).I can see from
cargo binstall cargo-outdated --log-level debug
thatcargo-binstall
tries a bunch of extension permutations foraarch64-apple-darwin
and thenuniversal-apple-darwin
, but then it also triesx86_64-apple-darwin
which it dutifully downloaded:but which isn't a compatible architecture for my machine:
I also want to note that the selected architecture/"winning" URL is only visible if you pass
--log-level debug
, otherwise only the crate name and version are printed:I can see that
x86_64-apple-darwin
is an alternative target based on this lookup:cargo-binstall/crates/detect-targets/src/detect/macos.rs
Line 7 in 9c7da6a
but since
x86_64-apple-darwin
isn't compatible withaarch64-apple-darwin
I don't think this is desireable?Forcing the target with
--target aarch64-apple-darwin
results in the expected (at least for me) behaviour of offering to build from source, given that https://github.com/kbknapp/cargo-outdated doesn't have prebuilt binaries for my architecture, though it would be nice if it indicated why it was building from source: that no matching artifact was found.The text was updated successfully, but these errors were encountered: