Skip to content

package:test should not depend on Dart SDK internals #2210

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

Closed
mkustermann opened this issue Apr 19, 2024 · 4 comments · Fixed by #2233
Closed

package:test should not depend on Dart SDK internals #2210

mkustermann opened this issue Apr 19, 2024 · 4 comments · Fixed by #2233

Comments

@mkustermann
Copy link
Member

mkustermann commented Apr 19, 2024

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

@kevmoo
Copy link
Member

kevmoo commented Apr 22, 2024

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

@jakemac53
Copy link
Contributor

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

@kevmoo
Copy link
Member

kevmoo commented May 31, 2024

mkustermann added a commit to mkustermann/test that referenced this issue May 31, 2024
package:test should not depend and use Dart SDK internal files, flags or
other internal things for invoking compilers.

Instead it should use the public `dart compile wasm` command.

Closes dart-lang#2210
@mkustermann
Copy link
Member Author

Uploaded #2233

mkustermann added a commit that referenced this issue Jun 1, 2024
* Fix `dart run test -p chrome -c dart2wasm`

package:test should not depend and use Dart SDK internal files, flags or
other internal things for invoking compilers.

Instead it should use the public `dart compile wasm` command.

Closes #2210

* fix testing to do last supported and dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants