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.23k stars 1.58k forks source link

dart2js is not found #38910

Open yuanzhaowei opened 5 years ago

yuanzhaowei commented 5 years ago

Dart SDK Version Dart VM version: 2.6.0-edge.36985859e421a9fbbdfc56379506b2a367c7d4e9 (Fri Aug 30 17:49:28 2019 +0000) on "linux_arm" Whether you are using Windows, MacOSX, or Linux (if applicable) Linux (Raspberry Pi3) Whether you are using Chrome, Safari, Firefox, Edge (if applicable) None

Hi, I'm building flutter for ARM platform, now I need to replace the original following dart-sdk: ($engine-root)/src/third_party/dart/tools/sdks/dart-sdk/ Because it's for X86 platform.

What I did is:

  1. build dart-sdk for ARM according to the guide from: https://github.com/dart-lang/sdk/wiki/Building 1) check current dart version of flutter: cd $engine-root/src cat flutter/DEPS | grep dart_rev 'dart_revision': '36985859e421a9fbbdfc56379506b2a367c7d4e9' 2) build dart-sdk cd $dart-sdk-root git reset --hard 36985859e421a9fbbdfc56379506b2a367c7d4e9 ./tools/build.py --mode release --arch arm create_sdk 3) replace dart-sdk under flutter cd $engine-root/src rm -rf ./third_party/dart/tools/sdks/dart-sdk cp -r $dart-sdk-root/out/ReleaseXARM/dart-sdk/ ./third_party/dart/tools/sdks/

  2. build flutter for ARM report error: Binary not found: /home/abuild/rpmbuild/BUILD/flutter-1.0.0.1/third_party/dart/tools/sdks/dart-sdk/bin/dart2js

There is no "dart2js" in directory $dart-sdk-root/out/ReleaseXARM/dart-sdk/, How can I get this? Thanks.

srawlins commented 5 years ago

Hi @whesse do you know why dart2js wouldn't be built for ARM?

whesse commented 5 years ago

I look at the SDK builder and see that it just doesn't seem to be built on the ARM platform, I guess because we have never needed it before. Why does flutter need dart2js on ARM? I think it is just the build files for Dart that are missing that step for the ARM platform. Probably someone on the VM team in MTV or in Seattle would know about how to add that step.

Also, the SDK in dart/third_party/sdk is checked out from CIPD, a versioned, platform-dependent repository of tools and dependencies that stores directories as tar files. So if we needed to put an ARM version of the SDK there, we would put an ARM sdk up on the CIPD server. But is all the other software, like gclient etc., also working on ARM? We have only supported cross-compiling to ARM recently, not building directly on ARM. If we need to support building on ARM, then we would have to start testing this build and maintaining it.

yuanzhaowei commented 5 years ago

@whesse Thanks for your response. I don't know why flutter need dart2js on ARM, but it does T.T I still have a question about what you said above "We have only supported cross-compiling to ARM recently, not building directly on ARM". Which project did you mean you only support cross-compiling for? Dart-SDK or Flutter? or both of them?

Like I said, I had cross-compiled Dar-SDK for ARM, but there is no dart2js, and this is needed by flutter when building flutter for ARM directly on ARM. Do you mean dart2js is unnecessary if we cross-compile flutter for ARM?

sigmundch commented 5 years ago

Hi @yuanzhaowei - Since this repo is mostly monitored by Dart developers, we might not have all the context we need to properly help. If you haven't already, please also reach out on the flutter repo or their community channels about this. Maybe they recommend building for ARM in a different way?

@aam - do you know about a recommended way to build for ARM or who on the flutter side could chime in and help?

aam commented 5 years ago

@aam - do you know about a recommended way to build for ARM or who on the flutter side could chime in and help?

Only flutter engine is built for arm(see https://ci.chromium.org/p/flutter/g/engine/console for ongoing builders). Host columns from that buildbot page correspond to linux, mac or windows, but none of them are arm.

cc @jason-simmons

yuanzhaowei commented 5 years ago

Thanks all for your help, flutter engine is what exactly we want to build, and we had cross-compiled it successfully, but now, we are trying to build it on a ARM host I'll go to flutter community to ask for help, thanks a lot.