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

If you build with trimming enabled, future builds with it disabled will produce incorrect output #53612

Closed
kg opened this issue Jun 2, 2021 · 8 comments · Fixed by #58913
Closed
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono
Milestone

Comments

@kg
Copy link
Member

kg commented Jun 2, 2021

Description

cc @radical

If I do an incremental build with EnableAggressiveTrimming=true, then do another one later with it =false after changing some .cs files, not everything is rebuilt so you get outputs that have type load failures and such, like so:

fail: console.error: Unhandled exception in _finalize_startup Error: System.TypeLoadException: Could not load type of field 'System.Runtime.InteropServices.JavaScript.Runtime:_boundObjects' (0) due to: Could not resolve type with token 01000012 from typeref

Obliterating my artifacts folder and then doing a full build is usually the fix for this.

Will come back and paste in my exact build command lines later once my rebuild is done.

Configuration

dotnet/runtime/main current as of today

Regression?

No

@kg kg added the arch-wasm WebAssembly architecture label Jun 2, 2021
@ghost
Copy link

ghost commented Jun 2, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

cc @radical

If I do an incremental build with EnableAggressiveTrimming=true, then do another one later with it =false after changing some .cs files, not everything is rebuilt so you get outputs that have type load failures and such, like so:

fail: console.error: Unhandled exception in _finalize_startup Error: System.TypeLoadException: Could not load type of field 'System.Runtime.InteropServices.JavaScript.Runtime:_boundObjects' (0) due to: Could not resolve type with token 01000012 from typeref

Obliterating my artifacts folder and then doing a full build is usually the fix for this.

Will come back and paste in my exact build command lines later once my rebuild is done.

Configuration

dotnet/runtime/main current as of today

Regression?

No

Author: kg
Assignees: -
Labels:

arch-wasm

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jun 2, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@radical radical self-assigned this Jun 2, 2021
@lewing lewing added this to the 6.0.0 milestone Jun 2, 2021
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Jun 2, 2021
@lewing
Copy link
Member

lewing commented Jul 31, 2021

@radical status on this?

@radical
Copy link
Member

radical commented Aug 1, 2021

This issue is with local dotnet/runtime builds. Lower priority as compared to other issues, so haven't had a chance to look at this.

I'm working on incremental builds now, so after that we can see if this becomes a problem for user projects.

@lewing
Copy link
Member

lewing commented Aug 17, 2021

@radical is this fixed?

@radical
Copy link
Member

radical commented Aug 17, 2021

@radical is this fixed?

No, this will be fixed after the publish->build changes. This one will need to copy the untrimmed assemblies to a single path, and use that for mono-aot-cross.

@radical
Copy link
Member

radical commented Aug 26, 2021

There are two parts to the build here:

  1. the assemblies getting built, and published
  2. after publish, wasm generating the app bundle based on assemblies in publish/

I think the issue here is from (1).

  • But there is a problem with switching from EAT/non-EAT, which is that the app bundle doesn't get cleared out.
  • So, if you first built without trimming, then the bundle would have all the untrimmed assemblies.
    • And then you build with trimming, then the new trimmed assemblies just overwrite the older ones. But the completely trimmed out assemblies don't get removed.

This gets fixed in #57556 .

I couldn't reproduce the exact issue here, but that also might be because we recently added support for incremental wasm builds. So, we'll have to see if you hit this issue again, and then debug.

@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Sep 10, 2021
@radical
Copy link
Member

radical commented Sep 15, 2021

Should be fixed by #58913 .

@radical radical closed this as completed Sep 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
3 participants