Skip to content

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

Open
@edmorley

Description

@edmorley

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions