You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix variable scope
```
/var/lib/buildpack/bin/support/bash_functions.sh: line 53: heroku_buildpack_ruby_dir: unbound variable
```
* Prefer local variable
The local `stack` is set from `STACK` earlier. Prefer it everywhere in the function.
* Test behavior change
* CHANGELOG
* Change bash variable scope
The local `heroku_buildpack_ruby_dir` is not available inside of the function `atexit`. Moving the code out of a function means the local doesn't need to be present at exit.
* Remove vendored buildpack detection
The old buildpack logic would pre-vendor a Ruby version at deploy in `vendor/ruby/$stack/$arch` of the buildpack dir. There were problems when the Ruby buildpack was specified to run twice so a check was added for that condition.
The logic was changed to always download the Ruby verison and not pre-vendor details in the PR heroku#1481.
Since that's no longer happening, we can avoid the check and just create a tempdir every time. This simplifies the logic.
* Remove stack as it's no longer used
* Inline bash function
Fixing the previously hidden warning introduced a new error:
```
remote: -----> Ruby app detected
remote: /tmp/codon/tmp/buildpacks/ed3d993430eab40cdfcb6130d0909c19a1b9ae24/bin/compile: line 39: /tmp/tmp.Uu0SIOeXEb/bin/ruby: No such file or directory
```
What's happening here is that the `trap` to cleanup the bootstrap dir was firing on subshell exit, and since we were capturing the output of that function via `bootstrap_ruby=$(...)` it was creating the directory and immediately deleting it.
This was previously not a problem as the local variable scoping prevented the `rm -rf` from firing correctly. But fixing that variable scoping error introduced this problem. We can fix by moving that trap out of a sub-shell. Since this function is really only 3 lines long at this point, there's not much benefit in having it as a function, especially if it cannot provide the automatic cleanup behavior as desired.
0 commit comments