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

[wasm] Investigate emscripten cache usage #55014

Open
6 tasks
pavelsavara opened this issue Jul 1, 2021 · 9 comments
Open
6 tasks

[wasm] Investigate emscripten cache usage #55014

pavelsavara opened this issue Jul 1, 2021 · 9 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono
Milestone

Comments

@pavelsavara
Copy link
Member

pavelsavara commented Jul 1, 2021

Updated: now we have the cache in a separate nuget.

The cache nuget/pack will typically be installed in a non-user-writable location.

  • how does this affect user builds? Command line, and VS.
  • When might emcc try to write to the cache?
  • Does emsdk support a "fallback" cache that could be in a user-writable location?
  • TODO: Make the dotnet installation non-writeable when running Wasm.Build.Tests

Currently it's caching for both Debug/Release configurations into the same folder.

cache:INFO: generating system library: sysroot\lib\wasm32-emscripten\libc_rt_wasm.a... (this will be cached in "D:\runtime\src\mono\wasm\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc_rt_wasm.a" for subsequent builds)

Questions:

  • What does emcc use as keys for the cache? Can it differentiate between Debug/Release? (path? hash?)
  • If it can't then what else do we need to split the cache on?

Proposed solution

Add --cache <dir> where dir is something like upstream\emscripten\cache-<configuration>\

@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Jul 1, 2021
@ghost
Copy link

ghost commented Jul 1, 2021

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

Issue Details

Currently it's caching for both configurations into the same folder.

cache:INFO: generating system library: sysroot\lib\wasm32-emscripten\libc_rt_wasm.a... (this will be cached in "D:\runtime\src\mono\wasm\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc_rt_wasm.a" for subsequent builds)

Proposed solution

Add --cache <dir> where dir is something like upstream\emscripten\cache-<configuration>\

Author: pavelsavara
Assignees: -
Labels:

arch-wasm

Milestone: -

@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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 1, 2021
@lewing lewing added this to the 6.0.0 milestone Jul 2, 2021
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Jul 2, 2021
@lewing
Copy link
Member

lewing commented Jul 2, 2021

The cache situation needs to be fixed very soon.

@ghost
Copy link

ghost commented Jul 2, 2021

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently it's caching for both configurations into the same folder.

cache:INFO: generating system library: sysroot\lib\wasm32-emscripten\libc_rt_wasm.a... (this will be cached in "D:\runtime\src\mono\wasm\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc_rt_wasm.a" for subsequent builds)

Proposed solution

Add --cache <dir> where dir is something like upstream\emscripten\cache-<configuration>\

Author: pavelsavara
Assignees: radekdoulik
Labels:

arch-wasm, area-VM-meta-mono

Milestone: 6.0.0

@ilonatommy
Copy link
Member

@radekdoulik have you decided that the approach should be changed? What was the blocker?

@radical radical modified the milestones: 7.0.0, 8.0.0 Aug 11, 2022
@radical radical changed the title [wasm] emscripten cache should consider Debug/Release configuration [wasm] Investigate emscripten cache usage Oct 6, 2022
@radekdoulik
Copy link
Member

radekdoulik commented May 12, 2023

With on of the latest emscripten bumps we changed the way we use the cache.

We prime it before packaging the workload nuget with the cache and also when preparing docker images for CI. The cache is frozen during the user project builds as it can be located in a read-only location and it is generally good idea to not write to deployed nuget location.

There is a remaining area, where we can improve and that is the secondary (fallback) cache. I think emscripten doesn't support that, it might be good addition to the upstream.

@lewing lewing modified the milestones: 8.0.0, 9.0.0 Jul 21, 2023
@lewing
Copy link
Member

lewing commented Jul 21, 2023

cc @directhex

@lewing
Copy link
Member

lewing commented Apr 26, 2024

@radekdoulik please update the status here

@lewing lewing modified the milestones: 9.0.0, 10.0.0 Jul 29, 2024
@pavelsavara
Copy link
Member Author

@radekdoulik please update the status here

please @radekdoulik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
Development

No branches or pull requests

7 participants