Skip to content

Conversation

Malax
Copy link
Member

@Malax Malax commented Oct 21, 2025

The buildpack moves the build directory to /tmp/scala_buildpack_build_dir to provide a stable path for sbt's incremental compilation cache, which invalidates when paths change between builds.

This changes the approach from moving the directory (and moving it back at the end) to creating a symlink at the stable path pointing to the original location. This eliminates the expensive move operations while maintaining the same stable path for sbt.

Changes:

  • Replace mv with ln -s when creating the temporary build directory
  • Remove PATH and GEM_PATH rewriting logic (no longer needed since files stay in place)
  • Replace final mv back with simple rm of the symlink

sbt relies on stable paths for its incremental compilation cache. The
buildpack previously moved the entire build directory to a temporary
location to provide a stable path, then moved it back at the end.

This change replaces the expensive move operations with a symlink,
providing the same stable path for sbt while keeping files in their
original location. This eliminates the need to rewrite PATH and
GEM_PATH variables to account for the directory move.
@Malax Malax force-pushed the malax/use-symlinks-for-build-dir branch from bd1e5fb to 41c4305 Compare October 22, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant