Skip to content
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

flutter build web: allow passing experiment flags #148422

Closed
nulideaqian opened this issue May 15, 2024 · 4 comments
Closed

flutter build web: allow passing experiment flags #148422

nulideaqian opened this issue May 15, 2024 · 4 comments
Labels
r: invalid Issue is closed as not valid

Comments

@nulideaqian
Copy link

nulideaqian commented May 15, 2024

Steps to reproduce

execute flutter build web --enable-experiment=macros --wasm

Expected results

build success

Actual results

Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
Could not find an option named "enable-experiment".

Usage: dart compile wasm [arguments] <dart entry point>
-h, --help                  Print this usage information.
-o, --output                Write the output to <file name>.
                            This can be an absolute or relative path.
-v, --verbose               Print debug output during compilation
    --enable-asserts        Enable assert statements.
-D, --define=<key=value>    Define an environment declaration. To specify multiple declarations, use multiple options or use
commas to separate key-value pairs.
                            For example: dart compile wasm -Da=1,b=2 main.dart

Run "dart help" to see global options.
  Command: D:\software\flutter\bin\cache\dart-sdk\bin\dart.exe compile wasm --packages=.dart_tool/package_config.json
  --extra-compiler-option=--dart-sdk=D:\software\flutter\bin\cache\dart-sdk
  --extra-compiler-option=--platform=D:\software\flutter\bin\cache\flutter_web_sdk\kernel\dart2wasm_platform.dill
  --extra-compiler-option=--delete-tostring-package-uri=dart:ui
  --extra-compiler-option=--delete-tostring-package-uri=package:flutter --extra-compiler-option=--import-shared-memory
  --extra-compiler-option=--shared-memory-max-pages=32768 -Ddart.vm.product=true --enable-experiment=macros
  -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/d35a1a603c80e8b310ed89ccc1525c3cbc81e19d/
  -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_USE_SKWASM=true
  --extra-compiler-option=--depfile=E:\code\csdn_git\schedule-self\schedule-self-client\.dart_tool\flutter_build\2b270b379f2f7e
  b6fc453ef01b7cfc4c\dart2wasm.d -O4 --no-name-section -o
  E:\code\csdn_git\schedule-self\schedule-self-client\.dart_tool\flutter_build\2b270b379f2f7eb6fc453ef01b7cfc4c\main.dart.wasm
  E:\code\csdn_git\schedule-self\schedule-self-client\.dart_tool\flutter_build\2b270b379f2f7eb6fc453ef01b7cfc4c\main.dart
#0      RunResult.throwException (package:flutter_tools/src/base/process.dart:122:5)
#1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:318:19)
<asynchronous suspension>
#2      Dart2WasmTarget.build (package:flutter_tools/src/build_system/targets/web.dart:329:5)
<asynchronous suspension>
#3      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:867:9)
<asynchronous suspension>
#4      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:805:32)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:805:32)
<asynchronous suspension>
#8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:634:16)
<asynchronous suspension>
#9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:92:34)
<asynchronous suspension>
#10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:230:5)
<asynchronous suspension>
#11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1393:27)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
<asynchronous suspension>
#17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#19     main (package:flutter_tools/executable.dart:93:3)
<asynchronous suspension>

Compiling lib\main.dart for the Web...                             428ms
Error: Failed to compile application for the Web.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

[✓] Flutter (Channel master, 3.22.0-35.0.pre.10, on Microsoft Windows [版本 10.0.22631.3593], locale zh-CN)
• Flutter version 3.22.0-35.0.pre.10 on channel master at D:\software\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ddd6c86 (17 hours ago), 2024-05-14 22:00:17 -0400
• Engine revision d35a1a603c
• Dart version 3.5.0 (build 3.5.0-154.0.dev)
• DevTools version 2.36.0-dev.5
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at D:\software\repository\android\sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = D:\software\repository\android\sdk
• Java binary at: D:\Users\justd\AppData\Local\Programs\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.5)
• Visual Studio at D:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34202.233
• Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2023.3)
• Android Studio at D:\Users\justd\AppData\Local\Programs\Android Studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
• IntelliJ at D:\Users\justd\AppData\Local\Programs\IntelliJ IDEA Ultimate
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.22631.3593]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.158
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.97

[✓] Network resources
• All expected network resources are available.

• No issues found!

@kevmoo kevmoo changed the title flutter build web --enable-experiment=macros --wasm error flutter build web: allow passing experiment flags May 15, 2024
@johnpryan
Copy link
Contributor

I think we should move this to dart-lang/sdk, since this seems like an issue with dart2wasm.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 16, 2024
@darshankawar
Copy link
Member

Closing from here. @nulideaqian Please file this in https://github.com/dart-lang/sdk/issues

@darshankawar darshankawar closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@darshankawar darshankawar added r: invalid Issue is closed as not valid and removed in triage Presently being triaged by the triage team labels May 16, 2024
@kevmoo
Copy link
Contributor

kevmoo commented May 16, 2024

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

4 participants