Skip to content

path_provider usage of dart:ffi prevents web compilation #66143

@jonahwilliams

Description

@jonahwilliams

Due to the inconsistent set of dart libraries supported by Web and Desktop/Mobile SDKs, certain dart libraries cannot be used safely. dart:ffi is one of those - if it is reachable in a web app, the compilation will fail.

See: #66136 (comment)

[web_benchmarks_html] [STDOUT] Executing: /b/s/w/ir/k/flutter/bin/flutter build web --dart-define=FLUTTER_WEB_ENABLE_PROFILING=true --profile -t lib/web_benchmarks.dart in /b/s/w/ir/k/flutter/dev/benchmarks/macrobenchmarks
[web_benchmarks_html] [STDOUT] stdout: Downloading Web SDK...                                              1.0s
[web_benchmarks_html] [STDOUT] stdout: Compiling lib/web_benchmarks.dart for the Web...                
[web_benchmarks_html] [STDOUT] stderr: Target dart2js failed: Exception: ../../../../../cache/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.2/lib/path_provider_windows.dart:7:8:
[web_benchmarks_html] [STDOUT] stderr: Error: Not found: 'dart:ffi'
[web_benchmarks_html] [STDOUT] stderr: import 'dart:ffi';
[web_benchmarks_html] [STDOUT] stderr:        ^
[web_benchmarks_html] [STDOUT] stderr: ../../../../../cache/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:6:8:
[web_benchmarks_html] [STDOUT] stderr: Error: Not found: 'dart:ffi'
[web_benchmarks_html] [STDOUT] stderr: import 'dart:ffi';
[web_benchmarks_html] [STDOUT] stderr:        ^
[web_benchmarks_html] [STDOUT] stderr: ../../../../../cache/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:6:8:
[web_benchmarks_html] [STDOUT] stderr: Error: Not found: 'dart:ffi'
[web_benchmarks_html] [STDOUT] stderr: import 'dart:ffi';
[web_benchmarks_html] [STDOUT] stderr:        ^
[web_benchmarks_html] [STDOUT] stderr: ../../../../../cache/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:5:8:
[web_benchmarks_html] [STDOUT] stderr: Error: Not found: 'dart:ffi'
[web_benchmarks_html] [STDOUT] stderr: import 'dart:ffi';
[web_benchmarks_html] [STDOUT] stderr:        ^
[web_benchmarks_html] [STDOUT] stderr: ../../../../../cache/.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/callbacks.dart:7:8:

Metadata

Metadata

Labels

c: regressionIt was better in the past than it is nowp: path_providerPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions