Skip to content

Commit

Permalink
fix: restore ability to use occam with extensions
Browse files Browse the repository at this point in the history
Recent change to support multi-arch for buildpacks brokle occam
for extensions. This was because extensions were being built
with "pack buildpack package" which seems to work for extensions
if a tgz is passed in but not an expanded directory.

Update to use "pack extension package" for extensions instead.
Unfortunately pack does not yet seem to support multi-arch
for extensions so we'll have to add the --target option
for extensions after that has been added.

Signed-off-by: Michael Dawson <[email protected]>
  • Loading branch information
mhdawson authored and ForestEckhardt committed Nov 28, 2024
1 parent 63a9e44 commit f760b3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
20 changes: 15 additions & 5 deletions packagers/jam.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,21 @@ func (j Jam) Execute(buildpackDir, output, version string, offline bool) error {

}

args = []string{
"buildpack", "package",
output,
"--format", "file",
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
if ( command == "--buildpack") {
args = []string{
"buildpack", "package",
output,
"--format", "file",
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
}
} else {
// pack extension does not yet support multi-arch
// update to inclue --target once it does
args = []string{
"extension", "package",
output,
"--format", "file",
}
}

err = j.pack.Execute(pexec.Execution{
Expand Down
3 changes: 1 addition & 2 deletions packagers/jam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ func testJam(t *testing.T, context spec.G, it spec.S) {
}))

Expect(pack.ExecuteCall.Receives.Execution.Args).To(Equal([]string{
"buildpack", "package",
"extension", "package",
"some-output",
"--format", "file",
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
}))
})
})
Expand Down

0 comments on commit f760b3a

Please sign in to comment.