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
Invalid arch detection when installing Dart? #26
Comments
Yes this issue related to #2 unfortunately i'm really not familar with architectures and which arch supports which and etc. At present, the only way would be is to manually set the arch with
Both of the above method sets the I hope this should solve the issue? |
In my case, I indeed use Because, I am using #!/bin/zsh
if [[ $(uname -m) == 'aarch64' ]]; then
dsm install --arch arm64 $1;
else
dsm install $1;
fi I don't know rust well and don't everything that is happening inside https://github.com/Yakiyo/dsm/blob/main/src/arch.rs But am I correct to guess that the code in https://github.com/Yakiyo/dsm/blob/main/src/arch.rs is actually decided at compilation time? I am saying that because from my research With this hypothesis, is it possible that the problem is not actually Lines 71 to 79 in 22f9794
Should be changed to Inside of my VM if I run the following script which is a copy of the #!/bin/bash
set -e
OS=$(echo `uname -s`|tr '[:upper:]' '[:lower:]')
case "$OS" in
mingw*) OS='windows';;
msys*) OS='windows';;
esac
filename() {
if [ "$OS" = "linux" ]; then
case "$(uname -m)" in
arm | armv7*)
FILENAME="arm-unknown-linux-gnueabihf"
;;
*)
FILENAME="x86_64-unknown-linux-musl"
esac
elif [ "$OS" = "darwin" ]; then
FILENAME="x86_64-apple-darwin"
elif [ "$OS" = "windows" ]; then
FILENAME="x86_64-pc-windows-msvc.exe"
else
echo "OS $OS is not supported."
echo "If you think that's a bug - please file an issue to https://github.com/Yakiyo/dsm/issues"
exit 1
fi
FILE="dsm-$FILENAME"
}
filename
echo $FILE If I change According to the most trusted source on internet Wikipedia:
Joke aside, I think doing the change I propose would solve my problem. I don't know if there are others edges not covered however. |
yes the things in arch.rs are decided at compile time and are hardcoded in the app. Ig the issue itself was in the installation script. Thanks for pointing that out. I'll fix the script and that should hopefully prevent any more similar issues in the future. Thanks for mentioning it. |
Hum, I have another problem now. When using the new installation script it is now installing
Which is a bit worth that before, because before I was able to run I feel like on linux Would it be possible to explain to me how I can produce a build of PS: I think reverting the changes made to the install.sh script is better for now. Sorry about that, I didn't think of the problem of running dsm itself. |
arch.rs uses conditional compilation for hardcoding architecture values at compile time. #[cfg(all(
target_pointer_width = "32", // target pointer width here - 32bit/64bit
any(target_arch = "arm", target_arch = "aarch64") // target arch here
))]
pub fn platform_arch() -> &'static str {
"armv7"
}
target_pointer == 32 && (target_arch == "arm" || target_arch == "aarch64") You can tinker with it as you want and see what happens. |
Thanks for the explanation on the compiler directives. I was more looking to the |
Generally cargo builds on the default system target. But it can be configured to build for a different target, though not a specific architecture. Here's the relevant docs on the |
Ok thank you, I will give it a try |
Hello,
I am using
dsm
to install Dart inside a devcontainer running on a Mac M1.And I believe running
dsm install 3.1.2
installs the wrong architecture version of Dart.Indeed, when trying to run
dart
after the installation I get the following error:If I run
dsm install --arch arm64 3.1.2
, then all is good I can invoke dart.I believe it detect the wrong architecture because if I run
dsm install --arch x64 latest
then I get the same error as when runningdsm install latest
.Is it related to #2 ?
Running
uname -m
inside the VM gives meaarch64
Reproduction
Dockfile I am using:
docker build --tag fable-dev .
docker run -it --rm fable-dev
dsm install latest
dart
<- See that this fails with the reported errorThe text was updated successfully, but these errors were encountered: