dart-lang / build

A build system for Dart written in Dart
https://pub.dev/packages/build
BSD 3-Clause "New" or "Revised" License
783 stars 205 forks source link

This package uses knowledge about internals of the Dart sdk layout, location of snapshots, type of snapshot etc. causing issues #3739

Open a-siva opened 3 weeks ago

a-siva commented 3 weeks ago

This package in filebuild/build_web_compilers/lib/src/sdk_js_compile_builder.dart uses knowledge about the internals of the sdk layout to figure out location of a snapshot and assumes that the snapshot would be a JIT snapshot to execute it. having such a hard coded dependency on the SDK layout is bad, the layout of the SDK could change version to version causing breakages in this packages.

The sdk is in the process of switching snapshots to AOT snapshots (https://github.com/dart-lang/sdk/issues/53576) and the assumption in the above code about the snapshot being a JIT snapshot breaks this package when the snapshot type is changed to an AOT snapshot.

jakemac53 commented 2 weeks ago

If/when we have an alternative entry point to the compilers, we would be happy to use it.

I mentioned in the other PR, but if we also can commit to a command line interface (including arguments), then we could possibly drop the tight SDK constraints that we currently have. We do that just because of how tightly coupled we are with the SDK in terms of these assumptions.