Skip to content
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

Allow AOT executables to be cross-compiled #28617

Open
nex3 opened this issue Feb 2, 2017 · 9 comments

Comments

@nex3
Copy link
Member

@nex3 nex3 commented Feb 2, 2017

Currently application snapshots (as described here) can only be compiled for the architecture of the machine doing the compilation. This makes releasing cross-platform apps using these snapshots much more difficult, requiring multiple machines (including at least one physical machine, since OS X isn't virtualizable) to compile for all platforms.

It seems that the compilation process could do the initial run on the current platform, but then preserve the profiling information and use it to cross-compile the result to other platforms.

@kevmoo kevmoo added type-enhancement and removed enhancement labels Feb 9, 2017
nex3 added a commit to sass/dart-sass that referenced this issue Feb 2, 2018
Might as well give some subset of our users a speed-up while we wait
for dart-lang/sdk#28617.
nex3 added a commit to sass/dart-sass that referenced this issue Feb 2, 2018
Might as well give some subset of our users a speed-up while we wait
for dart-lang/sdk#28617.
@rmacnak-google

This comment has been minimized.

Copy link
Contributor

@rmacnak-google rmacnak-google commented Jun 29, 2018

App snapshots are tied to the target ABI of the VM, not the host OS and not the host ABI. If you create an app snapshot using an IA32 VM, you can run the same snapshot on Windows, Mac or Linux. If you create an app snapshot using an X64 VM on Mac or Linux, you run it on the other (they share the sysv ABI), but not Windows (which has its own ABI). If you create an app snapshot using a SIMARM VM on your desktop, you can run it with an ARM VM on, say, an Android device (this is how Flutter works).

We will not produce VMs that target multiple ABIs. The assumption of a single target ABI as a build-time decision is quite deep in the VM.

@nex3

This comment has been minimized.

Copy link
Member Author

@nex3 nex3 commented Jun 29, 2018

I want to push back strongly on this. Startup performance is very important for providing my users with a good experience, and the Dart VM's startup performance without using application snapshots compares poorly to just about any other language (including Ruby, whose Sass implementation we're in the process of deprecating because of performance issues).

Other languages are able to do this. Easy cross-compilation is a major reason that Go is so popular for writing command-line tools, and if Dart provided it with similar ease it would make the server-side Dart world very compelling. But without it, Dart users are forced to deal with sub-par performance when they could easily get performance and portability with another language.

@nex3

This comment has been minimized.

Copy link
Member Author

@nex3 nex3 commented Jul 9, 2018

Ping... efficient startup speeds across all platforms are a very important customer feature.

@nex3 nex3 reopened this Aug 3, 2018
@nex3

This comment has been minimized.

Copy link
Member Author

@nex3 nex3 commented Aug 3, 2018

I haven't received any response, so I'm re-opening this. It's a pressing customer issue.

@passsy

This comment has been minimized.

Copy link

@passsy passsy commented Aug 22, 2018

One workaround is https://github.com/filiph/dartbin which creates a go wrapper. Not Dart2 compatible though and it requires go as dependency.

@nex3 nex3 changed the title Allow application snapshots to be cross-compiled Allow AOT executables to be cross-compiled May 20, 2019
@nex3

This comment has been minimized.

Copy link
Member Author

@nex3 nex3 commented May 20, 2019

Updating to AOT executables, since that's not the best way to distribute CLI applications.

@nex3

This comment has been minimized.

Copy link
Member Author

@nex3 nex3 commented May 30, 2019

@mit-mit has told me offline that "getting to full cross-compilation is going to be a long journey", but "the journey has already started; we just don't have a timeline for when it will end".

@shinayser

This comment has been minimized.

Copy link

@shinayser shinayser commented Nov 5, 2019

Looking forward to see this feature! Loving to work with dart ❤

@Schwusch

This comment has been minimized.

Copy link

@Schwusch Schwusch commented Nov 13, 2019

This feature is a show stopper for us in order to adopt Dart in AWS Lambda. Since the AWS CLI runs the compiled executable in a Docker container, offline development is only possible in a Linux environment. Manual deployment without CI/CD is also impossible in Mac and Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.