Skip to content

Commit

Permalink
chore(go/adbc): bump minimum version to go1.21, update deps (apache#1646
Browse files Browse the repository at this point in the history
)

Bumping the minimum go version (via go.mod) to go1.21 and updated
appropriate indirect dependencies accordingly.

---------

Co-authored-by: Sutou Kouhei <[email protected]>
  • Loading branch information
zeroshade and kou authored Mar 27, 2024
1 parent 6f1a381 commit 56498a0
Show file tree
Hide file tree
Showing 39 changed files with 212 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ JDK=8
MANYLINUX=2014
MAVEN=3.6.3
PYTHON=3.8
GO=1.19.5
GO=1.21.8
ARROW_MAJOR_VERSION=14
DOTNET=7.0

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand All @@ -135,7 +138,7 @@ jobs:
pip install pytest-error-for-skips
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
Expand Down Expand Up @@ -305,6 +308,9 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand Down Expand Up @@ -333,7 +339,7 @@ jobs:
sudo sysctl vm.mmap_rnd_bits=28
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand All @@ -103,7 +106,7 @@ jobs:
--file ci/conda_env_cpp.txt
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
Expand All @@ -117,15 +120,15 @@ jobs:
export ADBC_BUILD_TESTS=OFF
export ADBC_USE_ASAN=OFF
export ADBC_USE_UBSAN=OFF
export PATH=$RUNNER_TOOL_CACHE/go/1.19.13/${{ matrix.goarch }}/bin:$PATH
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/${{ matrix.goarch }}/bin:$PATH
export ADBC_CMAKE_ARGS="-DCMAKE_UNITY_BUILD=ON"
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- name: Go Build
shell: bash -l {0}
env:
CGO_ENABLED: "1"
run: |
export PATH=$RUNNER_TOOL_CACHE/go/1.19.13/${{ matrix.goarch }}/bin:$PATH
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/${{ matrix.goarch }}/bin:$PATH
./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -332,7 +335,7 @@ jobs:
sudo sysctl vm.mmap_rnd_bits=28
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.3.3
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Go Build
run: |
./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
Expand Down Expand Up @@ -370,6 +373,9 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand Down Expand Up @@ -399,14 +405,14 @@ jobs:
--file ci/conda_env_cpp.txt
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
- name: Install staticcheck
shell: bash -l {0}
if: matrix.os == 'ubuntu-latest'
run: go install honnef.co/go/tools/cmd/staticcheck@v0.3.3
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- uses: actions/download-artifact@v3
with:
Expand All @@ -416,7 +422,7 @@ jobs:
- name: Go Build
shell: bash -l {0}
run: |
export PATH=$RUNNER_TOOL_CACHE/go/1.19.13/${{ matrix.goarch }}/bin:$PATH
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/${{ matrix.goarch }}/bin:$PATH
./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- name: Run Staticcheck
if: matrix.os == 'ubuntu-latest'
Expand All @@ -430,7 +436,7 @@ jobs:
env:
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
run: |
export PATH=$RUNNER_TOOL_CACHE/go/1.19.13/${{ matrix.goarch }}/bin:$PATH
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/${{ matrix.goarch }}/bin:$PATH
./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
# ------------------------------------------------------------
Expand All @@ -454,6 +460,9 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand Down Expand Up @@ -484,7 +493,7 @@ jobs:
sudo sysctl vm.mmap_rnd_bits=28
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
Expand All @@ -501,10 +510,12 @@ jobs:
ADBC_USE_ASAN: "0"
ADBC_USE_UBSAN: "0"
run: |
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/x64/bin:$PATH
./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- name: Build Panic Dummy
shell: bash -l {0}
run: |
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/x64/bin:$PATH
if [[ $(uname) = "Darwin" ]]; then
make -C ./go/adbc/pkg libadbc_driver_panicdummy.dylib
else
Expand All @@ -518,10 +529,12 @@ jobs:
else
export PANICDUMMY_LIBRARY_PATH=$(pwd)/go/adbc/pkg/libadbc_driver_panicdummy.so
fi
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/x64/bin:$PATH
env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- name: Test Python Driver Flight SQL
shell: bash -l {0}
run: |
export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/x64/bin:$PATH
# Can't use Docker on macOS
pushd $(pwd)/go/adbc
go build -o testserver ./driver/flightsql/cmd/testserver
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/native-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Get required Go version
shell: bash
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
Expand All @@ -223,7 +227,7 @@ jobs:
--file ci/conda_env_cpp.txt
- uses: actions/setup-go@v5
with:
go-version: 1.20.8
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
Expand All @@ -238,15 +242,15 @@ jobs:
env:
CGO_ENABLED: "1"
run: |
$env:PATH="$($env:RUNNER_TOOL_CACHE)\go\1.20.8\x64\bin;" + $env:PATH
$env:PATH="${env:RUNNER_TOOL_CACHE}\go\${env:GO_VERSION}\x64\bin;${env:PATH}"
.\ci\scripts\go_build.ps1 $pwd $pwd\build
# TODO(apache/arrow#358): enable these tests on Windows
# - name: Go Test
# shell: pwsh
# env:
# CGO_ENABLED: "1"
# run: |
# $env:PATH="$($env:RUNNER_TOOL_CACHE)\go\1.20.8\x64\bin;" + $env:PATH
# $env:PATH="${env:RUNNER_TOOL_CACHE}\go\${env:GO_VERSION}\x64\bin;${env:PATH}"
# .\ci\scripts\go_test.ps1 $pwd $pwd\build

# ------------------------------------------------------------
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ jobs:
- almalinux-8
- almalinux-9
- debian-bookworm
- debian-bullseye
- ubuntu-jammy
steps:
- uses: actions/download-artifact@v3
Expand Down Expand Up @@ -686,7 +685,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: 1.19.13
go-version: 1.21.8
check-latest: true
cache: true
cache-dependency-path: adbc/go/adbc/go.sum
Expand Down Expand Up @@ -812,6 +811,8 @@ jobs:
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
(. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Show inputs
shell: pwsh
run: |
Expand Down Expand Up @@ -841,11 +842,9 @@ jobs:
.\bootstrap-vcpkg.bat -disableMetrics
popd
# Windows needs newer Go than 1.19
# https://github.com/golang/go/issues/51007
- uses: actions/setup-go@v5
with:
go-version: 1.20.8
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: adbc/go/adbc/go.sum
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/r-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Get required Go version
run: |
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: "${{ env.GO_VERSION }}"
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ repos:
- "--linelength=90"
- "--verbose=2"
- repo: https://github.com/golangci/golangci-lint
rev: v1.49.0
rev: v1.57.1
hooks:
- id: golangci-lint
entry: bash -c 'cd go/adbc && golangci-lint run --fix --timeout 5m'
Expand Down
2 changes: 1 addition & 1 deletion ci/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ outputs:
- {{ compiler('cxx') }}
- _go_select *=cgo
- cmake
- go-cgo >=1.19
- go-cgo >=1.21
- ninja
- pkg-config
test:
Expand Down
8 changes: 5 additions & 3 deletions ci/docker/python-wheel-manylinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ ARG VCPKG
FROM ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-${MANYLINUX}-vcpkg-${VCPKG}

ARG ARCH
ARG GO

RUN yum install -y docker
# arm64v8 -> arm64
RUN wget --no-verbose https://go.dev/dl/go1.19.13.linux-${ARCH/v8/}.tar.gz
RUN tar -C /usr/local -xzf go1.19.13.linux-${ARCH/v8/}.tar.gz
ENV PATH="${PATH}:/usr/local/go/bin"
RUN wget --no-verbose https://go.dev/dl/go${GO}.linux-${ARCH/v8/}.tar.gz && \
tar -C /usr/local -xzf go${GO}.linux-${ARCH/v8/}.tar.gz && \
rm go${GO}.linux-${ARCH/v8/}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
13 changes: 11 additions & 2 deletions ci/linux-packages/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,19 @@ class ADBCPackageTask < PackageTask
end
end

def detect_go_version
dot_env = File.join(__dir__, "..", "..", ".env")
File.readlines(dot_env, chomp: true).grep(/\AGO=/)[0].split("=", 2)[1]
end

def docker_build_options(os, architecture)
[
"--build-arg", "GO_VERSION=#{detect_go_version}",
]
end

def apt_targets_default
[
"debian-bullseye",
# "debian-bullseye-arm64",
"debian-bookworm",
# "debian-bookworm-arm64",
"ubuntu-jammy",
Expand Down
3 changes: 2 additions & 1 deletion ci/linux-packages/apt/debian-bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN \
apt install -y -V ${quiet} \
./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \
rm apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \
echo "deb http://deb.debian.org/debian $(lsb_release --codename --short)-backports main" >> /etc/apt/sources.list && \
apt update && \
apt install -y -V ${quiet} \
build-essential \
Expand All @@ -48,7 +49,6 @@ RUN \
debhelper \
devscripts \
gobject-introspection \
golang \
libarrow-glib-dev \
libgirepository1.0-dev \
libpq-dev \
Expand All @@ -58,4 +58,5 @@ RUN \
pkg-config \
tzdata \
valac && \
apt install -y -V -t $(lsb_release --codename --short)-backports ${quiet} golang-1.21 && \
apt clean
Loading

0 comments on commit 56498a0

Please sign in to comment.