Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
344afa4
Use golang.org/x/sys/unix for FreeBSD Setres[gu]id()
hut8 Jan 15, 2024
c8345a5
Include freebsd in *_unix.go
hut8 Jan 15, 2024
a88f8fc
Use dummy implementation for both darwin and freebsd
hut8 Jan 15, 2024
a529a8c
Update GitHub Actions
hut8 Jan 15, 2024
46aa425
Update main Makefile for FreeBSD
hut8 Jan 15, 2024
a9fc266
Add FreeBSD to _unix.go for acceptance
hut8 Jan 15, 2024
12a8215
Add docstrings to appease linter
hut8 Jan 15, 2024
eecf4cc
Use same vars testhelper for FreeBSD as Darwin
hut8 Jan 15, 2024
e43ed90
Also build test executable for FreeBSD
hut8 Jan 15, 2024
09dc46f
Docstrings to appease the linters
hut8 Jan 15, 2024
d0f96ad
More logging for failed tests
hut8 Jan 15, 2024
8d216b7
add standard freebsd bash path
hut8 Jan 15, 2024
4e3287f
Do not assume location of bash
hut8 Jan 16, 2024
1337f75
upgrade freebsd-vm action
hut8 Jan 16, 2024
20dfcda
debug installing go
hut8 Jan 16, 2024
19872dc
select go version dynamically
hut8 Jan 16, 2024
08e2181
Use "linux" os detection on FreeBSD
hut8 Jan 16, 2024
c639428
Fix PATH
hut8 Jan 16, 2024
4c13359
Correctly figure out GOARCHIVE_BASENAME
hut8 Jan 16, 2024
5d1f0f4
Also need git
hut8 Jan 16, 2024
a7f4f62
properly extract just filename
hut8 Jan 16, 2024
af9f697
Supress safe directory checks in Git
hut8 Jan 16, 2024
7554af2
Use gmake on freebsd
hut8 Jan 16, 2024
4a63be2
linter wants history!
hut8 Jan 16, 2024
e2c03f9
Further test debugging
hut8 Jan 17, 2024
79e4eed
We actually need bash
hut8 Jan 17, 2024
ffd0696
Revert test logging
hut8 Jan 17, 2024
ecf97c6
Revert test logging fixes
hut8 Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,35 @@ jobs:
run: |
make format || true
make test
test-freebsd-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read Go version
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_OUTPUT
id: version
- name: Test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y wget gmake curl jq git bash
GOARCHIVE_BASENAME=$(curl -sSL 'https://go.dev/dl/?mode=json' | \
jq -r '.[0].files[] | select(.os == "freebsd") | select(.arch == "amd64") | select(.kind == "archive") | .filename')
GOARCHIVE_URL="https://go.dev/dl/$GOARCHIVE_BASENAME"
echo "downloading go from $GOARCHIVE_URL"
wget -q "$GOARCHIVE_URL"
ls -la "$GOARCHIVE_BASENAME"
tar -C /usr/local -xzf "$GOARCHIVE_BASENAME"
run: |
git config --global --add safe.directory '*'
export GOROOT=/usr/local/go
export GOPATH=/usr/local/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
gmake format || true
gmake test
test-windows:
runs-on: windows-2019
steps:
Expand Down Expand Up @@ -109,6 +138,7 @@ jobs:
needs:
- test-linux-amd64
- test-linux-arm64
- test-freebsd-amd64
- test-windows
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -167,6 +197,14 @@ jobs:
with:
name: lifecycle-linux-s390x-sha256
path: out/lifecycle-v*+linux.s390x.tgz.sha256
- uses: actions/upload-artifact@v3
with:
name: lifecycle-freebsd-x86-64
path: out/lifecycle-v*+freebsd.x86-64.tgz
- uses: actions/upload-artifact@v3
with:
name: lifecycle-freebsd-x86-64-sha256
path: out/lifecycle-v*+freebsd.x86-64.tgz.sha256
- uses: actions/upload-artifact@v3
with:
name: lifecycle-windows-x86-64
Expand Down Expand Up @@ -217,13 +255,17 @@ jobs:
LINUX_S390X_SHA=$(go run ./tools/image/main.go -lifecyclePath ./out/lifecycle-v*+linux.s390x.tgz -tag buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-linux-s390x -arch s390x | awk '{print $NF}')
echo "LINUX_S390X_SHA: $LINUX_S390X_SHA"

FREEBSD_AMD64_SHA=$(go run ./tools/image/main.go -lifecyclePath ./out/lifecycle-v*+freebsd.x86-64.tgz -tag buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-freebsd-x86-64 -os freebsd | awk '{print $NF}')
echo "FREEBSD_AMD64_SHA: $FREEBSD_AMD64_SHA"

WINDOWS_AMD64_SHA=$(go run ./tools/image/main.go -lifecyclePath ./out/lifecycle-v*+windows.x86-64.tgz -tag buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-windows -os windows | awk '{print $NF}')
echo "WINDOWS_AMD64_SHA: $WINDOWS_AMD64_SHA"

docker manifest create buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG} \
buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-linux-x86-64@${LINUX_AMD64_SHA} \
buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-linux-arm64@${LINUX_ARM64_SHA} \
buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-linux-s390x@${LINUX_S390X_SHA} \
buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-freebsd-x86-64@${FREEBSD_AMD64_SHA} \
buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG}-windows@${WINDOWS_AMD64_SHA}

MANIFEST_SHA=$(docker manifest push buildpacksio/lifecycle:${LIFECYCLE_IMAGE_TAG})
Expand Down Expand Up @@ -278,6 +320,42 @@ jobs:
LIFECYCLE_PATH="../lifecycle-v${{ env.LIFECYCLE_VERSION }}+linux.x86-64.tgz" \
LIFECYCLE_IMAGE="buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}" \
make acceptance
pack-acceptance-freebsd:
if: github.event_name == 'push'
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: 'buildpacks/pack'
path: 'pack'
ref: 'main'
fetch-depth: 0 # fetch all history for all branches and tags
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'pack/go.mod'
- uses: actions/download-artifact@v3
with:
name: version
- uses: actions/download-artifact@v3
with:
name: tag
- name: Set env
run: |
cat version.txt >> $GITHUB_ENV
cat tag.txt >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: lifecycle-freebsd-x86-64
path: pack
- name: Run pack acceptance
run: |
cd pack
git checkout $(git describe --abbrev=0 --tags) # check out the latest tag
LIFECYCLE_PATH="../lifecycle-v${{ env.LIFECYCLE_VERSION }}+freebsd.x86-64.tgz" \
LIFECYCLE_IMAGE="buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}" \
make acceptance
pack-acceptance-windows:
if: github.event_name == 'push'
needs: build-and-publish
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
exit 1
fi
echo "LIFECYCLE_VERSION=$version" >> $GITHUB_ENV
- name: Determine download urls for linux-x86-64, linux-arm64, linux-s390x, and windows
- name: Determine download urls for linux-x86-64, linux-arm64, linux-s390x, freebsd-x86-64, and windows
id: artifact-urls
# FIXME: this script should be updated to work with actions/github-script@v6
uses: actions/github-script@v3
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
echo "LINUX_S390X_SHA: $LINUX_S390X_SHA"
echo "LINUX_S390X_SHA=$LINUX_S390X_SHA" >> $GITHUB_ENV

FREEBSD_AMD64_SHA=$(cosign verify -key cosign.pub buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-freebsd-x86-64 | jq -r .[0].critical.image.\"docker-manifest-digest\")
echo "FREEBSD_AMD64_SHA: $FREEBSD_AMD64_SHA"
echo "FREEBSD_AMD64_SHA=$FREEBSD_AMD64_SHA" >> $GITHUB_ENV

WINDOWS_AMD64_SHA=$(cosign verify --certificate-identity-regexp "https://github.com/${{ github.repository_owner }}/lifecycle/.github/workflows/build.yml" --certificate-oidc-issuer https://token.actions.githubusercontent.com buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-windows | jq -r .[0].critical.image.\"docker-manifest-digest\")
echo "WINDOWS_AMD64_SHA: $WINDOWS_AMD64_SHA"
echo "WINDOWS_AMD64_SHA=$WINDOWS_AMD64_SHA" >> $GITHUB_ENV
Expand All @@ -59,12 +63,14 @@ jobs:
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-x86-64@${{ env.LINUX_AMD64_SHA }} ${{ env.LIFECYCLE_VERSION }}-linux-x86-64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-arm64@${{ env.LINUX_ARM64_SHA }} ${{ env.LIFECYCLE_VERSION }}-linux-arm64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-s390x@${{ env.LINUX_S390X_SHA }} ${{ env.LIFECYCLE_VERSION }}-linux-s390x
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-freebsd-x86-64@${{ env.FREEBSD_AMD64_SHA }} ${{ env.LIFECYCLE_VERSION }}-freebsd-x86-64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-windows@${{ env.WINDOWS_AMD64_SHA }} ${{ env.LIFECYCLE_VERSION }}-windows

docker manifest create buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }} \
buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}-linux-x86-64@${{ env.LINUX_AMD64_SHA }} \
buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}-linux-arm64@${{ env.LINUX_ARM64_SHA }} \
buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}-linux-s390x@${{ env.LINUX_S390X_SHA }} \
buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}-freebsd-x86-64@${{ env.FREEBSD_AMD64_SHA }} \
buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}-windows@${{ env.WINDOWS_AMD64_SHA }}

MANIFEST_SHA=$(docker manifest push buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }})
Expand Down Expand Up @@ -96,6 +102,7 @@ jobs:
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-x86-64@${{ env.LINUX_AMD64_SHA }} latest-linux-x86-64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-arm64@${{ env.LINUX_ARM64_SHA }} latest-linux-arm64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-linux-s390x@${{ env.LINUX_S390X_SHA }} latest-linux-s390x
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-freebsd-x86-64@${{ env.FREEBSD_AMD64_SHA }} latest-freebsd-x86-64
crane tag buildpacksio/lifecycle:${{ env.LIFECYCLE_IMAGE_TAG }}-windows@${{ env.WINDOWS_AMD64_SHA }} latest-windows

docker manifest create buildpacksio/lifecycle:latest \
Expand Down
64 changes: 62 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ build-linux-amd64: build-linux-amd64-lifecycle build-linux-amd64-symlinks build-
build-linux-arm64: build-linux-arm64-lifecycle build-linux-arm64-symlinks build-linux-arm64-launcher
build-windows-amd64: build-windows-amd64-lifecycle build-windows-amd64-symlinks build-windows-amd64-launcher
build-linux-s390x: build-linux-s390x-lifecycle build-linux-s390x-symlinks build-linux-s390x-launcher
build-freebsd-amd64: build-freebsd-amd64-lifecycle build-freebsd-amd64-symlinks build-freebsd-amd64-launcher

build-image-linux-amd64: build-linux-amd64 package-linux-amd64
build-image-linux-amd64: ARCHIVE_PATH=$(BUILD_DIR)/lifecycle-v$(LIFECYCLE_VERSION)+linux.x86-64.tgz
Expand All @@ -66,12 +67,19 @@ build-image-linux-s390x: ARCHIVE_PATH=$(BUILD_DIR)/lifecycle-v$(LIFECYCLE_VERSIO
build-image-linux-s390x:
$(GOCMD) run ./tools/image/main.go -daemon -lifecyclePath $(ARCHIVE_PATH) -os linux -arch s390x -tag lifecycle:$(LIFECYCLE_IMAGE_TAG)

build-image-freebsd-amd64: build-freebsd-amd64 package-freebsd-amd64
build-image-freebsd-amd64: ARCHIVE_PATH=$(BUILD_DIR)/lifecycle-v$(LIFECYCLE_VERSION)+freebsd.x86-64.tgz
build-image-freebsd-amd64:
$(GOCMD) run ./tools/image/main.go -daemon -lifecyclePath $(ARCHIVE_PATH) -os freebsd -arch amd64 -tag lifecycle:$(LIFECYCLE_IMAGE_TAG)

build-linux-amd64-lifecycle: $(BUILD_DIR)/linux-amd64/lifecycle/lifecycle

build-linux-arm64-lifecycle: $(BUILD_DIR)/linux-arm64/lifecycle/lifecycle

build-linux-s390x-lifecycle: $(BUILD_DIR)/linux-s390x/lifecycle/lifecycle

build-freebsd-amd64-lifecycle: $(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle

$(BUILD_DIR)/linux-amd64/lifecycle/lifecycle: export GOOS:=linux
$(BUILD_DIR)/linux-amd64/lifecycle/lifecycle: export GOARCH:=amd64
$(BUILD_DIR)/linux-amd64/lifecycle/lifecycle: OUT_DIR?=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
Expand Down Expand Up @@ -99,6 +107,15 @@ $(BUILD_DIR)/linux-s390x/lifecycle/lifecycle:
mkdir -p $(OUT_DIR)
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/lifecycle -a ./cmd/lifecycle

$(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle: export GOOS:=freebsd
$(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle: export GOARCH:=amd64
$(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle: OUT_DIR?=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
$(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle: $(GOFILES)
$(BUILD_DIR)/freebsd-amd64/lifecycle/lifecycle:
@echo "> Building lifecycle/lifecycle for $(GOOS)/$(GOARCH)..."
mkdir -p $(OUT_DIR)
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/lifecycle -a ./cmd/lifecycle

build-linux-amd64-launcher: $(BUILD_DIR)/linux-amd64/lifecycle/launcher

$(BUILD_DIR)/linux-amd64/lifecycle/launcher: export GOOS:=linux
Expand Down Expand Up @@ -135,6 +152,18 @@ $(BUILD_DIR)/linux-s390x/lifecycle/launcher:
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/launcher -a ./cmd/launcher
test $$(du -m $(OUT_DIR)/launcher|cut -f 1) -le 3

build-freebsd-amd64-launcher: $(BUILD_DIR)/freebsd-amd64/lifecycle/launcher

$(BUILD_DIR)/freebsd-amd64/lifecycle/launcher: export GOOS:=freebsd
$(BUILD_DIR)/freebsd-amd64/lifecycle/launcher: export GOARCH:=amd64
$(BUILD_DIR)/freebsd-amd64/lifecycle/launcher: OUT_DIR?=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
$(BUILD_DIR)/freebsd-amd64/lifecycle/launcher: $(GOFILES)
$(BUILD_DIR)/freebsd-amd64/lifecycle/launcher:
@echo "> Building lifecycle/launcher for $(GOOS)/$(GOARCH)..."
mkdir -p $(OUT_DIR)
$(GOENV) $(GOBUILD) -o $(OUT_DIR)/launcher -a ./cmd/launcher
test $$(du -m $(OUT_DIR)/launcher|cut -f 1) -le 3

build-linux-amd64-symlinks: export GOOS:=linux
build-linux-amd64-symlinks: export GOARCH:=amd64
build-linux-amd64-symlinks: OUT_DIR?=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
Expand Down Expand Up @@ -177,6 +206,20 @@ build-linux-s390x-symlinks:
ln -sf lifecycle $(OUT_DIR)/creator
ln -sf lifecycle $(OUT_DIR)/extender

build-freebsd-amd64-symlinks: export GOOS:=freebsd
build-freebsd-amd64-symlinks: export GOARCH:=amd64
build-freebsd-amd64-symlinks: OUT_DIR?=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle
build-freebsd-amd64-symlinks:
@echo "> Creating phase symlinks for $(GOOS)/$(GOARCH)..."
ln -sf lifecycle $(OUT_DIR)/detector
ln -sf lifecycle $(OUT_DIR)/analyzer
ln -sf lifecycle $(OUT_DIR)/restorer
ln -sf lifecycle $(OUT_DIR)/builder
ln -sf lifecycle $(OUT_DIR)/exporter
ln -sf lifecycle $(OUT_DIR)/rebaser
ln -sf lifecycle $(OUT_DIR)/creator
ln -sf lifecycle $(OUT_DIR)/extender

build-windows-amd64-lifecycle: $(BUILD_DIR)/windows-amd64/lifecycle/lifecycle.exe

$(BUILD_DIR)/windows-amd64/lifecycle/lifecycle.exe: export GOOS:=windows
Expand Down Expand Up @@ -288,6 +331,14 @@ run-syft-linux-s390x:
syft $(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle -o json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.syft.json -o spdx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.spdx.json -o cyclonedx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.cdx.json
syft $(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher -o json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.syft.json -o spdx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.spdx.json -o cyclonedx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.cdx.json

run-syft-freebsd-amd64: install-syft
run-syft-freebsd-amd64: export GOOS:=freebsd
run-syft-freebsd-amd64: export GOARCH:=amd64
run-syft-freebsd-amd64:
@echo "> Running syft..."
syft $(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle -o json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.syft.json -o spdx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.spdx.json -o cyclonedx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/lifecycle.sbom.cdx.json
syft $(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher -o json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.syft.json -o spdx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.spdx.json -o cyclonedx-json=$(BUILD_DIR)/$(GOOS)-$(GOARCH)/lifecycle/launcher.sbom.cdx.json

install-syft:
@echo "> Installing syft..."
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
Expand Down Expand Up @@ -335,7 +386,7 @@ unit: out
unit: UNIT_PACKAGES=$(shell $(GOCMD) list ./... | grep -v acceptance)
unit: format lint tidy install-yj
@echo "> Running unit tests..."
$(GOTEST) $(GOTESTFLAGS) -v -count=1 $(UNIT_PACKAGES)
$(GOTEST) $(GOTESTFLAGS) -count=1 $(UNIT_PACKAGES) -v

out:
@mkdir out || (exit 0)
Expand All @@ -349,7 +400,7 @@ clean:
@echo "> Cleaning workspace..."
rm -rf $(BUILD_DIR)

package: generate-sbom package-linux-amd64 package-linux-arm64 package-windows-amd64 package-linux-s390x
package: generate-sbom package-linux-amd64 package-linux-arm64 package-windows-amd64 package-linux-s390x package-freebsd-amd64

package-linux-amd64: GOOS:=linux
package-linux-amd64: GOARCH:=amd64
Expand Down Expand Up @@ -378,6 +429,15 @@ package-linux-s390x:
@echo "> Packaging lifecycle for $(GOOS)/$(GOARCH)..."
$(GOCMD) run $(PACKAGER) --inputDir $(INPUT_DIR) -archivePath $(ARCHIVE_PATH) -descriptorPath $(LIFECYCLE_DESCRIPTOR_PATH) -version $(LIFECYCLE_VERSION)

package-freebsd-amd64: GOOS:=freebsd
package-freebsd-amd64: GOARCH:=amd64
package-freebsd-amd64: INPUT_DIR:=$(BUILD_DIR)$/$(GOOS)-$(GOARCH)$/lifecycle
package-freebsd-amd64: ARCHIVE_PATH=$(BUILD_DIR)$/lifecycle-v$(LIFECYCLE_VERSION)+$(GOOS).x86-64.tgz
package-freebsd-amd64: PACKAGER=.$/tools$/packager$/main.go
package-freebsd-amd64:
@echo "> Packaging lifecycle for $(GOOS)/$(GOARCH)..."
$(GOCMD) run $(PACKAGER) --inputDir $(INPUT_DIR) -archivePath $(ARCHIVE_PATH) -descriptorPath $(LIFECYCLE_DESCRIPTOR_PATH) -version $(LIFECYCLE_VERSION)

package-windows-amd64: GOOS:=windows
package-windows-amd64: GOARCH:=amd64
package-windows-amd64: INPUT_DIR:=$(BUILD_DIR)$/$(GOOS)-$(GOARCH)$/lifecycle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

echo "Hello Extensions buildpack"

Expand Down
4 changes: 2 additions & 2 deletions acceptance/testdata/launcher/exec.d/fd_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin
// +build linux darwin
//go:build linux || darwin || freebsd
// +build linux darwin freebsd

package main

Expand Down
4 changes: 2 additions & 2 deletions acceptance/variables_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin
// +build linux darwin
//go:build linux || darwin || freebsd
// +build linux darwin freebsd

package acceptance

Expand Down
4 changes: 2 additions & 2 deletions archive/tar_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin
// +build linux darwin
//go:build linux || darwin || freebsd
// +build linux darwin freebsd

package archive

Expand Down
2 changes: 1 addition & 1 deletion buildpack/testdata/buildpack/bin/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion buildpack/testdata/buildpack/bin/detect
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion buildpack/testdata/extension/bin/detect
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion buildpack/testdata/extension/bin/generate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build darwin
//go:build darwin || freebsd

package kaniko

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux || freebsd
// +build linux freebsd

package fsutil_test

Expand Down
4 changes: 2 additions & 2 deletions internal/path/defaults_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux || darwin
// +build linux darwin
//go:build linux || darwin || freebsd
// +build linux darwin freebsd

package path

Expand Down
8 changes: 7 additions & 1 deletion launch/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package launch
import (
"fmt"

"runtime"

"github.com/pkg/errors"
)

Expand Down Expand Up @@ -32,7 +34,11 @@ func (b *BashShell) Launch(proc ShellProcess) error {
bashCommand = bashCommandWithTokens(len(proc.Args) + 1)
}
launcher += bashCommand
if err := b.Exec("/bin/bash", append([]string{
bashPath := "/bin/bash"
if runtime.GOOS == "freebsd" {
bashPath = "/usr/local/bin/bash"
}
if err := b.Exec(bashPath, append([]string{
"bash", "-c",
launcher, proc.Caller, proc.Command,
}, proc.Args...), proc.Env); err != nil {
Expand Down
Loading