diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 414de64..6b10f09 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -13,7 +13,9 @@ permissions: jobs: bin-releaser: name: Release Binaries - runs-on: ubuntu-latest + # The darwin builds need cgo (see .goreleaser.yaml), so they must be + # built on a mac; the cgo-free linux builds cross-compile fine from here. + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v7 @@ -22,7 +24,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version-file: go.mod - name: Release Binaries uses: goreleaser/goreleaser-action@v7 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 24b38a7..9bcb095 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -2,8 +2,11 @@ version: 2 project_name: piri +# The linux binaries are pure-Go cross-compiles, so the whole release can run +# on a macOS runner; darwin needs cgo (gosigar, via curio→lotus, has no +# pure-Go path on darwin) and therefore cannot be cross-compiled from linux. builds: - - id: piri + - id: piri-linux main: ./cmd binary: piri ldflags: @@ -12,17 +15,36 @@ builds: - -s -w -X github.com/fil-forge/piri/pkg/build.version=v{{.Version}} -X github.com/fil-forge/piri/pkg/build.Commit={{.Commit}} -X github.com/fil-forge/piri/pkg/build.Date={{.CommitDate}} -X github.com/fil-forge/piri/pkg/build.BuiltBy=goreleaser goos: - linux - - darwin goarch: - 'amd64' - 'arm64' # Change to a static date for checksum verification. See https://goreleaser.com/customization/builds/#reproducible-builds. mod_timestamp: '{{.CommitTimestamp}}' + # Curio's FFI-free variants — matches the Makefile build (see its TAGS comment). + flags: + - '-tags=skiff' env: - CGO_ENABLED=0 + - id: piri-darwin + main: ./cmd + binary: piri + ldflags: + - -s -w -X github.com/fil-forge/piri/pkg/build.version=v{{.Version}} -X github.com/fil-forge/piri/pkg/build.Commit={{.Commit}} -X github.com/fil-forge/piri/pkg/build.Date={{.CommitDate}} -X github.com/fil-forge/piri/pkg/build.BuiltBy=goreleaser + goos: + - darwin + goarch: + - 'amd64' + - 'arm64' + mod_timestamp: '{{.CommitTimestamp}}' + flags: + - '-tags=skiff' + env: + - CGO_ENABLED=1 universal_binaries: - - replace: true + - ids: + - piri-darwin + replace: true archives: - format_overrides: diff --git a/Makefile b/Makefile index 26bc9ce..4da3052 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,13 @@ GOFLAGS=-ldflags="-X github.com/fil-forge/piri/pkg/build.version=$(VERSION) -X g # and the only other network-gated constant Piri's paths touch (BlockGasLimit) # is network-invariant. Verified by the smelt proving-loop e2e on a skiff-only binary. TAGS?=-tags "skiff" +# gosigar (via curio→lotus) has a pure-Go path on linux but needs cgo on darwin. +# Default to CGO-free builds on non-darwin platforms; override with CGO_ENABLED=1 if needed. +ifeq ($(shell uname -s),Darwin) +CGO_ENABLED?=1 +else +CGO_ENABLED?=0 +endif .PHONY: all build test clean @@ -24,13 +31,13 @@ piri: FORCE @if [ ! -f piri ] || \ [ -n "$$(find cmd pkg internal -name '*.go' -type f -newer piri 2>/dev/null)" ]; then \ echo "Building piri..."; \ - CGO_ENABLED=0 go build $(GOFLAGS) $(TAGS) -o ./piri github.com/fil-forge/piri/cmd; \ + CGO_ENABLED=$(CGO_ENABLED) go build $(GOFLAGS) $(TAGS) -o ./piri github.com/fil-forge/piri/cmd; \ fi FORCE: test: - CGO_ENABLED=0 go test $(TAGS) ./... + CGO_ENABLED=$(CGO_ENABLED) go test $(TAGS) ./... clean: rm -f ./piri \ No newline at end of file diff --git a/go.mod b/go.mod index ae37b9f..5e0bfb0 100644 --- a/go.mod +++ b/go.mod @@ -9,12 +9,12 @@ require ( github.com/deckarep/golang-set/v2 v2.9.0 github.com/docker/docker v28.5.2+incompatible github.com/ethereum/go-ethereum v1.17.5 - github.com/fil-forge/delegator v0.0.0-20260619085531-c96197bec34c + github.com/fil-forge/delegator v0.0.0-20260814010356-6b1794dbbab9 github.com/fil-forge/filecoin-services/go v0.0.0-20260507172456-36ebe4467390 - github.com/fil-forge/go-ipni-tools v0.0.0-20260519194815-545b9421aec0 - github.com/fil-forge/libforge v0.0.0-20260730113809-b13386bc395a - github.com/fil-forge/piri-signing-service v0.0.0-20260619151844-6c3d40a4bf54 - github.com/fil-forge/ucantone v0.0.0-20260727203046-ccb77059de44 + github.com/fil-forge/go-ipni-tools v0.0.0-20260820094424-9b93692d1895 + github.com/fil-forge/libforge v0.0.0-20260807225550-3e6895b41be5 + github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899 + github.com/fil-forge/ucantone v0.0.0-20260817170631-3a20cd59fabc github.com/filecoin-project/curio v1.28.3-0.20260717015646-38ca280c43a2 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20240802040721-2a04ffc8ffe8 github.com/filecoin-project/go-commp-utils/v2 v2.1.0 diff --git a/go.sum b/go.sum index 3f1ed29..e0fbead 100644 --- a/go.sum +++ b/go.sum @@ -544,20 +544,20 @@ github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeO github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= -github.com/fil-forge/delegator v0.0.0-20260619085531-c96197bec34c h1:YhtqnvFK7HqbZ4rzZrpm9wO8a9674C8HStWknoSi5UM= -github.com/fil-forge/delegator v0.0.0-20260619085531-c96197bec34c/go.mod h1:Mkd7wcTvxuWzfVwgRIx/xfnwMZM9Hrd7+p6N1dgI0no= +github.com/fil-forge/delegator v0.0.0-20260814010356-6b1794dbbab9 h1:3fJu3pXa3WBAjfWpFynu0o+Av8FQeELrd1yW58hMdFI= +github.com/fil-forge/delegator v0.0.0-20260814010356-6b1794dbbab9/go.mod h1:ujU9zx+XbebCDsRJqO/2E1qV+c6RIybXbHLnQiCrRNM= github.com/fil-forge/filecoin-services/go v0.0.0-20260507172456-36ebe4467390 h1:h7SZVboCO1iPDtdxPJjs1fj4IVFq/dpDWFevkXtwgps= github.com/fil-forge/filecoin-services/go v0.0.0-20260507172456-36ebe4467390/go.mod h1:ur5fRrG8v9twwwRFdX7lquGza4liT6x/xAFW7T4XVIc= -github.com/fil-forge/go-ipni-tools v0.0.0-20260519194815-545b9421aec0 h1:HAfXUPvtPjK9UAzofbDSzW0mSXsbubMtIFCEh0SJ2ow= -github.com/fil-forge/go-ipni-tools v0.0.0-20260519194815-545b9421aec0/go.mod h1:3NRV/7wc4/0uzzrGdI7NoN/yeF1UvqKRwMyjBqGc5s0= +github.com/fil-forge/go-ipni-tools v0.0.0-20260820094424-9b93692d1895 h1:xO7BgzrPWbBAFeIKD9EGfOWGPxX6phGHcySSepLLo1U= +github.com/fil-forge/go-ipni-tools v0.0.0-20260820094424-9b93692d1895/go.mod h1:kJuOyZgOlRPaiYd3s/U8D5xnJ5FRdkH+vzdSuzTK+2I= github.com/fil-forge/go-ucanto v0.0.0-20260507172450-5cb5d073f8ab h1:2J2cDThqTKP6/0k3SfdlSxfyPa3aLqjTYnmvbEcryfg= github.com/fil-forge/go-ucanto v0.0.0-20260507172450-5cb5d073f8ab/go.mod h1:lZF3UXZ2hGLKYmXdquG50JqI9pRlUrV6lubGtgOYfwc= -github.com/fil-forge/libforge v0.0.0-20260730113809-b13386bc395a h1:voLQ76lKOQNRg7F+Aah2y0rN67jpDjFsiFMSpxE1Yf4= -github.com/fil-forge/libforge v0.0.0-20260730113809-b13386bc395a/go.mod h1:0kXihIQ4L2uZ00nR5XrZ/Y8Db7Ht/qQNuiWslwMJ95M= -github.com/fil-forge/piri-signing-service v0.0.0-20260619151844-6c3d40a4bf54 h1:KzQzCcEBBF6AfhZOwbQIPh5W2HwCgLS8VFTmch0oMgo= -github.com/fil-forge/piri-signing-service v0.0.0-20260619151844-6c3d40a4bf54/go.mod h1:O3GqUy+G7hb+oiGW6Wp77W2lRmZs7bewM9s/Vy4D6qo= -github.com/fil-forge/ucantone v0.0.0-20260727203046-ccb77059de44 h1:ofvb2Qq7++VPRelGsLbtnd1ZMKVT4n4QGoa79BhJ6VQ= -github.com/fil-forge/ucantone v0.0.0-20260727203046-ccb77059de44/go.mod h1:oFY5BfD0bDeodGlbBHh3/nK99MAS93rGXjoQz7s5qgE= +github.com/fil-forge/libforge v0.0.0-20260807225550-3e6895b41be5 h1:Pu7Xk/LdaQyv1560k1MbL6CQUdWxZJIG9elEE0vkgLY= +github.com/fil-forge/libforge v0.0.0-20260807225550-3e6895b41be5/go.mod h1:aL/KcXZ0KVs1ymAYqIwQyCnl2p481InN+gYbRLNM8fI= +github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899 h1:5dV7QmNHHA5JZLIGikLJJsmB/sdmqzyTgr75ivInfVY= +github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899/go.mod h1:6Xzvs1sZrikN3GygCV2I96dnbzy1xuCtitPMme/TjZU= +github.com/fil-forge/ucantone v0.0.0-20260817170631-3a20cd59fabc h1:s6QNgj3hWY2neeAWyq2FckpQoTaRZhK2utgLkauGsqA= +github.com/fil-forge/ucantone v0.0.0-20260817170631-3a20cd59fabc/go.mod h1:uhSFN3BGtWpnIF47b1svijEa6wBmCM6JJArAG14MYh4= github.com/filecoin-project/curio v1.28.3-0.20260717015646-38ca280c43a2 h1:Abzcl/chtWOahrGeF/+q0phHl+iOZpfMNp28mr5NFEY= github.com/filecoin-project/curio v1.28.3-0.20260717015646-38ca280c43a2/go.mod h1:Sd4Ok8KKpt9JyUOh2kL0skv/ccXdEbeGT/eJ2tMJ3Uk= github.com/filecoin-project/filecoin-ffi v1.36.1 h1:SCN0ue1bn6cSIMiYkhWnDfA1fHttKBkNWJutVkB2eR4=