Skip to content

Add support for specifying a compiler separately from a platform #1776

@natebosch

Description

@natebosch

As we look to add support for compiling to wasm and running the browser, we should add a --compiler flag that allows specifying one or more compilers to use in combination with the specified platforms. Using a separate flag will allow using the wasm compiler with any browser that supports the required wasm features.

We'll add a wasm term similar to the js term, for use in @TestOn configuration.

When no --compiler flag is passed, each platform will have a default compiler. When a --compiler flag is passed, only the valid combinations of compiler ✕ platform will run. So a combination like --compiler dart2js --platform vm will run no tests, since the VM platform does not support dart2js as a compiler, but --compiler jit,dart2js,wasm --platform vm,chrome would run both dart2js and wasm tests on chrome, as well as from-source tests on the VM.

In the future, we should be able to add support for compiling with DDC (monolithic compile with the frontend server, it's unlikely we'd implement modular compiles), and may consider adding support for AOT compiles on the VM platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions