From fd4834ddb05320ca8f1046132188bae3aefeaa35 Mon Sep 17 00:00:00 2001 From: platinummonkey Date: Wed, 29 Apr 2026 11:30:37 -0500 Subject: [PATCH 1/4] ci: migrate from CircleCI to GitHub Actions Replaces .circleci/config.yml with .github/workflows/ci.yml. Preserves the original 9 CircleCI jobs: - golang-{1.24,1.25,1.26} (matrix) - golang-{1.24,1.25,1.26}-external-libzstd (matrix) - golang-efence - golang-efence-external-libzstd - golang-i386 (runs travis_test_32.sh inside 32bit/ubuntu:16.04) All third-party actions are pinned to commit SHAs: - actions/checkout@de0fac2e (v6.0.2) - actions/setup-go@4a360112 (v6.4.0) Note: the efence jobs were previously resource_class: xlarge on CircleCI; they now run on the default ubuntu-latest runner. Required status-check names will need to be re-pinned in branch protection. Co-Authored-By: Claude Opus 4.7 (1M context) --- .circleci/config.yml | 111 --------------------------------------- .github/workflows/ci.yml | 103 ++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 111 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b351548..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: 2 - -jobs: - "golang-1.24": - docker: - - image: cimg/go:1.24 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.24-external-libzstd": - docker: - - image: cimg/go:1.24 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.25": - docker: - - image: cimg/go:1.25 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.25-external-libzstd": - docker: - - image: cimg/go:1.25 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.26": - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-1.26-external-libzstd": - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr go test -v' - - run: 'PAYLOAD=`pwd`/mr go test -bench .' - "golang-efence": - resource_class: xlarge - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build' - - run: 'PAYLOAD=`pwd`/mr GODEBUG=efence=1 go test -v' - "golang-efence-external-libzstd": - resource_class: xlarge - docker: - - image: cimg/go:1.26 - steps: - - checkout - - run: 'sudo apt update' - - run: 'sudo apt install libzstd-dev' - - run: 'wget https://github.com/DataDog/zstd/files/2246767/mr.zip' - - run: 'unzip mr.zip' - - run: 'go build -tags external_libzstd' - - run: 'PAYLOAD=`pwd`/mr GODEBUG=efence=1 go test -tags external_libzstd -v' - "golang-i386": - docker: - - image: 32bit/ubuntu:16.04 - steps: - - checkout - - run: 'linux32 --32bit i386 ./travis_test_32.sh' - -workflows: - version: 2 - build: - jobs: - - "golang-1.24" - - "golang-1.24-external-libzstd" - - "golang-1.25" - - "golang-1.25-external-libzstd" - - "golang-1.26" - - "golang-1.26-external-libzstd" - - "golang-efence" - - "golang-efence-external-libzstd" - - "golang-i386" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d977750 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,103 @@ +name: CI + +on: + push: + branches: [main, "1.x"] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build-test: + name: golang-${{ matrix.go-version }}${{ matrix.external-libzstd && '-external-libzstd' || '' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: ["1.24", "1.25", "1.26"] + external-libzstd: [false, true] + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: ${{ matrix.go-version }} + - name: Install libzstd-dev + if: ${{ matrix.external-libzstd }} + run: sudo apt-get update && sudo apt-get install -y libzstd-dev + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build + - name: Test + run: PAYLOAD="$(pwd)/mr" go test -v + - name: Bench + run: PAYLOAD="$(pwd)/mr" go test -bench . + + efence: + name: golang-efence + # CircleCI ran this on resource_class: xlarge (8 vCPU). GitHub-hosted + # ubuntu-latest is 4 vCPU / 16 GB; if memory pressure or runtime becomes + # an issue under GODEBUG=efence=1, switch to a larger runner label. + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build + - name: Test (efence) + env: + GODEBUG: efence=1 + run: PAYLOAD="$(pwd)/mr" go test -v + + efence-external-libzstd: + name: golang-efence-external-libzstd + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Install libzstd-dev + run: sudo apt-get update && sudo apt-get install -y libzstd-dev + - name: Download payload + run: | + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build + run: go build -tags external_libzstd + - name: Test (efence) + env: + GODEBUG: efence=1 + run: PAYLOAD="$(pwd)/mr" go test -tags external_libzstd -v + + i386: + name: golang-i386 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run 32-bit tests + run: | + docker run --rm \ + -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ + 32bit/ubuntu:16.04 \ + linux32 --32bit i386 bash ./travis_test_32.sh From f3b091bd08a0fe3a9be99fb319876226af2cd959 Mon Sep 17 00:00:00 2001 From: platinummonkey Date: Wed, 29 Apr 2026 11:41:08 -0500 Subject: [PATCH 2/4] ci(i386): disable ASLR via linux32 -R to fix flaky SIGSEGV The 32-bit job intermittently crashed with SIGSEGV in a libzstd cgo call on the GitHub-hosted runner. Modern host kernels randomize the 32-bit address layout differently than the older CircleCI host did, occasionally placing libzstd's allocations at addresses the legacy 3 GB user-space split doesn't expect. Passing -R (ADDR_NO_RANDOMIZE) to linux32 makes the layout deterministic; the flag inherits across fork/exec to the bash script and the Go test binary. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d977750..92a7a69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,4 +100,4 @@ jobs: docker run --rm \ -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ 32bit/ubuntu:16.04 \ - linux32 --32bit i386 bash ./travis_test_32.sh + linux32 --32bit i386 -R bash ./travis_test_32.sh From 55f30a49dc41d38849c49093ade1f60ba7e0ee22 Mon Sep 17 00:00:00 2001 From: platinummonkey Date: Wed, 29 Apr 2026 11:44:03 -0500 Subject: [PATCH 3/4] Revert "ci(i386): disable ASLR via linux32 -R to fix flaky SIGSEGV" The -R flag broke the i386 job: util-linux 2.27 in 32bit/ubuntu:16.04 parses options after --32bit in an order-sensitive way and rejects "-R bash ..." with "i386: Kernel cannot set architecture to i386". Restoring the previous invocation; the underlying flake will be addressed separately. This reverts commit f3b091b. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92a7a69..d977750 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,4 +100,4 @@ jobs: docker run --rm \ -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ 32bit/ubuntu:16.04 \ - linux32 --32bit i386 -R bash ./travis_test_32.sh + linux32 --32bit i386 bash ./travis_test_32.sh From 18d9bdaaeb3858b670be2bdff9de953b54b3d3da Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Thu, 30 Apr 2026 14:31:57 -0500 Subject: [PATCH 4/4] ci(i386): cross-compile to GOARCH=386 instead of docker+old image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the docker-in-32bit/ubuntu:16.04 invocation (which downloaded Go 1.13 and was flaky due to modern kernel × 2016 userland) with a native cross-compile on ubuntu-latest: - actions/setup-go at Go 1.26 (matches the workflow's other jobs) - apt: gcc-multilib + libc6-dev-i386 for the 32-bit toolchain - GOARCH=386 CGO_ENABLED=1 CC="gcc -m32" so cgo emits 32-bit ELF - Linux IA32 compat on the amd64 host runs the resulting binary natively — no QEMU, no docker, no linux32 personality dance The huf_decompress_amd64.S source is auto-excluded by Go's filename suffix build rule under GOARCH=386. DISABLE_BIG_TESTS=1 is preserved to keep the prior carve-out for memory-heavy stream tests. The standalone "go test -bench ." invocation from the old script is not carried over (benchmarks aren't a correctness gate and the runner is too noisy for meaningful numbers). travis_test_32.sh is removed; nothing else referenced it. Suggested by @Viq111 on the PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 25 ++++++++++++++++++++----- travis_test_32.sh | 19 ------------------- 2 files changed, 20 insertions(+), 24 deletions(-) delete mode 100755 travis_test_32.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d977750..8cdfcd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,12 +92,27 @@ jobs: i386: name: golang-i386 runs-on: ubuntu-latest + env: + GOARCH: "386" + CGO_ENABLED: "1" + CC: "gcc -m32" steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Run 32-bit tests + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26" + - name: Install 32-bit toolchain + run: sudo apt-get update && sudo apt-get install -y gcc-multilib libc6-dev-i386 + - name: Download payload run: | - docker run --rm \ - -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - 32bit/ubuntu:16.04 \ - linux32 --32bit i386 bash ./travis_test_32.sh + wget https://github.com/DataDog/zstd/files/2246767/mr.zip + unzip mr.zip + - name: Build (i386) + run: go build + - name: Test (i386) + env: + DISABLE_BIG_TESTS: "1" + PAYLOAD: ${{ github.workspace }}/mr + run: go test -v diff --git a/travis_test_32.sh b/travis_test_32.sh deleted file mode 100755 index 264ca06..0000000 --- a/travis_test_32.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Get utilities -#yum -y -q -e 0 install wget tar unzip gcc -apt-get update -apt-get -y install wget tar unzip gcc - -# Get Go -wget -q https://dl.google.com/go/go1.13.linux-386.tar.gz -tar -C /usr/local -xzf go1.13.linux-386.tar.gz -export PATH=$PATH:/usr/local/go/bin - -# Get payload -wget -q https://github.com/DataDog/zstd/files/2246767/mr.zip -unzip mr.zip - -# Build and run tests -go build -DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -v -DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -bench .