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

Does both dartdev.dart.snapshot and dartdev.dill have to be included in the SDK? #50504

Closed
jensjoha opened this issue Nov 18, 2022 · 13 comments
Closed
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.

Comments

@jensjoha
Copy link
Contributor

Inside the out/ReleaseX64/dart-sdk/bin/snapshots/ directory we have both dartdev.dart.snapshot and dartdev.dill. The test pkg/dartdev/test/load_from_dill_test.dart talks about needing both because "The DartDev snapshot includes the --use_field_guards flag. If --no-use-field-guards is passed, the VM will fail to load the snapshot and should fall back to using the DartDev dill file."

I asked @mraleph if the --use-field-guards thing it was true, considering is it then - apparently - only true for the dartdev snapshot as the built-in CFE is also - at least I think - a snapshot. @mraleph is of the opinion that (paraphrasing) the test is outdated and that the VM forces the isolate to use a specific set of options just like the kernel isolate.

@bkonyi suggested the test should potentially be updated to correctly test the fallback logic.

So either

  • the test should be updated if the dill file is necessary, or
  • the dill file should be removed if it's not necessary, or
  • if the dill is currently necessary it should be made so it isn't, and then removed.

Again, considering dartdev is the only "snapshot" that is included as dill as well I'm - maybe naively? - thinking that one of the last two would/should be the way to go.

@mraleph
Copy link
Member

mraleph commented Nov 18, 2022

I am not sure this fallback logic is worth it. I'd vote for removing it.

@devoncarew devoncarew added the area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. label Nov 18, 2022
@bkonyi
Copy link
Contributor

bkonyi commented Nov 21, 2022

Unless we can also remove the fallback logic for the kernel service, we need to keep this functionality. There's more details on the original issue for the dartdev fallback logic: #42804.

@jensjoha
Copy link
Contributor Author

jensjoha commented Nov 21, 2022

Is there a fallback for the kernel service? There at least doesn't seem to be any dill included in the "snapshot" folder.

@bkonyi
Copy link
Contributor

bkonyi commented Nov 21, 2022

Oh, maybe we got rid of it since then?

@mraleph
Copy link
Member

mraleph commented Nov 22, 2022

We probably removed it because using isolate specific flags and pinning them for auxiliary isolates is a better way to fix this.

(Users should not be touching most of these flags anyway - so shipping fallback kernel is just a waste of SDK binary size)

@bkonyi bkonyi assigned bkonyi and derekxu16 and unassigned bkonyi Dec 5, 2022
@bkonyi
Copy link
Contributor

bkonyi commented Dec 5, 2022

@derekxu16 can I trouble you to take a look at this when you have a chance?

copybara-service bot pushed a commit that referenced this issue Dec 13, 2022
This reverts commit c09f790.

Reason for revert: CI failures

Original change's description:
> [VM/CLI] Remove dartdev.dill
>
> Incompatible VM flags will no longer break the CLI when running from an
> AppJIT snapshot, so the fallback logic is no longer required. This CL
> thus removes dartdev.dill and the fallback logic.
>
> Relevant past CLs: https://dart-review.googlesource.com/c/sdk/+/157601
> and https://dart-review.googlesource.com/c/sdk/+/178300
>
> Fixes #50504
>
> TEST=I tried running `out/ReleaseX64/dart --observe --sound-null-safety test.dart`
> and `out/ReleaseX64/dart --observe --no-sound-null-safety test.dart` and
> both worked.
>
> Change-Id: I5cdcfbccf71ec557964014fdb80733b4a7c76b4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274520
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

TBR=bkonyi@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5117f990dfabf93f5a9bae56098831280845e84e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275181
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
@derekxu16
Copy link
Member

Removing dartdev.dill caused some failures (#50706) so we have to figure out how to prevent those.

@derekxu16 derekxu16 reopened this Dec 13, 2022
@a-siva
Copy link
Contributor

a-siva commented Dec 20, 2022

I believe for the kernel service the dill file is part of the executable, see

bin_to_linkable("kernel_service_dill_linkable") {
  deps = [ "../../utils/kernel-service:kernel_service_dill" ]
  input = "$root_gen_dir/kernel_service.dill"
  symbol = "kKernelServiceDill"
  size_symbol = "kKernelServiceDillSize"
  executable = false
}

@a-siva
Copy link
Contributor

a-siva commented Dec 21, 2022

I believe for some of the architrectures (simarm, simarm64, riscv etc.) the kernel_service snapshot is not built and on these platforms the dill file is used.

@mit-mit
Copy link
Member

mit-mit commented May 17, 2023

Could we then not make the SDK bundling include the snapshot just on those, and not elsewhere?

@a-siva
Copy link
Contributor

a-siva commented May 17, 2023

I guess you are saying if we generate a kernel_service or dartdev snapshot for an archtecture then we should not include the .dill file

@mit-mit
Copy link
Member

mit-mit commented May 22, 2023

Yup. Remove the .dill file on just those architectures where it's not in use. I think that means keeping it just on those architectures where we don't build the kernel_service snapshot ?

@a-siva
Copy link
Contributor

a-siva commented May 26, 2023

@a-siva a-siva closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.
Projects
None yet
Development

No branches or pull requests

7 participants