dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.24k stars 1.57k forks source link

Build and upload ARM Dart SDK debian packages on official builders #26953

Open Hixie opened 8 years ago

Hixie commented 8 years ago

I got a raspberry pi with the Raspbian Jessie Lite distro installed. I then followed the steps on https://www.dartlang.org/install/linux:

# Enable HTTPS for apt.
$ sudo apt-get update
$ sudo apt-get install apt-transport-https
# Get the Google Linux package signing key.
$ sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
# Set up the location of the stable repository.
$ sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
$ sudo apt-get update
$ sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list'
$ sudo apt-get install dart

Everything but the last command worked fine; the last command said:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package dart
rmacnak-google commented 8 years ago

@whesse We have ARM downloads at https://www.dartlang.org/install/archive, but perhaps we aren't building or upload corresponding Debian packages?

whesse commented 8 years ago

Yes, that is true - we have only the amd64 architecture debian package in our repo. We currently make a zip file of the arm SDK, where we just build the arm SDK by copying the arm dart executable in over the x64 executable. So you install dart on a raspberry pi by unzipping the SDK, and adding the path to the binaries to your PATH. But we don't make a debian package for it.

Another short-term fix might just to install the arm64 debian package (if you can override the architecture, so it installs), and then just copy the dart executable from the sdk zip file over the executable installed by the debian package. It is probably easier to just unzip the arm sdk zip where you want it, and add it to your path.

I can see adding the other architectures to the debian repo, but it won't happen immediately. We also need to know which glibc versions we need to support, and which arm processors, and make sure that is specified.

I'll make a note on the linux instructions that the package repo is just for amd64 right now, or file an issue to add that note.

Hixie commented 8 years ago

I just checked out the repo and built it on the raspberry pi directly. It took a few hours but it worked fine. :-)

whesse commented 8 years ago

I would like to know if the zipped arm SDK, from the download archive, works, but I can try that myself on the rPI I have. I think in the long run, we should have amd64, arm, and arm64 in the debian repo.

dmorilha commented 8 years ago

I've tested the zip version of the SDK and it works fine with raspberry pi running arch linux.

butlermatt commented 8 years ago

I tested the Zipped ARM SDK on rPi(2) with Raspbian and it worked fine as well.

dvdshvrs commented 7 years ago

If I run 'pub' from the zip file on my rpi2, it says ... Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-asserts no-type-checks x64-sysv' but the VM has 'release no-asserts no-type-checks arm-eabi hardfp'.

whesse commented 7 years ago

This is a bug, because now our snapshots include native code in them, and we haven't been building a full SDK for arm, just copying the arm version of the dart executable into an X64 SDK. The solution to this is to configure the SDK builder to also build the XARM target and upload it to storage. Changing the title of this bug and reopening.

whesse commented 7 years ago

A corrected ARM sdk is uploaded to the dev channel (1.23.0-dev.2.0 and latest) and to the stable channel (1.22.1 and latest). The build recipe still needs to be changed so the builders do it automatically.

MikeMitterer commented 7 years ago

Just tried to install it on Raspi - apt-cache search can't find the dart packages. And yes - dart is in my sources.list.d but the problem is it's contents deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main

Tried to change the architecture to arm, armhf - nothing worked.

wget https://storage.googleapis.com/dart-archive/channels/stable/release/1.22.1/sdk/dartsdk-linux-arm-release.zip

works!

MikeMitterer commented 7 years ago

Guys please!!!! automate this process! For 1.24.1 on Raspi apt update && apt full-upgrade does not work.

Again I had to wget https://storage.googleapis.com/dart-archive/channels/stable/release/1.24.1/sdk/dartsdk-linux-arm-release.zip

It's nice that you provide a version for Raspi but very annoying that it is not possible to install it via `apt install``

MikeMitterer commented 7 years ago

BTW version-file in unziped folder shows 1.24.0

whesse commented 7 years ago

Will be releasing 1.24.2 in an hour or so, including ARM builds. This will be available as a download at the usual location: wget https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-arm-release.zip I will check the 1.24.1 build, to see why the version file is wrong.

bkonyi commented 6 years ago

I'm guessing this has been resolved. Closing, but feel free to reopen.

whesse commented 6 years ago

We are still building the ARM sdks manually, and uploading them to release with a script. This still should change to building them on the SDK builders. The issue about adding them to the Debian repo is separate, and also needs to be resolved.

hundeva commented 5 years ago

I just tried to install the Dart SDK on my RPI4 4GB, running latest Raspbian, following the official get Dart, Install using apt-get section, and I've faced the same issue. Is this supposed to be resolved, or still an issue?

hundeva commented 5 years ago

Any comment? I'm looking to start a home project, where I'd like to run some dart backend on the RPI4, and would prefer the apt-get approach.

athomas commented 5 years ago

Yes, I closed it because I mistakenly thought this issue is about building and uploading the ARM Dart SDK on official builders which was fixed, but it's actually about the debian package which is still outstanding.

duncanmak commented 4 years ago

Any updates on this? It's unfortunate that there are already binaries available, but not downloadable simply using apt.

filiph commented 3 years ago

What needs to be changed or done to get this resolved?

I was able to install Dart SDK manually on a Raspberry Pi 4 by downloading the ARMv7 zip file from dart.dev/tools/sdk/archive. But the default apt-get route didn't work (for the same reason that @Hixie reported 5 years ago).

We already have the binaries. Maybe I'm wrong, but this seems like a relatively easy issue to fix. If so, I can take it — especially if someone can give me pointers to what needs to be done.

There are now tens of millions of Raspberry Pis out there, and this number is growing by as much as 640K units per month. Raspberry Pis (and other ARM-based SBCs) also happen to be a great tinkering devices — which makes them that much more important for Dart adoption.

hundeva commented 3 years ago

I can confirm that the ARMv7 version works just fine on the Pi, but there is still no apt support.

colin-shaduf commented 3 years ago

Trying to automate a Dart docker container build across all 3 architectures would be SO MUCH easier/possible with apt support.. Any idea why this is still not done ?

athomas commented 3 years ago

Our current debian package pipeline is in a bad state and it will take a while to clean up. #45724 is an effort that would also help the packages not tied to a specific distribution.

We're currently working on getting official docker images for Dart (see https://github.com/dart-lang/dart-docker). Those will use the zips as well. Perhaps they can already help others trying to automate their own docker builds: https://github.com/dart-lang/dart-docker/blob/main/stable/buster/Dockerfile.

loky-lp commented 3 years ago

I had the same issues trying to automate Dart SDK installation with bash scripts. The easiest thing would be to installing it via apt like sudo apt install dart. In the meantime i'm doing this, think will help

# Creating temp file
tdir=$(mktemp -d -t dart.XXX)
tzip="$tdir/dartsdk-linux-arm64-release.zip"
tsha="$tdir/dartsdk-linux-arm64-release.zip.sha256sum"

# Downloading latest stable dist
wget -qO "$tzip" 'https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-arm64-release.zip'
wget -qO "$tsha" 'https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-arm64-release.zip.sha256sum'

chmod -R +rwx $tdir
cd $tdir
cat $tsha | sha256sum -c > /dev/null

# Check if checksum matched
if ! [ $? -eq 0 ]; then
    >&2 echo "ERROR: SHA-256 checksum not matching"
    rm -r "$tdir"
    exit 1
fi

# Unzipping to lib location
sudo unzip -d /usr/lib $tzip > /dev/null

# Enabling write and execution for the dark-sdk folder
sudo chmod -R +rx /usr/lib/dart-sdk

# Adding dart to path
export PATH="$PATH:/usr/lib/dart-sdk/bin"

# Removing tmp files
rm -r "$tdir"

Some option requires sudo operations

SwampThingTom commented 3 years ago

@LoKy-dev Thanks for the script. I think that you meant for the following line to use chmod not chown.

sudo chown -R +rx /usr/lib/dart-sdk

Unfortunately, even with that change, I couldn't get dart to run for me on my Raspberry Pi 4b with Raspbian.

pi@raspberrypi:~ $ /usr/lib/dart-sdk/bin/dart
-bash: /usr/lib/dart-sdk/bin/dart: cannot execute binary file: Exec format error
loky-lp commented 3 years ago

@LoKy-dev Thanks for the script. I think that you meant for the following line to use chmod not chown.

Thanks, I've modified the comment. If you have problems troubleshooting you can reach me here on Twitter at @PecchioLorenzo.

wdmtaj commented 3 years ago

New to Dart and can't get it to install on my RPI4 with Ubuntu. I just made a new image of the Ubuntu Desktop and I'm starting over. Can someone please list the steps to install Dart on an ARM64 RPI4? I'm assuming I download this:
2.13.4 (ref 065872e) | Linux | ARMv8 (ARM64) | Dart SDK (SHA-256) from here: https://dart.dev/tools/sdk/archive#stable-channel. I have a couple of questions here:

  1. Do I have to extract the file to a certain folder?
  2. Do I have to set Path variable?
  3. Do I have to do anything like similar to the AMD64 install such as: sudo apt-get install apt-transport-https sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'

Thanks.

bcavileer commented 2 years ago

I am seeing this issue when building a docker container on a Mac with M1 Arm processor.

RUN wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/dart.gpg
RUN echo 'deb [signed-by=/usr/share/keyrings/dart.gpg] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | tee /etc/apt/sources.list.d/dart_stable.list
RUN apt-get update && apt-get install -y nodejs dart

N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease' doesn't support architecture 'arm64

E: Unable to locate package dart

dart_stable.list only contains amd64 deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main

loky-lp commented 2 years ago

@bcavileer you are following the linux installations step for a macOS machine, in this case you can simply use brew as indicated in the official doc here (just switch tab on macOS)

For obvious reasons debian packages don't work on macOS.

bcavileer commented 2 years ago

@LoKy-dev I should have specified this is a Debian Bullseye docker container running on Apple M1 Silicon. So the instructions to install Dart should be the linux instructions.

athomas commented 2 years ago

We don't currently provide arm Dart SDK debian packages.

For docker specifically, you might be able to use the Dart official images instead (or repurpose the dockerfiles): https://hub.docker.com/_/dart https://github.com/dart-lang/dart-docker

parlough commented 1 year ago

I saw https://github.com/dart-lang/sdk/commit/c6181a003df4dcf783c2a7d064532fc71c79bbc8 at least enabled building the packages. With that work, is there any plan to upload arm64 Debian packages to the Google storage archives?

rmacnak-google commented 1 year ago

IIRC @sortie had a document about changes to Debian packages.

kyanha commented 10 months ago

How does this apply to Flutter?

athomas commented 10 months ago

How does this apply to Flutter?

It doesn't, AFAIK.

kyanha commented 10 months ago

I can update your knowledge here: it does, because the installation of the Dart SDK is a dependency for the Flutter SDK. I contribute to Veilid, and we instruct people to install the Flutter SDK. We became aware of this issue as a result of trying to support one of our users who was trying to install said SDK on a Raspberry Pi 4.

But it appears that Google doesn't want to support Flutter either, since they won't make a build that supports the 16k page size of the Raspberry Pi 5 (which we have also lost support and development time trying to support). After seeing how long this issue has been open, I find myself much less surprised at that. (The only surprise I actually have right now is that any part of the Cult of the Dead Cow ever considered Dart or Flutter for any part of its development.)

athomas commented 10 months ago

@kyanha Please review the code-of-conduct before posting here again.

Your initial question was without any context and this issue is not related to Flutter. The Flutter SDK doesn't use the Dart SDK Debian packages, it bundles it's own Dart SDK.

Regarding support for the "16k page size of the Raspberry Pi 5", please open a separate issue with additional details.

mgrouch commented 3 months ago

The 'official' installation instructions for Linux using apt on debian

https://dart.dev/get-dart#install

simply do not work for armhf or arm64.

ascmartins commented 3 months ago

I have some Raspberry PI devices around so I need to implement a REST API using Dart with the Alfred package. I came across this opened issue and decide to try the compiled ZIP files referred by @whesse back to 2017. I gave it a shot and it worked for me. So here's how I did it:

This way I was able to compile my Dart code and successfully run it in my Rapsberry PI 3B.

It would have been better using the APT, I agree. Anyway I was able to do what I needed. One up side of this is that having it installed in a device one can compile the code to use in other ARMv8 machines without the need of installing the Dart SDK. I have tested it copying the compiled file (Raspberry PI 3B) to a Raspberry PI 4 (which has an ARMv8 CPU) and it worked perfectly.