Skip to content

Conversation

@schneems
Copy link
Contributor

@schneems schneems commented Nov 18, 2025

When:

  • An app is using heroku/ruby as a buildpack (NOT during the auto-buildpack detection)
  • Tries do deploy without a Gemfile
  • They will see this error:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz        
remote:        /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: BUILD_DIR: unbound variable        
remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: output::error: command not found        

When they should see a detailed error output explaining why they couldn't deploy. This behavior was added in #1647 and this error was reported in #1647 (comment).

GUS-W-20256726

```
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz        
remote:        /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: BUILD_DIR: unbound variable        
remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/detect: line 12: output::error: command not found        
```
```
ANSI_YELLOW='\033[1;33m'
^---------^ SC2034 (warning): ANSI_YELLOW appears unused. Verify use (or export if used externally).

ANSI_BLUE='\033[1;34m'
^-------^ SC2034 (warning): ANSI_BLUE appears unused. Verify use (or export if used externally).
```
```
$ git ls-files -z --cached --others --exclude-standard ':(exclude)*.rb' 'bin/*' '*/bin/*' '*.sh' | \
              xargs -0 shellcheck --check-sourced --color=always

In bin/support/bash_functions.sh line 34:
  return $ec
         ^-^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  return "$ec"


In bin/support/bash_functions.sh line 53:
    return $skip_java_install
           ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    return "$skip_java_install"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```
@schneems schneems force-pushed the schneems/fix-unbound-variable branch from 04afbbd to 8484138 Compare November 18, 2025 16:06
@schneems schneems marked this pull request as ready for review November 18, 2025 16:22
@schneems schneems requested a review from a team as a code owner November 18, 2025 16:22
Copy link
Contributor

@dzuelke dzuelke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's easier/safer to have the escape codes evaluated at time of assignment (using $'...' syntax), and then use a plain echo without -e, or, even simpler and without a while read loop, have sed do the "wrapping"

schneems and others added 4 commits November 18, 2025 11:52
Co-authored-by: David Zuelke <[email protected]>
Signed-off-by: Richard Schneeman <[email protected]>
Co-authored-by: David Zuelke <[email protected]>
Signed-off-by: Richard Schneeman <[email protected]>
```
$             git ls-files -z --cached --others --exclude-standard ':(exclude)*.rb' 'bin/*' '*/bin/*' '*.sh' | \
              xargs -0 shellcheck --check-sourced --color=always

In bin/support/bash_functions.sh line 19:
        local line
              ^--^ SC2034 (warning): line appears unused. Verify use (or export if used externally).

```
@schneems schneems requested a review from dzuelke November 18, 2025 20:39
@schneems
Copy link
Contributor Author

I merged all your blocking style suggestions and added an output to the sed line. This is now ready for re-review.

I'll start working on a PR to https://github.com/heroku/heroku-buildpack-python/blob/b4260ada2ea84dd54b318117ba94183ba5c41e03/lib/output.sh#L70-L87 to apply your style suggestions to the source of that code.

@schneems schneems dismissed dzuelke’s stale review November 18, 2025 21:04

I got approval from Colin on the suggested changes. If there's more, I'll prioritize them. I need to get this fix released to customers.

@schneems schneems enabled auto-merge (squash) November 18, 2025 21:05
@schneems schneems disabled auto-merge November 18, 2025 22:06
@schneems schneems requested a review from colincasey November 18, 2025 22:13
@schneems schneems merged commit 37b91ee into main Nov 18, 2025
4 checks passed
@schneems schneems deleted the schneems/fix-unbound-variable branch November 18, 2025 22:26
@heroku-linguist heroku-linguist bot mentioned this pull request Nov 18, 2025
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.

3 participants