test icon indicating copy to clipboard operation
test copied to clipboard

`package:test` should not depend on Dart SDK internals

Open mkustermann opened this issue 1 year ago • 2 comments

Currently package:test seems to depend on an internal location and name of an AOT-compiled snapshot of e.g. dart2wasm compiler, see pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart:

      var platformDill =
          p.join(sdkRoot, 'lib', '_internal', 'dart2wasm_platform.dill');
      var dartPrecompiledRuntimePath = p.join(sdkRoot, 'bin', 'dartaotruntime');
      var dart2wasmSnapshotPath =
          p.join(sdkRoot, 'bin/snapshots', 'dart2wasm_product.snapshot');
      var process = await Process.start(dartPrecompiledRuntimePath, [
        dart2wasmSnapshotPath,
        '--dart-sdk=$sdkRoot',
        '--platform=$platformDill',
        '--packages=${(await packageConfigUri).path}',
        for (var experiment in enabledExperiments)
          '--enable-experiment=$experiment',
        wrapperPath,
        outWasmPath,
      ]);

3rd parties should not depend on <dart-sdk>/lib/_internal/* or <dart-sdk/bin/snapshots/*.

Why can package:test not use dart compile wasm instead?

/cc @kevmoo

mkustermann avatar Apr 19 '24 08:04 mkustermann

CC @jakemac53 – I think (er, know) that @jakemac53 got this wired up before we had the "official" CLI.

kevmoo avatar Apr 22 '24 18:04 kevmoo

Yes, if we have a more official thing to use now we can swap to use that.

jakemac53 avatar Apr 30 '24 21:04 jakemac53

FYI: we're now CRASHING w/ the latest dart dev SDK.

https://github.com/dart-lang/test/actions/runs/9324237377/job/25669112432?pr=2232#step:6:11

kevmoo avatar May 31 '24 22:05 kevmoo

Uploaded https://github.com/dart-lang/test/pull/2233

mkustermann avatar May 31 '24 23:05 mkustermann