-
Notifications
You must be signed in to change notification settings - Fork 322
Use symlinks instead of moving build directory #278
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,22 +34,11 @@ metrics::setup | |
|
|
||
| if is_app_dir "${APP_BUILD_DIR}"; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a Heroku CI Hatchet test in this repo - and Heroku CI is one of the cases where the (The other case when the app dir varies is when the |
||
| BUILD_DIR="/tmp/scala_buildpack_build_dir" | ||
| mv "${APP_BUILD_DIR}" "${BUILD_DIR}" | ||
| ln -s "${APP_BUILD_DIR}" "${BUILD_DIR}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (optional) I find these variable names confusing, given in most other buildpacks the BUILD_DIR really does mean the actual build dir. For example the I wonder if the symlink path should be named something else? |
||
| else | ||
| BUILD_DIR="${APP_BUILD_DIR}" | ||
| fi | ||
|
|
||
| # When multiple buildpacks are used, earlier buildpacks may add executables to PATH | ||
| # and GEM_PATH that reference APP_BUILD_DIR. Since we've moved the build directory to | ||
| # a temp location, we must rewrite these environment variables to replace APP_BUILD_DIR | ||
| # with the new BUILD_DIR so that executables added by earlier buildpacks remain accessible. | ||
| PATH=${PATH//"${APP_BUILD_DIR}"/"${BUILD_DIR}"} | ||
| export PATH | ||
| if [[ -n "${GEM_PATH:-}" ]]; then | ||
| GEM_PATH=${GEM_PATH//"${APP_BUILD_DIR}"/"${BUILD_DIR}"} | ||
| export GEM_PATH | ||
| fi | ||
|
|
||
| util::export_env_dir "${ENV_DIR}" "." "JAVA_OPTS" | ||
|
|
||
| # Used by openjdk::install_openjdk_via_jvm_common_buildpack to determine which JVM common buildpack to use | ||
|
|
@@ -277,9 +266,9 @@ cat <<-EOF >"${profile_script}" | |
| export PATH="\$SBT_HOME/bin:\$PATH" | ||
| EOF | ||
|
|
||
| # Move compiled app back to where Heroku expects it | ||
| # Remove symlink if we created one | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (background only) For Python and PHP we don't remove the symlinks after, in case later buildpacks happen to call those paths. I imagine that's less likely to happen for Scala though. |
||
| if is_app_dir "${APP_BUILD_DIR}"; then | ||
| mv "${BUILD_DIR}" "${APP_BUILD_DIR}" | ||
| rm "${BUILD_DIR}" | ||
| fi | ||
|
|
||
| # write export script | ||
|
|
||
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.
(for another PR) The function is called
is_app_dirbut it actually seems to checks for whether the directory is not the/appdir?