Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Dec 11, 2024

Formatting lib/web_ui/lib/src/engine/renderer.dart with dartfmt causes compilation problems for the web engine:

FAILED: flutter_web_sdk/kernel/dart2js_platform.dill 
vpython3 ../../build/gn_run_binary.py ../../flutter/prebuilts/linux-x64/dart-sdk/bin/dart /b/s/w/ir/cache/builder/src/flutter/prebuilts/linux-x64/dart-sdk/bin/snapshots/kernel_worker.dart.snapshot --sound-null-safety --no-summary-only --null-environment --target dart2js --packages-file file:////b/s/w/ir/cache/builder/src/flutter/third_party/dart/.dart_tool/package_config.json --multi-root-scheme org-dartlang-sdk --multi-root file:////b/s/w/ir/cache/builder/src/out/wasm_release/flutter_web_sdk --libraries-file org-dartlang-sdk:///libraries.json --output /b/s/w/ir/cache/builder/src/out/wasm_release/flutter_web_sdk/kernel/dart2js_platform.dill --source dart:core --source dart:ui --source dart:ui_web --source dart:_engine --source dart:_skwasm_stub --source dart:_web_unicode --source dart:_web_locale_keymap --multi-root file:////b/s/w/ir/cache/builder/src/flutter/prebuilts/linux-x64
Command failed: ./../../flutter/prebuilts/linux-x64/dart-sdk/bin/dart /b/s/w/ir/cache/builder/src/flutter/prebuilts/linux-x64/dart-sdk/bin/snapshots/kernel_worker.dart.snapshot --sound-null-safety --no-summary-only --null-environment --target dart2js --packages-file file:////b/s/w/ir/cache/builder/src/flutter/third_party/dart/.dart_tool/package_config.json --multi-root-scheme org-dartlang-sdk --multi-root file:////b/s/w/ir/cache/builder/src/out/wasm_release/flutter_web_sdk --libraries-file org-dartlang-sdk:///libraries.json --output /b/s/w/ir/cache/builder/src/out/wasm_release/flutter_web_sdk/kernel/dart2js_platform.dill --source dart:core --source dart:ui --source dart:ui_web --source dart:_engine --source dart:_skwasm_stub --source dart:_web_unicode --source dart:_web_locale_keymap --multi-root file:////b/s/w/ir/cache/builder/src/flutter/prebuilts/linux-x64
exitCode: 15
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:5: Error: 'if' can't be used as an identifier because it's a keyword.
Try renaming this to be an identifier that isn't a keyword.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
    ^^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:21: Error: Expected an identifier, but got '.'.
Try inserting an identifier before '.'.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
                    ^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:22: Error: Expected ')' before this.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
                     ^^^^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:28: Error: Expected '{' before this.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:28: Error: Expected a declaration, but got ''package:ui/src/engine/skwasm/skwasm_stub.dart''.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:75: Error: Unexpected token ';'.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
                                                                          ^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:9: Error: 'dart.library' can't be used as a type because 'dart' doesn't refer to an import prefix.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
        ^^^^^^^^^^^^
org-dartlang-sdk:///lib/_engine/engine/renderer.dart:7:9: Error: 'dart.library' can't be used as a type because 'dart' isn't defined.
    if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
        ^^^^^^^^^^^^

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Dec 11, 2024
@goderbauer
Copy link
Member Author

@yjbanov or @ditman Any idea why the web engine fails building if lib/web_ui/lib/src/engine/renderer.dart is formatted with dartfmt as shown in this PR? The resulting formatting looks fine and legal to me. Is this file maybe post-processed in some way before compilation and that post-processing is failing with the new format? Any ideas?

@goderbauer goderbauer closed this Dec 13, 2024
@goderbauer goderbauer deleted the webFailure branch December 13, 2024 23:52
@ditman
Copy link
Member

ditman commented Dec 16, 2024

Just for posterity, this was fixed by:

#57170

@ditman
Copy link
Member

ditman commented Dec 16, 2024

Answering @goderbauer's question about post-processing, there is indeed post processing in the flutter web engine that turns a bunch of import-based code in a big, fat, library that uses "parts" (😱), it's the:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants