Skip to content

Commit

Permalink
ARROW-17324: [Go][CI] Add go1.18 job and -asan flag (apache#13867)
Browse files Browse the repository at this point in the history
Also addresses [ARROW-7138](https://issues.apache.org/jira/browse/ARROW-7138)

Authored-by: Matt Topol <zotthewizard@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
  • Loading branch information
zeroshade authored and ksuarez1423 committed Aug 15, 2022
1 parent a9efd10 commit 355e4a0
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@
!rust/datafusion/Cargo.toml
!rust/datafusion/benches
!rust/integration-testing/Cargo.toml
!go/go.mod
!go/go.sum
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ DASK=latest
DOTNET=6.0
GCC_VERSION=""
GO=1.16
STATICCHECK=v0.2.2
HDFS=3.2.1
JDK=8
KARTOTHEK=latest
Expand Down
95 changes: 68 additions & 27 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
env:
GO: ${{ matrix.go }}
STATICCHECK: ${{ matrix.staticcheck }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
Expand Down Expand Up @@ -80,9 +86,15 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
env:
GO: ${{ matrix.go }}
STATICCHECK: ${{ matrix.staticcheck }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
Expand Down Expand Up @@ -111,9 +123,15 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
env:
GO: ${{ matrix.go }}
STATICCHECK: ${{ matrix.staticcheck }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
Expand All @@ -140,19 +158,26 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
steps:
- name: Install go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: go/go.sum
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
run: go install honnef.co/go/tools/cmd/staticcheck@${{ matrix.staticcheck }}
- name: Build
shell: bash
run: ci/scripts/go_build.sh $(pwd)
Expand All @@ -168,19 +193,26 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
steps:
- name: Install go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: go/go.sum
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
run: go install honnef.co/go/tools/cmd/staticcheck@${{ matrix.staticcheck }}
- name: Build
shell: bash
run: ci/scripts/go_build.sh $(pwd)
Expand All @@ -196,24 +228,31 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.16]
go: [1.16, 1.18]
include:
- go: 1.16
staticcheck: v0.2.2
- go: 1.18
staticcheck: latest
env:
ARROW_GO_TESTCGO: "1"
steps:
- name: Install go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: go/go.sum
- name: Brew Install Arrow
shell: bash
run: brew install apache-arrow
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
run: go install honnef.co/go/tools/cmd/staticcheck@${{ matrix.staticcheck }}
- name: Build
shell: bash
run: ci/scripts/go_build.sh $(pwd)
Expand Down Expand Up @@ -264,11 +303,13 @@ jobs:
echo "CGO_LDFLAGS=-g -O2 -L$(cygpath --windows ${MINGW_PREFIX}/lib) -L$(cygpath --windows ${MINGW_PREFIX}/bin)" >> $GITHUB_ENV
echo "MINGW_PREFIX=$(cygpath --windows ${MINGW_PREFIX})" >> $GITHUB_ENV
- name: Install go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
cache: true
cache-dependency-path: go/go.sum
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Build
shell: bash
run: ci/scripts/go_build.sh $(pwd)
Expand Down
15 changes: 9 additions & 6 deletions ci/docker/debian-10-go.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
# under the License.

ARG arch=amd64
ARG go=1.15
ARG go=1.16
ARG staticcheck=v0.2.2
FROM ${arch}/golang:${go}-buster

RUN GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
# FROM collects all the args, get back the staticcheck version arg
ARG staticcheck

# TODO(kszucs):
# 1. add the files required to install the dependencies to .dockerignore
# 2. copy these files to their appropriate path
# 3. download and compile the dependencies
RUN GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck@${staticcheck}

# Copy the go.mod and go.sum over and pre-download all the dependencies
COPY go/ /arrow/go
RUN cd /arrow/go && go mod download
12 changes: 7 additions & 5 deletions ci/docker/debian-11-go.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

ARG arch=amd64
ARG go=1.16
ARG staticcheck=v0.2.2
FROM ${arch}/golang:${go}-bullseye

RUN GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
# FROM collects all the args, get back the staticcheck version arg
ARG staticcheck
RUN GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck@${staticcheck}

# TODO(kszucs):
# 1. add the files required to install the dependencies to .dockerignore
# 2. copy these files to their appropriate path
# 3. download and compile the dependencies
# Copy the go.mod and go.sum over and pre-download all the dependencies
COPY go/ /arrow/go
RUN cd /arrow/go && go mod download
4 changes: 1 addition & 3 deletions ci/scripts/go_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@ if [[ -n "${ARROW_GO_TESTCGO}" ]]; then
go clean -cache
go clean -testcache
fi
TAGS="-tags assert,test,ccalloc"
TAGS="-tags assert,test,ccalloc"
fi

go get -d -t -v ./...
go install $TAGS -v ./...

popd

pushd ${source_dir}/parquet

go get -d -t -v ./...
go install -v ./...

popd
20 changes: 11 additions & 9 deletions ci/scripts/go_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@

set -ex

ver=`go env GOVERSION`

source_dir=${1}/go

# when we upgrade to at least go1.18, we can add the new -asan option here
testargs="-race"
if [[ "${ver#go}" =~ ^1\.1[8-9] ]] && [ "$(go env GOOS)" != "darwin" ]; then
# asan not supported on darwin/amd64
testargs="-asan"
fi

case "$(uname)" in
MINGW*)
# -asan and -race don't work on windows currently
Expand All @@ -45,9 +51,9 @@ fi
pushd ${source_dir}/arrow

TAGS="assert,test"
if [[ -n "${ARROW_GO_TESTCGO}" ]]; then
if [[ -n "${ARROW_GO_TESTCGO}" ]]; then
if [[ "${MSYSTEM}" = "MINGW64" ]]; then
export PATH=${MINGW_PREFIX}/bin:$PATH
export PATH=${MINGW_PREFIX}/bin:$PATH
fi
TAGS="${TAGS},ccalloc"
fi
Expand All @@ -57,18 +63,14 @@ fi
# tag in order to run its tests so that the testing functions implemented
# in .c files don't get included in non-test builds.

for d in $(go list ./... | grep -v vendor); do
go test $testargs -tags $TAGS $d
done
go test $testargs -tags $TAGS ./...

popd

export PARQUET_TEST_DATA=${1}/cpp/submodules/parquet-testing/data

pushd ${source_dir}/parquet

for d in $(go list ./... | grep -v vendor); do
go test $testargs -tags assert $d
done
go test $testargs -tags assert ./...

popd
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,7 @@ services:
args:
arch: ${ARCH}
go: ${GO}
staticcheck: ${STATICCHECK}
shm_size: *shm-size
volumes: *debian-volumes
command: &go-command >
Expand Down
7 changes: 3 additions & 4 deletions go/arrow/flight/internal/flight/FlightSql.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ require (
github.com/apache/thrift v0.16.0
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
github.com/goccy/go-json v0.9.10
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.4
github.com/google/flatbuffers v2.0.6+incompatible
github.com/klauspost/asmfmt v1.3.2
Expand Down

0 comments on commit 355e4a0

Please sign in to comment.