patoconnor43 / asdf-dart Goto Github PK
View Code? Open in Web Editor NEWdart plugin for asdf version manager https://github.com/asdf-vm/asdf
License: MIT License
dart plugin for asdf version manager https://github.com/asdf-vm/asdf
License: MIT License
Current behavior defaults to downloading x64. In the case of 2.14+ versions, there is an arm64 version for M1 darwin.
Modify the architecture check to point to arm64 if available. I believe it will require a change here
# on an M1
$> uname -m
arm64
When everything seems to work fine at first, but it seems as though the package is never actually extracted
Platform 'linux' supported!
Version: 2.8.4
Install Path: /home/watzon/.asdf/installs/dart/2.8.4
Platform: linux
Architecture: x64
Downloading to temp directory asdf-dart.HjnW
Include Extras: 0
Major Dart Version: 2
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/2.8.4/sdk/dartsdk-linux-x64-release.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 217M 100 217M 0 0 54.8M 0 0:00:03 0:00:03 --:--:-- 54.8M
Unzipping Dart SDK to /home/watzon/.asdf/installs/dart/2.8.4...
Running on Arch
First of all, thank you for creating such a nice plugin. I use almost everyday ❤️
Currently, asdf-dart supports only stable channel.
I would appreciate it if you also supports beta and dev channel too.
Do you have any plans to implement it?
For some reason installs are failing for dart 1 and 2.
asdf install dart 2
Platform 'darwin' supported!
version
2
/Users/masha/.asdf/installs/dart/2
macos
x64
asdf-dart.xgsQ
0
2
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/2/sdk/dartsdk-macos-x64-release.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 234 100 234 0 0 1800 0 --:--:-- --:--:-- --:--:-- 1800
Unzipping Dart SDK to /Users/masha/.asdf/installs/dart/2...
The zip file downloaded is invalid
I had to use $HOME/.asdf/installs/dart/2.13.4/dart-sdk
, though the readme says $HOME/.asdf/installs/dart/VERSION
. Confused me (and intellij) for a bit :)
When you're on an Apple Silicon M1, it should download the correct Dart SDK, which is the ARM64 architecture version.
Currently this cpu architecture is silently ignored and so it downloads the x64 architecture.
See here:
get_arch () {
local arch=""
case "$(uname -m)" in
x86_64|amd64|arm64) arch="x64"; ;;
i686|i386) arch="ia32"; ;;
*)
echo "Arch '$(uname -m)' not supported!" >&2
;;
esac
echo -n $arch
}
The install script should validate the requested version before trying to download. This can result in empty downloads.
Either abort the install process if the user requests a version that is not included in the list-all script or allow supporting truncated versions (2 vs. 2.3.2) that will install the newest version version that starts with that major.
Reported in #5
The documentation and CLI help describe asdf latest <name>
as the command that should "Show Latest Stable Version", but currently for dart it does not filter out beta/dev channel releases so you get something like 2.13.0-114.0.dev
. I saw in another issue thread that there is an option to filtering out beta/dev, but the asdf docs make it sound like that should be the default behavior for asdf latest
.
By the way, this is awesome - thank you @PatOConnor43!
I have the following line at the bottom of my .zshrc
file:
bash ${HOME}/.asdf/plugins/dart/tools/dart_version_watcher.sh
I didn't notice a problem for a while (due to my penchant to not close VS Code windows very often), but when starting up VS Code after a computer reboot, the shell environment took a while to initialize, after which I got a message saying "Unable to resolve your shell environment in a reasonable time. Please review your shell configuration." After that point, the integrated terminal was frozen on "Starting" no matter what I did. After some investigation, I narrowed the cause down to the above command.
Note that this only happens when VS Code is first starting up. If I comment that line and start up VS Code, then uncomment the line and refresh the integrated terminal with the zsh
command, the terminal successfully refreshes.
The current latest version of Dart is 2.10.4, but asdf latest dart
returns 2.9.3
. Looking at the URL you use to get available versions, it quickly becomes obvious why your method has stopped working:
...
"channels/stable/release/2.9.1/",
"channels/stable/release/2.9.2/",
"channels/stable/release/2.9.3/",
"channels/stable/release/29803/",
"channels/stable/release/30036/",
"channels/stable/release/30107/",
...
Luckily asdf install dart 2.10.4
still works just fine.
Busybox mktemp has different command line args, as per getssl/#612.
Which leads to writing sdk.zip into the root dir
bash -c 'source .bashrc && asdf install dart 2.19.6'
1.689 Platform 'linux' supported!
1.690 mktemp: Invalid argument
1.691 Version: 2.19.6
1.691 Install Path: /builder/.asdf/installs/dart/2.19.6
1.691 Platform: linux
1.691 Architecture: x64
1.691 Downloading to temp directory
1.691 Include Extras: 0
1.691 Major Dart Version: 2
1.691 Installing Dart SDK...
1.691 https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/sdk/dartsdk-linux-x64-release.zip
1.693 % Total % Received % Xferd Average Speed Time Time Time Current
1.693 Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to open the file /sdk.zip: Permission denied
0 207M 0 5503 0 0 22611 0 2:40:41 --:--:-- 2:40:41 22646
1.936 curl: (23) Failure writing output to destination
install dart print:
Platform 'linux' supported!
Arch 'aarch64' not supported!
Dart already support arm64.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.