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

Dart documentation inside the compiled kernel / .dill file #59806

Closed
LesYampolskyi opened this issue Dec 26, 2024 · 2 comments
Closed

Dart documentation inside the compiled kernel / .dill file #59806

LesYampolskyi opened this issue Dec 26, 2024 · 2 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-encodings Encoding related CFE issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@LesYampolskyi
Copy link

After version [email protected] the compiled .dill file contains dart documentation and its size is increased up to 8mb.

dart compile kernel hello.dart

Open the compiled hello.dill in text editor. All documentation text is appended to the file.

Dart 3.5.4 (stable) (Wed Oct 16 16:18:51 2024 +0000) on "macos_x64"

@dart-github-bot
Copy link
Collaborator

Summary: Dart 3.3.4+ .dill files include embedded Dart documentation, significantly increasing file size (up to 8MB). This is a new behavior impacting compiled kernel files.

@dart-github-bot dart-github-bot added area-front-end Use area-front-end for front end / CFE / kernel format related issues. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Dec 26, 2024
@johnniwinther johnniwinther added cfe-encodings Encoding related CFE issues. and removed triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. labels Jan 6, 2025
@jensjoha
Copy link
Contributor

jensjoha commented Jan 6, 2025

In 3.3.4 compiling to kernel (dart compile kernel) resulted in a file with sources included, but without the platform. For a hello world file that output size is ~500 bytes.
In 3.4.0 compiling to kernel (as above) resulted in a file with sources included and with the platform included as well. The output size for a hello world file is ~7.6MB.

So yes, you are right that the size increased a lot, but it's a question of the platform (the sdk) being included or not.

I believe this was introduced in 5a38644 and @bkonyi might have more context about why this was done.

You can get the old behavior by giving the option --no-link-platform, e.g. dart compile kernel --no-link-platform hello.dart.

All in all I'll say this is working as intended and will close this issue.

@jensjoha jensjoha closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-encodings Encoding related CFE issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants