Skip to content

[CP] [dart2wasm] Make dart compile wasm compiled apps disable dart.library.ffi #55979

@mkustermann

Description

@mkustermann

Commit(s) to merge

847c356

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/370880

Issue Description

Packages on pub use conditional imports that branch on dart.library.ffi. The ffi-specific code is meant to be run on the VM. Unfortunately currently this also evaluates to true in dart2wasm, which makes apps that work with dart2js not work with dart2wasm due to different evaluation of the conditional import.

What is the fix

Change dart2wasm to make this conditional import evaluate to false.

Why cherry-pick

Users are hitting this when using package:flutter_svg which uses package:vector_graphics_compiler which uses `dart:ffi.

Risk

As always: If CI passes the risk is low.

Issue link(s)

#55948

Extra Info

No response

Metadata

Metadata

Labels

area-dart2wasmIssues for the dart2wasm compiler.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-reviewIssue that need cherry pick triage to approve

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions