diff --git a/.github/build-platforms.yml b/.github/build-platforms.yml new file mode 100644 index 000000000..456489e60 --- /dev/null +++ b/.github/build-platforms.yml @@ -0,0 +1,17 @@ +# Build platforms configuration for Kubo +# Matches https://github.com/ipfs/distributions/blob/master/dists/kubo/build_matrix +# plus linux-riscv64 for emerging architecture support +# +# The Go compiler handles FUSE support automatically via build tags. +# Platforms are simply listed - no need to specify FUSE capability. + +platforms: + - darwin-amd64 + - darwin-arm64 + - freebsd-amd64 + - linux-amd64 + - linux-arm64 + - linux-riscv64 + - openbsd-amd64 + - windows-amd64 + - windows-arm64 \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b8ed94911..f6fd1cfbe 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - go-version: 1.25.x + go-version-file: 'go.mod' # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/gateway-conformance.yml b/.github/workflows/gateway-conformance.yml index e572a706f..3518afad7 100644 --- a/.github/workflows/gateway-conformance.yml +++ b/.github/workflows/gateway-conformance.yml @@ -46,17 +46,16 @@ jobs: output: fixtures # 2. Build the kubo-gateway - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version: 1.25.x - - uses: protocol/cache-go-action@v1 - with: - name: ${{ github.job }} - name: Checkout kubo-gateway uses: actions/checkout@v5 with: path: kubo-gateway + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: 'kubo-gateway/go.mod' + cache: true + cache-dependency-path: kubo-gateway/go.sum - name: Build kubo-gateway run: make build working-directory: kubo-gateway @@ -133,17 +132,16 @@ jobs: output: fixtures # 2. Build the kubo-gateway - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version: 1.25.x - - uses: protocol/cache-go-action@v1 - with: - name: ${{ github.job }} - name: Checkout kubo-gateway uses: actions/checkout@v5 with: path: kubo-gateway + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: 'kubo-gateway/go.mod' + cache: true + cache-dependency-path: kubo-gateway/go.sum - name: Build kubo-gateway run: make build working-directory: kubo-gateway diff --git a/.github/workflows/gobuild.yml b/.github/workflows/gobuild.yml index 6799cb314..d3acffdd2 100644 --- a/.github/workflows/gobuild.yml +++ b/.github/workflows/gobuild.yml @@ -21,20 +21,38 @@ jobs: env: TEST_DOCKER: 0 TEST_VERBOSE: 1 - TRAVIS: 1 GIT_PAGER: cat IPFS_CHECK_RCMGR_DEFAULTS: 1 defaults: run: shell: bash steps: + - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: - go-version: 1.25.x - - uses: actions/checkout@v5 - - run: make cmd/ipfs-try-build - env: - TEST_FUSE: 1 - - run: make cmd/ipfs-try-build - env: - TEST_FUSE: 0 + go-version-file: 'go.mod' + cache: true + cache-dependency-path: go.sum + + - name: Build all platforms + run: | + # Read platforms from build-platforms.yml and build each one + echo "Building kubo for all platforms..." + + # Read and build each platform + grep '^ - ' .github/build-platforms.yml | sed 's/^ - //' | while read -r platform; do + if [ -z "$platform" ]; then + continue + fi + + echo "::group::Building $platform" + GOOS=$(echo "$platform" | cut -d- -f1) + GOARCH=$(echo "$platform" | cut -d- -f2) + + echo "Building $platform" + echo " GOOS=$GOOS GOARCH=$GOARCH go build -o /dev/null ./cmd/ipfs" + GOOS=$GOOS GOARCH=$GOARCH go build -o /dev/null ./cmd/ipfs + echo "::endgroup::" + done + + echo "All platforms built successfully" \ No newline at end of file diff --git a/.github/workflows/golang-analysis.yml b/.github/workflows/golang-analysis.yml index 8a01c06db..676f23a4d 100644 --- a/.github/workflows/golang-analysis.yml +++ b/.github/workflows/golang-analysis.yml @@ -27,7 +27,7 @@ jobs: submodules: recursive - uses: actions/setup-go@v6 with: - go-version: "1.25.x" + go-version-file: 'go.mod' - name: Check that go.mod is tidy uses: protocol/multiple-go-modules@v1.4 with: diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml index aa6a4b84f..0bee5a5cb 100644 --- a/.github/workflows/golint.yml +++ b/.github/workflows/golint.yml @@ -22,15 +22,14 @@ jobs: TEST_DOCKER: 0 TEST_FUSE: 0 TEST_VERBOSE: 1 - TRAVIS: 1 GIT_PAGER: cat IPFS_CHECK_RCMGR_DEFAULTS: 1 defaults: run: shell: bash steps: + - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: - go-version: 1.25.x - - uses: actions/checkout@v5 + go-version-file: 'go.mod' - run: make -O test_go_lint diff --git a/.github/workflows/gotest.yml b/.github/workflows/gotest.yml index 11150f383..f08fcaac4 100644 --- a/.github/workflows/gotest.yml +++ b/.github/workflows/gotest.yml @@ -22,19 +22,18 @@ jobs: TEST_DOCKER: 0 TEST_FUSE: 0 TEST_VERBOSE: 1 - TRAVIS: 1 GIT_PAGER: cat IPFS_CHECK_RCMGR_DEFAULTS: 1 defaults: run: shell: bash steps: + - name: Check out Kubo + uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v6 with: - go-version: 1.25.x - - name: Check out Kubo - uses: actions/checkout@v5 + go-version-file: 'go.mod' - name: Install missing tools run: sudo apt update && sudo apt install -y zsh - name: 👉️ If this step failed, go to «Summary» (top left) → inspect the «Failures/Errors» table diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index ea2df3e47..d0f3b9a79 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -9,9 +9,6 @@ on: branches: - 'master' -env: - GO_VERSION: 1.25.x - concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} cancel-in-progress: true @@ -29,17 +26,16 @@ jobs: TEST_DOCKER: 0 TEST_FUSE: 0 TEST_VERBOSE: 1 - TRAVIS: 1 GIT_PAGER: cat IPFS_CHECK_RCMGR_DEFAULTS: 1 defaults: run: shell: bash steps: + - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v5 + go-version-file: 'go.mod' - run: make build - uses: actions/upload-artifact@v4 with: @@ -82,7 +78,6 @@ jobs: LIBP2P_TCP_REUSEPORT: false LIBP2P_ALLOW_WEAK_RSA_KEYS: 1 E2E_IPFSD_TYPE: go - TRAVIS: 1 GIT_PAGER: cat IPFS_CHECK_RCMGR_DEFAULTS: 1 defaults: diff --git a/.github/workflows/sharness.yml b/.github/workflows/sharness.yml index ae202e3a3..8c0c39130 100644 --- a/.github/workflows/sharness.yml +++ b/.github/workflows/sharness.yml @@ -22,14 +22,14 @@ jobs: run: shell: bash steps: - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version: 1.25.x - name: Checkout Kubo uses: actions/checkout@v5 with: path: kubo + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: 'kubo/go.mod' - name: Install missing tools run: sudo apt update && sudo apt install -y socat net-tools fish libxml2-utils - uses: actions/cache@v4 diff --git a/Rules.mk b/Rules.mk index ef88bee0f..d8f16ada8 100644 --- a/Rules.mk +++ b/Rules.mk @@ -107,8 +107,8 @@ uninstall: .PHONY: uninstall supported: - @echo "Currently supported platforms:" - @for p in ${SUPPORTED_PLATFORMS}; do echo $$p; done + @echo "Currently supported platforms (from .github/build-platforms.yml):" + @grep '^ - ' .github/build-platforms.yml | sed 's/^ - //' || (echo "Error: .github/build-platforms.yml not found"; exit 1) .PHONY: supported help: @@ -138,7 +138,8 @@ help: @echo ' test_short - Run short go tests and short sharness tests' @echo ' test_go_short - Run short go tests' @echo ' test_go_test - Run all go tests' - @echo ' test_go_expensive - Run all go tests and compile on all platforms' + @echo ' test_go_build - Build kubo for all platforms from .github/build-platforms.yml' + @echo ' test_go_expensive - Run all go tests and build all platforms' @echo ' test_go_race - Run go tests with the race detector enabled' @echo ' test_go_lint - Run the `golangci-lint` vetting tool' @echo ' test_sharness - Run sharness tests' diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5f2907d00..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,49 +0,0 @@ -# Notes: -# - Minimal appveyor.yml file is an empty file. All sections are optional. -# - Indent each level of configuration with 2 spaces. Do not use tabs! -# - All section names are case-sensitive. -# - Section names should be unique on each level. - -version: "{build}" - -os: Windows Server 2012 R2 - -clone_folder: c:\gopath\src\github.com\ipfs\go-ipfs - -environment: - GOPATH: c:\gopath - TEST_VERBOSE: 1 - #TEST_NO_FUSE: 1 - #TEST_SUITE: test_sharness - #GOFLAGS: -tags nofuse - global: - BASH: C:\cygwin\bin\bash - matrix: - - GOARCH: amd64 - GOVERSION: 1.5.1 - GOROOT: c:\go - DOWNLOADPLATFORM: "x64" - -install: - # Enable make - #- SET PATH=c:\MinGW\bin;%PATH% - #- copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe - - go version - - go env - -# Cygwin build script -# -# NOTES: -# -# The stdin/stdout file descriptor appears not to be valid for the Appveyor -# build which causes failures as certain functions attempt to redirect -# default file handles. Ensure a dummy file descriptor is opened with 'exec'. -# -build_script: - - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0/dev/null; echo $$?),0) -SUPPORTED_PLATFORMS += darwin-arm64 -endif -SUPPORTED_PLATFORMS += freebsd-386 -SUPPORTED_PLATFORMS += freebsd-amd64 - -SUPPORTED_PLATFORMS += openbsd-386 -SUPPORTED_PLATFORMS += openbsd-amd64 - -SUPPORTED_PLATFORMS += netbsd-386 -SUPPORTED_PLATFORMS += netbsd-amd64 +# Platforms are now defined in .github/build-platforms.yml +# The cmd/ipfs-try-build target is deprecated in favor of GitHub Actions +# Use 'make supported' to see the list of platforms space:=$() $() comma:=, diff --git a/plugin/loader/load_nocgo.go b/plugin/loader/load_nocgo.go index 9de31a9eb..3e0f39337 100644 --- a/plugin/loader/load_nocgo.go +++ b/plugin/loader/load_nocgo.go @@ -1,7 +1,4 @@ //go:build !cgo && !noplugin && (linux || darwin || freebsd) -// +build !cgo -// +build !noplugin -// +build linux darwin freebsd package loader diff --git a/plugin/loader/load_noplugin.go b/plugin/loader/load_noplugin.go index fc56b16a0..dddeac91d 100644 --- a/plugin/loader/load_noplugin.go +++ b/plugin/loader/load_noplugin.go @@ -1,5 +1,4 @@ //go:build noplugin -// +build noplugin package loader diff --git a/plugin/loader/load_unix.go b/plugin/loader/load_unix.go index 4a5dccb40..05af30197 100644 --- a/plugin/loader/load_unix.go +++ b/plugin/loader/load_unix.go @@ -1,7 +1,4 @@ //go:build cgo && !noplugin && (linux || darwin || freebsd) -// +build cgo -// +build !noplugin -// +build linux darwin freebsd package loader diff --git a/test/dependencies/dependencies.go b/test/dependencies/dependencies.go index 88c8ed7fc..848ffba2f 100644 --- a/test/dependencies/dependencies.go +++ b/test/dependencies/dependencies.go @@ -1,5 +1,4 @@ //go:build tools -// +build tools package tools