-
Notifications
You must be signed in to change notification settings - Fork 331
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
Buildpack warnings when building in /app ("rm: cannot remove '/app': Read-only file system") #9
Comments
This was referenced Mar 1, 2021
This was referenced Apr 1, 2021
czerwinskilukasz1
pushed a commit
to czerwinskilukasz1/subdir-heroku-buildpack
that referenced
this issue
May 25, 2022
Since otherwise once Heroku builds are run from `/app`, builds will output warnings due to the `/app` root being read only: ``` remote: -----> Subdir buildpack app detected ... remote: cleaning build dir /app remote: rm: cannot remove '/app': Read-only file system ``` Fixes timanovsky#9. Co-authored-by: Alexey Timanovsky <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 (which is one of the most popular of the sub directory/monorepo style buildpacks).
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 torm -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 this buildpack will output
Read-only file system
warnings like so:Due to this line:
subdir-heroku-buildpack/bin/compile
Line 19 in 5485d38
The build won't actually fail, since
bin/compile
doesn't use bash exit on error (#8). Conveniently, the build output result will actually still be correct, since therm -rf $BUILD_DIR
will still remove all of the other files in/app
even though it fails to remove/app
itself.As such, this is more of a warning than an error, though it might lead people to think the buildpack isn't working.
In order to prevent the warning, the buildpack needs to instead delete only the contents of the directory, not the directory root - I'll open a PR for that now.
The text was updated successfully, but these errors were encountered: