-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
src: add an option to make compile cache path relative #58797
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58797 +/- ##
==========================================
+ Coverage 89.37% 89.89% +0.52%
==========================================
Files 654 667 +13
Lines 192554 196670 +4116
Branches 37434 38617 +1183
==========================================
+ Hits 172086 176794 +4708
+ Misses 12995 12331 -664
- Partials 7473 7545 +72
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some integration to module.enableCompileCache()
as well? I think having it in options bag when the first argument is an object might work well enough. The path can be options.path
in that case.
0d4fb87
to
b6eb597
Compare
b6eb597
to
4143c2f
Compare
5abcfc9
to
de78d1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file://
URL handling in this is incorrect. Either support for file://
URLs here at all should be dropped or they should be correctly handled.
ddd3bcd
to
d03bf27
Compare
Great work @Aditi-1400 ! |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The test is failing on Windows - it looks more like a pre-existing problem of mkdirSync, or a problem with the test. |
4e01f34
to
849e6ba
Compare
Adds an option (NODE_COMPILE_CACHE_PORTABLE) for the built-in compile cache to encode the hashes with relative file paths. On enabling the option, the source directory along with cache directory can be bundled and moved, and the cache continues to work. When enabled, paths encoded in hash are relative to compile cache directory.
849e6ba
to
b879f6b
Compare
Failed to start CI⚠ Commits were pushed since the last approving review: ⚠ - src: add an option to make compile cache portable ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/17295846847 |
Landed in 94422e8 |
Adds an option (NODE_COMPILE_CACHE_PORTABLE) for the built-in compile cache to encode the hashes with relative file paths. On enabling the option, the source directory along with cache directory can be bundled and moved, and the cache continues to work. When enabled, paths encoded in hash are relative to compile cache directory. PR-URL: #58797 Fixes: #58755 Refs: #52696 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
Adds an option (NODE_COMPILE_CACHE_RELATIVE_PATH) for the built-in compile cache to encode the hashes with relative file paths. On enabling the option,
the source directory along with cache directory can be bundled and moved, and the cache continues to work.
When enabled, paths encoded in hash are relative to compile cache directory.
Fixes: #58755
Refs: #52696
Thanks @joyeecheung for all the help :)