Skip to content
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

Error if the Python buildpack has been run multiple times during the same build #1704

Open
edmorley opened this issue Nov 25, 2024 · 1 comment · Fixed by #1724
Open

Error if the Python buildpack has been run multiple times during the same build #1704

edmorley opened this issue Nov 25, 2024 · 1 comment · Fixed by #1724
Assignees

Comments

@edmorley
Copy link
Member

edmorley commented Nov 25, 2024

From looking at buildpack usage data there are a small number of apps which are accidentally running the Python buildpack multiple times during the build.

For example:

-----> Using buildpacks:
       1. heroku/python
       2. heroku/python

Or:

-----> Using buildpacks:
       1. https://github.com/heroku/heroku-buildpack-python.git
       2. https://github.com/heroku/heroku-buildpack-apt.git
       3. heroku/python

Running the Python buildpack multiple times:

  1. Slows down the build
  2. Means the buildpack has to defensively handle files/directories existing in the build dir in locations that should be empty during steps like cache restoration)
  3. Makes it more error prone for the Python buildpack to do things like fail the build if PYTHONHOME is set (which is something that should never be set via app config vars) - since it could have been set by an earlier run of the Python buildpack

As such, we should add a warning+metrics if Python-buildpack related files are found in the build directory, which we then eventually upgrade to an error message (that explains how to remove the duplicate buildpack).

GUS-W-17309709.
GUS-W-17309720.

@edmorley edmorley self-assigned this Nov 25, 2024
edmorley added a commit that referenced this issue Dec 13, 2024
- Adds a warning if the Python buildpack has been run multiple times
  in the same build.
- Adds a warning if an existing `.heroku/python/` directory is found
  in the app source.
- Improves the error message shown if the buildpack is used on an
  unsupported stack. Previously the build would fail with a curl
  download error depending on the availability of assets on S3.
  This scenario can only happen outside of Heroku, or in an old
  buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will
be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.
edmorley added a commit that referenced this issue Dec 13, 2024
- Adds a warning if the Python buildpack has been run multiple times
  in the same build.
- Adds a warning if an existing `.heroku/python/` directory is found
  in the app source.
- Improves the error message shown if the buildpack is used on an
  unsupported stack. Previously the build would fail with a curl
  download error depending on the availability of assets on S3.
  This scenario can only happen outside of Heroku, or in an old
  buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will
be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.
edmorley added a commit that referenced this issue Dec 13, 2024
- Adds a warning if the Python buildpack has been run multiple times
  in the same build.
- Adds a warning if an existing `.heroku/python/` directory is found
  in the app source.
- Improves the error message shown if the buildpack is used on an
  unsupported stack. Previously the build would fail with a curl
  download error depending on the availability of assets on S3.
  This scenario can only happen outside of Heroku, or in an old
  buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will
be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.
edmorley added a commit that referenced this issue Dec 13, 2024
- Adds a warning if the Python buildpack has been run multiple times
  in the same build.
- Adds a warning if an existing `.heroku/python/` directory is found
  in the app source.
- Improves the error message shown if the buildpack is used on an
  unsupported stack. Previously the build would fail with a curl
  download error depending on the availability of assets on S3.
  This scenario can only happen outside of Heroku, or in an old
  buildpack is used with a brand new stack (eg for Heroku-26).

The two warnings are the first step towards #1704 and #1710, and will
be turned into errors in January 2025.

Towards #1704 and #1710.
GUS-W-17386432.
GUS-W-17309709.
@edmorley edmorley linked a pull request Dec 13, 2024 that will close this issue
@edmorley
Copy link
Member Author

An initial warning has been added in #1724.

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 a pull request may close this issue.

1 participant