Hi
I'm on the team that maintains Heroku's build system and official buildpacks, and wanted to let you know about a future incompatibility with this buildpack.
The directory in which the Heroku build system performs builds is currently a path like/tmp/build_<hash>
.
In the near future this path will be changing to /app
so that the build-time and run-time app locations are the same path - in order to resolve a number of long standing bugs and reduce the number of hacks buildpacks have to use to work around non-relocatable languages/toolchains.
One side-effect of this build directory change is that it will no longer be possible to rm -rf $BUILD_DIR
since that will now be equivalent to rm -rf /app
, and due to the way slugs are mounted inside a dyno, the /app
directory is read-only (not the contents of the directory, only the directory listing itself).
As such once this change comes into effect, builds using this buildpack will experience errors in the log (but the build will continue on, due to #7) like so:
remote: -----> Subdir to Root buildpack app detected
remote: Creating temp directory
remote: Created temp directory: /tmp/codon/tmp/cache/subrootS7COO
remote: Moving subdir: frontend to temp dir: /tmp/codon/tmp/cache/subrootS7COO
remote: Cleaning and re-creating build directory
remote: rm: cannot remove '/app': Read-only file system
remote: Moving project directory from /tmp/codon/tmp/cache/subrootS7COO to /app
remote: mv: inter-device move failed: '/tmp/codon/tmp/cache/subrootS7COO/frontend' to '/app'; unable to remove target: Read-only file system
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote:
remote: -----> Compressing...
remote: Done: 190B
remote: -----> Launching...
remote: Released v4
Due to these lines:
|
rm -rf "${BUILD_DIR}" |
|
mkdir -p "${BUILD_DIR}" |
|
|
|
msg "Moving project directory from ${TMP_DIR} to ${BUILD_DIR}" |
|
mv -T "${TMP_DIR}/${PROJECT_NAME}" "${BUILD_DIR}" |
In order to resolve this, the buildpack needs to instead delete only the contents of the directory (and not the directory root), and adjust the mv
of files back into the build directory accordingly.