Skip to content

Commit

Permalink
Do not enable optimizations by default when compiling python from sou…
Browse files Browse the repository at this point in the history
…rce.

- It takes significantly longer to compile python with this flag (typically
  about 5x), and this slows down the integration tests significantly.
- This change does not affect the pre-built binaries on the bionic and jammy
  stacks - just the compilation from source on wildcard (*) stacks.
- Users who want to use this buildpack to compile python from source can pass
  that flag via the existing BP_CONFIGURE_FLAGS environment variable mechanism.
  • Loading branch information
robdimsdale committed Nov 14, 2022
1 parent a77bd71 commit 284526b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (i CPythonInstaller) Install(
flags, _ := entry.Metadata["configure-flags"].(string)

if flags == "" {
flags = "--enable-optimizations --with-ensurepip"
flags = "--with-ensurepip"
i.logger.Debug.Subprocess("Using default configure flags: %v\n", flags)
}

Expand Down
1 change: 0 additions & 1 deletion installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func testCPythonInstaller(t *testing.T, context spec.G, it spec.S) {
Expect(configureProcess.ExecuteCall.CallCount).To(Equal(1))
Expect(configureProcess.ExecuteCall.Receives.Execution).To(MatchFields(IgnoreExtras, Fields{
"Args": Equal([]string{
"--enable-optimizations",
"--with-ensurepip",
fmt.Sprintf("--prefix=%s", layerPath),
}),
Expand Down

0 comments on commit 284526b

Please sign in to comment.