Skip to content

Add ghcr.io/gorelease-cross docker to cross-compile binaries#66

Merged
cortze merged 1 commit into
mainfrom
fix/broken-gorelease-cross
May 8, 2024
Merged

Add ghcr.io/gorelease-cross docker to cross-compile binaries#66
cortze merged 1 commit into
mainfrom
fix/broken-gorelease-cross

Conversation

@cortze
Copy link
Copy Markdown
Collaborator

@cortze cortze commented May 8, 2024

Description

The compilation of Nebula requires some CGO dependencies, which heavily complicate the cross-compilation efforts. This PR aims to solve #60 using the Docker images provided by goreleaser/goreleaser-cross

NOTE: Super important to rely on the ghcr.io/gorelease-cross images, as there are some C libs missing at the DockerHub images. :(

Proof of Success

The compilation works fine locally (with the listed GOOS and GOARCH) when running:

docker run --rm \
    -v ./:/workspace \
    -w /workspace \
    -v /var/run/docker.sock:/var/run/docker.sock \
    ghcr.io/goreleaser/goreleaser-cross:v1.19.6 build --snapshot --clean --config .goreleaser.yaml

which reports:

  • starting build...
  • loading config file                              file=.goreleaser.yaml
  • loading environment variables
  • getting and validating git state
    • building...                                    commit=a38f2d58da9ea1b7f093c5719db3420ad27d9867 latest tag=2.2.1
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • running before hooks
    • running                                        hook=go mod tidy
    • running                                        hook=go run ./cmd/prefix/gen.go
    • took: 17s
  • snapshotting
    • building snapshot...                           version=2.2.1-SNAPSHOT-a38f2d5
  • checking distribution directory
    • cleaning dist
  • loading go mod information
  • build prerequisites
  • writing effective config file
    • writing                                        config=dist/config.yaml
  • building binaries
    • building                                       binary=dist/darwin-arm64_darwin_arm64/nebula-darwin-arm64
    • building                                       binary=dist/darwin-amd64_darwin_amd64_v1/nebula-darwin-amd64
    • building                                       binary=dist/linux-arm64_linux_arm64/nebula-linux-arm64
    • building                                       binary=dist/linux-amd64_linux_amd64_v1/nebula-linux-amd64
    • building                                       binary=dist/windows-amd64_windows_amd64_v1/nebula-win-amd64.exe
    • took: 3m32s
  • storing release metadata
    • writing                                        file=dist/artifacts.json
    • writing                                        file=dist/metadata.json
  • build succeeded after 3m49s

Just hoping that there is nothing broken at the GitHub Actions integration (fingerscrossed)

Sorry for the spam @dennis-tra , Let me know if there is anything easier/less spammer to try out the github-actions integrations :(

@cortze cortze merged commit 69316c1 into main May 8, 2024
@cortze cortze deleted the fix/broken-gorelease-cross branch May 8, 2024 15:05
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 this pull request may close these issues.

1 participant