asdf-community / asdf-flutter

flutter plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
111 stars 31 forks source link

asdf-flutter does not install aarch64 version of flutter/dart on aarch64 linux #40

Closed prestontw closed 1 year ago

prestontw commented 1 year ago

Hello! Thank you for the plugin. I was working on reproducing a weird installation error I ran into when using asdf and flutter in a virtual machine, when I ran into the below error:

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ asdf install
flutter 3.3.10-stable is already installed

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ flutter doctor
/home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/internal/shared.sh: line 225: /home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
/home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/internal/shared.sh: line 225: /home/ptw/.asdf/installs/flutter/3.3.10-stable/bin/cache/dart-sdk/bin/dart: Success

Running uname -a:

❯ uname -a
Linux fedora 6.0.15-300.fc37.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Dec 21 18:09:20 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

asdf-flutter gets the correct version on macOS, but it seems to always get the amd version on linux?

my_app on  main [+] is 📦 v1.0.0+1 via 🎯 
❯ cat .tool-versions 
flutter 3.3.10-stable
prestontw commented 1 year ago

Checking out the version list URL for linux, it seems like the dart arch is only x86 or nothing:

❯ curl -sL "${versionListUrl}"  | jq '.releases[] | .dart_sdk_arch' | sort | uniq
null
"x64"

Installing through flutter outside of asdf works for aarch64, though... 🤔

prestontw commented 1 year ago

Let me check if there's a beta or nightly version that has an associated dart version that supports aarch64!

prestontw commented 1 year ago

I got this to work by checking out the beta branch inside the "stable" branch. Trying to install a -beta or -pre version to match the version I'm actually using resulted in errors.

pre-commit-in-worktree on  pre-commit-in-worktree is 📦 v1.0.0+1 via 🎯 took 19s 
❯ flutter --version
Flutter 3.7.0-1.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision c29b09b878 (2 weeks ago) • 2022-12-19 18:30:12 -0600
Engine • revision 8c99b0feaf
Tools • Dart 2.19.0 (build 2.19.0-444.2.beta) • DevTools 2.20.0

pre-commit-in-worktree on  pre-commit-in-worktree is 📦 v1.0.0+1 via 🎯 v2.19.0-444.2.beta 
❯ vim .tool-versions 

pre-commit-in-worktree on  pre-commit-in-worktree is 📦 v1.0.0+1 via 🎯 v2.19.0-444.2.beta took 3s 
❯ asdf install
flutter 3.3.10-stable is already installed

pre-commit-in-worktree on  pre-commit-in-worktree is 📦 v1.0.0+1 via 🎯 v2.19.0-444.2.beta 
❯ vim .tool-versions # changing to be beta channel

pre-commit-in-worktree on  pre-commit-in-worktree [!] is 📦 v1.0.0+1 via 🎯 took 7s 
❯ asdf install
Cannot find the download url for the version: 3.7.0-beta

pre-commit-in-worktree on  pre-commit-in-worktree [!] is 📦 v1.0.0+1 via 🎯 
❯ vim .tool-versions # changing to use `-pre` suffix

pre-commit-in-worktree on  pre-commit-in-worktree [!] is 📦 v1.0.0+1 via 🎯 took 3s 
❯ asdf install
Cannot find the download url for the version: 3.7.0-pre