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.29k stars 1.59k forks source link

Publish CFE precompiled to Kernel to cloud storage to unlock bootstrapping without prebuilt SDK #51788

Open mraleph opened 1 year ago

mraleph commented 1 year ago

Currently we rely on prebuilt Dart SDK to bootstrap, however in reality we only need CFE part of it as long as CFE is compiled to Kernel binary compatible with the current VM version.

During bootstrap we can build a run-kernel binary (essentially dart without kernel-service, vm-service or other core libraries snapshot included). run-kernel + prebuilt-cfe.dill will give us equivalent of dart, e.g. dart input.dart is done through run-kernel prebuilt-cfe.dill input.dart /tmp/output.dill && run-kernel /tmp/output.dill. Which will allow us to complete the bootstrap.

sortie commented 1 year ago

Is there anything we can help with here?

I could e.g. set up a trusted builder that makes these dill files and puts them in the cloud storage and cipd alongside the official releases? Then we can amend the checked in SDK mechanism with this alternative

mraleph commented 1 year ago

Yeah, I think we need some infrastructure e.g. decide where we put these and what kind of bots we need around this. Somebody on the VM team can do the GN / scripts wiring then.