-
Notifications
You must be signed in to change notification settings - Fork 340
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
Fail the build if apt-get or curl errors #79
Conversation
4e34ff9
to
1a53a7b
Compare
Enables the bash `pipefail` mode, which ensures that a failure in a command prior to a pipe correctly causes the script to exit 1. Without this, failures during the `apt-get` and `curl` invocations were ignored and the compile marked as a success. At best this leads to confusing errors in later buildpacks (if build time dependencies are missing), and at worst this could cause runtime failures for packages not used during the build, but required by the app at runtime. Enabling `pipefail` mode required a change to the custom repositories feature, to prevent the build exiting 1 when `grep -s -e "^:repo:"` found no matches (ie when no custom repositories are specified). In addition, the `--show-error` and `--fail` flags have been added to the `curl` call, otherwise non-HTTP 200 exit codes are ignored and the compile similarly marked as successful when it should not have been. Fixes #47. Fixes W-8722791.
1a53a7b
to
0803401
Compare
Correctly fails the build early for non-existent packages:
Succeeds for a valid package:
|
|
Note: If you see build errors after this change, when you didn't previously, check previously "successful" builds and you will see the same error message in them. The difference now is that errors are no longer silently ignored, and instead the buildpack correctly marks the build as failing, if the packages didn't install correctly. This new behaviour prevents missing dependencies from potentially causing downtime after deployment. These errors are not an error in the APT buildpack, but due to invalid entries in your application's For example, if you see an error like:
Then it means you need to look in your Or if you see something like:
Then remove the related |
In a recent support ticket, a user had copied the example `:repo:` line into their `Aptfile`, which previously referred to the now obsolete "artful" Ubuntu LTS release. This caused the build to fail after #79, when previously the error was ignored. This PR makes the example more clearly just an example, and emphasises that using a custom repository is only necessary if using packages from outside the standard Ubuntu repository. In addition, the bogus `pg` Gem example was removed, since `libpq-dev` is part of the stack image, so we should not be encouraging people to install it unnecessarily.
In a recent support ticket, a user had copied the example `:repo:` line into their `Aptfile`, which previously referred to the now obsolete "artful" Ubuntu LTS release. This caused the build to fail after #79, when previously the error was ignored. This PR makes the example more clearly just an example, and emphasises that using a custom repository is only necessary if using packages from outside the standard Ubuntu repository. In addition, the bogus `pg` Gem example was removed, since `libpq-dev` is part of the stack image, so we should not be encouraging people to install it unnecessarily.
In a recent support ticket, a user had copied the example `:repo:` line into their `Aptfile`, which previously referred to the now obsolete "artful" Ubuntu LTS release. This caused the build to fail after #79, when previously the error was ignored. This PR makes the example more clearly just an example, and emphasises that using a custom repository is only necessary if using packages from outside the standard Ubuntu repository. In addition, the bogus `pg` Gem example was removed, since `libpq-dev` is part of the stack image, so we should not be encouraging people to install it unnecessarily.
Enables the bash `pipefail` mode, which ensures that a failure in a command prior to a pipe correctly causes the script to exit 1. Without this, failures during the `apt-get` and `curl` invocations were ignored and the compile marked as a success. At best this leads to confusing errors in later buildpacks (if build time dependencies are missing), and at worst this could cause runtime failures for packages not used during the build, but required by the app at runtime. Enabling `pipefail` mode required a change to the custom repositories feature, to prevent the build exiting 1 when `grep -s -e "^:repo:"` found no matches (ie when no custom repositories are specified). In addition, the `--show-error` and `--fail` flags have been added to the `curl` call, otherwise non-HTTP 200 exit codes are ignored and the compile similarly marked as successful when it should not have been. Fixes heroku#47. Fixes W-8722791.
In a recent support ticket, a user had copied the example `:repo:` line into their `Aptfile`, which previously referred to the now obsolete "artful" Ubuntu LTS release. This caused the build to fail after heroku#79, when previously the error was ignored. This PR makes the example more clearly just an example, and emphasises that using a custom repository is only necessary if using packages from outside the standard Ubuntu repository. In addition, the bogus `pg` Gem example was removed, since `libpq-dev` is part of the stack image, so we should not be encouraging people to install it unnecessarily.
Enables the bash `pipefail` mode, which ensures that a failure in a command prior to a pipe correctly causes the script to exit 1. Without this, failures during the `apt-get` and `curl` invocations were ignored and the compile marked as a success. At best this leads to confusing errors in later buildpacks (if build time dependencies are missing), and at worst this could cause runtime failures for packages not used during the build, but required by the app at runtime. Enabling `pipefail` mode required a change to the custom repositories feature, to prevent the build exiting 1 when `grep -s -e "^:repo:"` found no matches (ie when no custom repositories are specified). In addition, the `--show-error` and `--fail` flags have been added to the `curl` call, otherwise non-HTTP 200 exit codes are ignored and the compile similarly marked as successful when it should not have been. Fixes heroku#47. Fixes W-8722791.
In a recent support ticket, a user had copied the example `:repo:` line into their `Aptfile`, which previously referred to the now obsolete "artful" Ubuntu LTS release. This caused the build to fail after heroku#79, when previously the error was ignored. This PR makes the example more clearly just an example, and emphasises that using a custom repository is only necessary if using packages from outside the standard Ubuntu repository. In addition, the bogus `pg` Gem example was removed, since `libpq-dev` is part of the stack image, so we should not be encouraging people to install it unnecessarily.
Enables the bash
pipefail
mode, which ensures that a failure in a command prior to a pipe correctly causes the script to exit 1.Without this, failures during the
apt-get
andcurl
invocations were ignored and the compile marked as a success. At best this leads to confusing errors in later buildpacks (if build time dependencies are missing), and at worst this could cause runtime failures for packages not used during the build, but required by the app at runtime.Enabling
pipefail
mode required a change to the custom repositories feature, to prevent the build exiting 1 whengrep -s -e "^:repo:"
found no matches (ie when no custom repositories are specified).In addition, the
--show-error
and--fail
flags have been added to thecurl
call, otherwise non-HTTP 200 exit codes are ignored and the compile similarly marked as successful when it should not have been.Fixes #47.
Fixes W-8722791.