heroku / heroku-buildpack-clojure

Heroku's buildpack for Clojure applications.
MIT License
117 stars 114 forks source link

Fix compatibility with the `heroku/google-chrome` buildpack #122

Closed Malax closed 2 years ago

Malax commented 2 years ago

When this buildpack is used together with the heroku/google-chrome buildpack, the build will eventually fail with an error like this:

chmod: cannot operate on dangling symlink '/tmp/build_34fcaac1/.heroku/apt/usr/bin/google-chrome-stable'

This happens because both buildpacks use the same directory in the buildpack cache directory for their apt cache and state dir. The Clojure buildpack will re-use the state and cache dir from the Chrome buildpack and install all packages that buildpack installed agin, but into a different directory. This means that not only the build will fail because we try to chmod +x a dangling symlink that is installed by the Chrome .deb, but also that the slug size will be increase greatly as we installed Chrome and its dependencies twice.

I consider the dangling symlink an issue of the heroku/google-chome buildpack (if at all) so there is no attempt made here to fix the symlink, but instead fix the root cause: apt cache and state dir collisions between these two buildpacks. I added an integration test for this case.

Changelog was updated for immediate release.

Closes GUS-W-11389779