-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rebuild with cached dependencies #393
Rebuild with cached dependencies #393
Conversation
94fdd61
to
f6ecd94
Compare
f6ecd94
to
af02e36
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.
This looks good to me if we can just make the suggested change to remove the cache flag from the launch layer.
build.go
Outdated
if err != nil { | ||
return packit.BuildResult{}, err | ||
} | ||
} | ||
} | ||
|
||
layer.Cache = true |
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.
We shouldn't need to set the cache flag on a launch layer. In this case, I believe the issue is that we've moved the layer.ExecD
assignment outside of the if run
conditional block which means it gets set on every run. Then, without the cache flag set, the exec.d
binary getting written to the layer wipes out the previous contents. If you move the layer.ExecD
setting back to its original location, then you can remove this flag.
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.
@ryanmoran Thanks for the review. Are you sure about the original location, though? Originally, it was located at launch>run>build, but with that some caching test (vendored) fail. I moved it to launch>run and the test succeeds and I removed the layer.Cache=true
. WDYT?
c4027fc
to
ce495f3
Compare
- Introducing NODE_PROJECT_PATH to create correct symlinks at launch time Co-authored-by: Philipp Stehle <philipp.stehle@sap.com> Co-authored-by: Pavel Busko <pavel.busko@sap.com> Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
ce495f3
to
0c6e911
Compare
Summary
As reported in the #375, if an app has only
package-lock.json
and nonode_modules
folder, after the rebuild thenode_modules
symlink from the workspace will point to non-existent build layer, instead of launch layer. Also the launch layer was not cached, which resulted in missing node_modules at all.Another issue which is fixed in scope of that PR, is that if the
BP_NODE_PROJECT_PATH
is set, thesetup-symlinks
would fail, since there's no symlink in the working directory. Fixed by exposing project path as a launch environment variableNODE_PROJECT_PATH
Potentially contains a fix for #342
Checklist