build: add ARM64 support to release (#20260)
* Create Dockerfile for running build & release in CI * Update CircleCI config to use new Docker image * Update goreleaser to add a linux ARM64 releasepull/20322/head
parent
eb0b411b97
commit
ccbaf4e883
|
@ -1,64 +1,5 @@
|
|||
version: "2.1"
|
||||
|
||||
commands:
|
||||
install_rust_compiler:
|
||||
description: >
|
||||
This will install the rust compiler with the rust tools.
|
||||
steps:
|
||||
- run:
|
||||
name: Install clang
|
||||
command: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang musl-tools
|
||||
- run:
|
||||
name: Install rust compiler
|
||||
command: |
|
||||
curl https://sh.rustup.rs -sSf | \
|
||||
sh -s -- --default-toolchain stable -y
|
||||
echo 'source $HOME/.cargo/env' >> $BASH_ENV
|
||||
|
||||
install_release_tools:
|
||||
description: >
|
||||
This will install the cross compilers necessary to build release binaries.
|
||||
steps:
|
||||
- run:
|
||||
name: Install linux cross compilers
|
||||
command: >
|
||||
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
|
||||
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
|
||||
gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||
- run:
|
||||
name: Install macOS cross compilers
|
||||
command: |
|
||||
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
|
||||
cmake patch libxml2-dev libssl-dev zlib1g-dev
|
||||
sudo mkdir -p /opt/osxcross
|
||||
cd /opt
|
||||
sudo git clone https://github.com/tpoechtrager/osxcross.git
|
||||
cd osxcross
|
||||
sudo git checkout c2ad5e859d12a295c3f686a15bd7181a165bfa82
|
||||
sudo curl -L -o \
|
||||
./tarballs/MacOSX10.11.sdk.tar.xz \
|
||||
https://macos-sdks.s3.amazonaws.com/MacOSX10.11.sdk.tar.xz
|
||||
sudo UNATTENDED=1 PORTABLE=true ./build.sh
|
||||
- run:
|
||||
name: Install additional rust targets
|
||||
command: |
|
||||
rustup target add x86_64-unknown-linux-musl \
|
||||
aarch64-unknown-linux-gnu \
|
||||
arm-unknown-linux-gnueabihf \
|
||||
armv7-unknown-linux-gnueabihf \
|
||||
x86_64-apple-darwin
|
||||
echo 'export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc' >> $HOME/.cargo/env
|
||||
echo 'export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc' >> $HOME/.cargo/env
|
||||
echo 'export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc' >> $HOME/.cargo/env
|
||||
echo 'export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc' >> $HOME/.cargo/env
|
||||
echo 'export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/opt/osxcross/target/bin/o64-clang' >> $HOME/.cargo/env
|
||||
- run:
|
||||
name: Install pkg-config wrapper
|
||||
command: go build -o /go/bin/pkg-config github.com/influxdata/pkg-config
|
||||
- run:
|
||||
name: Copy xcc wrapper script for cross compilation
|
||||
command: install xcc.sh /go/bin/xcc
|
||||
|
||||
jobs:
|
||||
litmus_daily:
|
||||
machine: true
|
||||
|
@ -126,14 +67,13 @@ jobs:
|
|||
destination: nightly-junit
|
||||
e2e:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
||||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Speed up `make build` by restoring caches from previous runs.
|
||||
- restore_cache:
|
||||
name: Restoring GOCACHE
|
||||
|
@ -143,10 +83,6 @@ jobs:
|
|||
name: Restoring GOPATH/pkg/mod
|
||||
keys:
|
||||
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
|
||||
- run: sudo apt-get update
|
||||
- run: sudo apt-get install -y netcat-openbsd
|
||||
- run: sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- run: make protoc
|
||||
- run: make build
|
||||
- run:
|
||||
|
@ -224,7 +160,7 @@ jobs:
|
|||
path: ~/project
|
||||
jstest:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
parallelism: 8
|
||||
steps:
|
||||
|
@ -260,7 +196,7 @@ jobs:
|
|||
- ~/.cache/yarn
|
||||
jslint:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
parallelism: 8
|
||||
steps:
|
||||
|
@ -290,7 +226,7 @@ jobs:
|
|||
- ~/.cache/yarn
|
||||
gotest:
|
||||
docker:
|
||||
- image: circleci/golang:1.15
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
resource_class: large
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
|
@ -300,7 +236,6 @@ jobs:
|
|||
parallelism: 8
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Populate GOCACHE.
|
||||
- restore_cache:
|
||||
name: Restoring GOCACHE
|
||||
|
@ -313,8 +248,6 @@ jobs:
|
|||
name: Restoring GOPATH/pkg/mod
|
||||
keys:
|
||||
- influxdb-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
|
||||
- run: sudo apt-get update && sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- run: mkdir -p $TEST_RESULTS
|
||||
- run: make test-go # This uses the test cache so it may succeed or fail quickly.
|
||||
- run:
|
||||
|
@ -345,7 +278,7 @@ jobs:
|
|||
|
||||
golint:
|
||||
docker:
|
||||
- image: circleci/golang:1.15
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
GOFLAGS: "-mod=readonly -p=2" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
||||
|
@ -353,8 +286,6 @@ jobs:
|
|||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo apt-get update && sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- run: mkdir -p $TEST_RESULTS
|
||||
- run: |
|
||||
# this is not in a seperate bash script because it isn't meant to be run on local.
|
||||
|
@ -379,17 +310,14 @@ jobs:
|
|||
path: /tmp/test-results
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
||||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo apt-get update && sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- run: make checkcommit
|
||||
|
||||
# Speed up `make build` by restoring caches from previous runs.
|
||||
- restore_cache:
|
||||
name: Restoring GOCACHE
|
||||
|
@ -411,14 +339,13 @@ jobs:
|
|||
- etc/litmus_fail_notify.sh
|
||||
deploy-nightly:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
||||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Speed up `make nightly` by restoring caches from previous runs.
|
||||
- restore_cache:
|
||||
name: Restoring GOCACHE
|
||||
|
@ -432,9 +359,6 @@ jobs:
|
|||
- run:
|
||||
name: "Docker Login"
|
||||
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
|
||||
- run: sudo apt-get update && sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- install_release_tools
|
||||
- run: make protoc # installs protoc
|
||||
- run:
|
||||
name: "Build nightly"
|
||||
|
@ -447,7 +371,7 @@ jobs:
|
|||
|
||||
release:
|
||||
docker:
|
||||
- image: circleci/golang:1.15-node-browsers
|
||||
- image: quay.io/influxdb/influxdb-circleci:latest
|
||||
environment:
|
||||
GOCACHE: /tmp/go-cache
|
||||
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
||||
|
@ -455,7 +379,6 @@ jobs:
|
|||
working_directory: /go/src/github.com/influxdata/influxdb
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Speed up `make nightly` by restoring caches from previous runs.
|
||||
- restore_cache:
|
||||
name: Restoring GOCACHE
|
||||
|
@ -469,9 +392,6 @@ jobs:
|
|||
- run:
|
||||
name: "Docker Login"
|
||||
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
|
||||
- run: sudo apt-get update && sudo apt-get install -y bzr
|
||||
- install_rust_compiler
|
||||
- install_release_tools
|
||||
- run: make protoc # installs protoc
|
||||
- run:
|
||||
name: import GPG key
|
||||
|
|
|
@ -6,10 +6,13 @@ builds:
|
|||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
main: ./cmd/influx/
|
||||
flags:
|
||||
- -tags={{if and (eq .Os "linux") (eq .Arch "amd64")}}osusergo,netgo,static_build{{end}}
|
||||
- -tags={{if eq .Os "linux"}}osusergo,netgo,static_build{{if not (eq .Arch "amd64")}},noasm{{end}}{{end}}
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=1
|
||||
|
@ -17,7 +20,7 @@ builds:
|
|||
- PKG_CONFIG=$GOPATH/bin/pkg-config
|
||||
- MACOSX_DEPLOYMENT_TARGET=10.11
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if and (eq .Os "linux") (eq .Arch "amd64")}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if eq .Os "linux"}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
binary: influx
|
||||
|
||||
- id: influxd
|
||||
|
@ -26,10 +29,13 @@ builds:
|
|||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
main: ./cmd/influxd/
|
||||
flags:
|
||||
- -tags=assets{{if and (eq .Os "linux") (eq .Arch "amd64")}},osusergo,netgo,static_build{{end}}
|
||||
- -tags=assets{{if eq .Os "linux"}},osusergo,netgo,static_build{{if not (eq .Arch "amd64")}},noasm{{end}}{{end}}
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=1
|
||||
|
@ -37,7 +43,7 @@ builds:
|
|||
- PKG_CONFIG=$GOPATH/bin/pkg-config
|
||||
- MACOSX_DEPLOYMENT_TARGET=10.11
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if and (eq .Os "linux") (eq .Arch "amd64")}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if eq .Os "linux"}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
binary: influxd
|
||||
hooks:
|
||||
pre: make generate
|
||||
|
@ -64,9 +70,9 @@ nfpms:
|
|||
rpm:
|
||||
replacements:
|
||||
amd64: x86_64
|
||||
file_name_template: "influxdb2-nightly.{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
file_name_template: "influxdb2-nightly.{{ .Arch }}"
|
||||
deb:
|
||||
file_name_template: "influxdb2_nightly_{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
file_name_template: "influxdb2_nightly_{{ .Arch }}"
|
||||
vendor: InfluxData
|
||||
homepage: https://influxdata.com
|
||||
maintainer: support@influxdb.com
|
||||
|
@ -79,7 +85,7 @@ archives:
|
|||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
name_template: "influxdb2_nightly_{{ .Os }}_{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
name_template: "influxdb2_nightly_{{ .Os }}_{{ .Arch }}"
|
||||
files:
|
||||
- LICENSE
|
||||
- README.md
|
||||
|
|
|
@ -6,10 +6,13 @@ builds:
|
|||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
main: ./cmd/influx/
|
||||
flags:
|
||||
- -tags={{if and (eq .Os "linux") (eq .Arch "amd64")}}osusergo,netgo,static_build{{end}}
|
||||
- -tags={{if eq .Os "linux"}}osusergo,netgo,static_build{{if not (eq .Arch "amd64")}},noasm{{end}}{{end}}
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=1
|
||||
|
@ -17,7 +20,7 @@ builds:
|
|||
- PKG_CONFIG=$GOPATH/bin/pkg-config
|
||||
- MACOSX_DEPLOYMENT_TARGET=10.11
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if and (eq .Os "linux") (eq .Arch "amd64")}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if eq .Os "linux"}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
binary: influx
|
||||
|
||||
- id: influxd
|
||||
|
@ -26,10 +29,13 @@ builds:
|
|||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
main: ./cmd/influxd/
|
||||
flags:
|
||||
- -tags=assets{{if and (eq .Os "linux") (eq .Arch "amd64")}},osusergo,netgo,static_build{{end}}
|
||||
- -tags=assets{{if eq .Os "linux"}},osusergo,netgo,static_build{{if not (eq .Arch "amd64")}},noasm{{end}}{{end}}
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=1
|
||||
|
@ -37,14 +43,13 @@ builds:
|
|||
- PKG_CONFIG=$GOPATH/bin/pkg-config
|
||||
- MACOSX_DEPLOYMENT_TARGET=10.11
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if and (eq .Os "linux") (eq .Arch "amd64")}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} {{if eq .Os "linux"}}-extldflags "-fno-PIC -static -Wl,-z,stack-size=8388608"{{end}}
|
||||
binary: influxd
|
||||
hooks:
|
||||
pre: make generate
|
||||
|
||||
nfpms:
|
||||
-
|
||||
id: "influxdb2"
|
||||
- id: "influxdb2"
|
||||
builds: ["influx", "influxd"]
|
||||
formats:
|
||||
- deb
|
||||
|
@ -64,9 +69,9 @@ nfpms:
|
|||
rpm:
|
||||
replacements:
|
||||
amd64: x86_64
|
||||
file_name_template: "influxdb2-{{ .Version }}.{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
file_name_template: "influxdb2-{{ .Version }}.{{ .Arch }}"
|
||||
deb:
|
||||
file_name_template: "influxdb2_{{ .Version }}_{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
file_name_template: "influxdb2_{{ .Version }}_{{ .Arch }}"
|
||||
vendor: InfluxData
|
||||
homepage: https://influxdata.com
|
||||
maintainer: support@influxdb.com
|
||||
|
@ -81,7 +86,7 @@ archives:
|
|||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
name_template: "influxdb2_client_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
name_template: "influxdb2_client_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
files:
|
||||
- LICENSE
|
||||
- README.md
|
||||
|
@ -91,7 +96,7 @@ archives:
|
|||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
name_template: "influxdb2-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{if .Arm}}{{ if eq .Arm \"5\" }}el{{end}}{{ end }}{{if .Arm}}{{ if eq .Arm \"6\" }}hf{{end}}{{ end }}"
|
||||
name_template: "influxdb2-{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
files:
|
||||
- LICENSE
|
||||
- README.md
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
## unreleased
|
||||
|
||||
### ARM Support
|
||||
|
||||
This release includes our initial ARM64 "preview" build.
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
Previously, `influxd upgrade` would attempt to write upgraded `config.toml` files into the same directory as the source
|
||||
|
|
21
Makefile
21
Makefile
|
@ -170,24 +170,20 @@ bench:
|
|||
|
||||
build: all
|
||||
|
||||
goreleaser:
|
||||
curl -sfL -o goreleaser-install https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh
|
||||
sh goreleaser-install v0.142.0
|
||||
pkg-config:
|
||||
go build -o $(GOPATH)/bin/pkg-config github.com/influxdata/pkg-config
|
||||
install xcc.sh $(GOPATH)/bin/xcc
|
||||
|
||||
# Parallelism for goreleaser must be set to 1 so it doesn't
|
||||
# attempt to invoke pkg-config, which invokes cargo,
|
||||
# for multiple targets at the same time.
|
||||
dist: goreleaser
|
||||
./bin/goreleaser -p 1 --skip-validate --rm-dist --config=.goreleaser-nightly.yml
|
||||
dist: pkg-config
|
||||
goreleaser build -p 1 --skip-validate --rm-dist
|
||||
|
||||
nightly: goreleaser
|
||||
./bin/goreleaser -p 1 --skip-validate --rm-dist --config=.goreleaser-nightly.yml
|
||||
release: pkg-config
|
||||
goreleaser release -p 1 --rm-dist
|
||||
|
||||
release: goreleaser
|
||||
git checkout -- go.sum # avoid dirty git repository caused by go install
|
||||
./bin/goreleaser release -p 1 --rm-dist
|
||||
nightly: pkg-config
|
||||
goreleaser release -p 1 --skip-validate --rm-dist --config=.goreleaser-nightly.yml
|
||||
|
||||
clean:
|
||||
@for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
|
||||
|
@ -215,6 +211,7 @@ run-e2e: chronogiraffe
|
|||
./bin/$(GOOS)/influxd --assets-path=ui/build --e2e-testing --store=memory
|
||||
|
||||
# assume this is running from circleci
|
||||
# TODO: Move this to the CI docker image build?
|
||||
protoc:
|
||||
curl -s -L https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip > /tmp/protoc.zip
|
||||
unzip -o -d /go /tmp/protoc.zip
|
||||
|
@ -240,4 +237,4 @@ dshell: dshell-image
|
|||
@docker container run --rm -p 8086:8086 -p 8080:8080 -u $(shell id -u) -it -v $(shell pwd):/code -w /code influxdb:dshell
|
||||
|
||||
# .PHONY targets represent actions that do not create an actual file.
|
||||
.PHONY: all $(SUBDIRS) run fmt checkfmt tidy checktidy checkgenerate test test-go test-js test-go-race bench clean node_modules vet nightly chronogiraffe dist ping protoc e2e run-e2e influxd libflux flags dshell dclean docker-image-flux docker-image-influx goreleaser
|
||||
.PHONY: all $(SUBDIRS) run fmt checkfmt tidy checktidy checkgenerate test test-go test-js test-go-race bench clean node_modules vet nightly chronogiraffe dist ping protoc e2e run-e2e influxd libflux flags dshell dclean docker-image-flux docker-image-influx pkg-config
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
FROM circleci/golang:1.15-node-browsers
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
# Install musl cross-compiler for ARM64.
|
||||
ENV MUSL_VERSION=1.1.24
|
||||
ENV MUSL_CROSS_MAKE_VERSION=v0.9.9
|
||||
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
patch && \
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone https://github.com/richfelker/musl-cross-make.git && \
|
||||
cd musl-cross-make && \
|
||||
git checkout ${MUSL_CROSS_MAKE_VERSION} && \
|
||||
make MUSL_VER=${MUSL_VERSION} TARGET=aarch64-unknown-linux-musl install && \
|
||||
sudo mv output /usr/local/musl-cross && \
|
||||
cd .. && \
|
||||
rm -rf musl-cross-make
|
||||
|
||||
ENV PATH=/usr/local/musl-cross/bin:${PATH}
|
||||
|
||||
# Install native musl.
|
||||
RUN curl https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz -O && \
|
||||
tar xzf musl-${MUSL_VERSION}.tar.gz && \
|
||||
cd musl-${MUSL_VERSION} && \
|
||||
./configure && \
|
||||
make && \
|
||||
sudo make install && \
|
||||
cd .. && \
|
||||
rm -rf musl-${MUSL_VERSION}*
|
||||
|
||||
ENV PATH=/usr/local/musl/bin:${PATH}
|
||||
|
||||
# Install macOS cross-compiler.
|
||||
ENV OSX_CROSS_VERSION=c2ad5e859d12a295c3f686a15bd7181a165bfa82
|
||||
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
clang \
|
||||
cmake \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
llvm-dev \
|
||||
lzma-dev \
|
||||
zlib1g-dev && \
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sudo git clone https://github.com/tpoechtrager/osxcross.git /usr/local/osxcross && \
|
||||
cd /usr/local/osxcross && \
|
||||
sudo git checkout ${OSX_CROSS_VERSION} && \
|
||||
sudo curl -L -o ./tarballs/MacOSX10.11.sdk.tar.xz https://macos-sdks.s3.amazonaws.com/MacOSX10.11.sdk.tar.xz && \
|
||||
sudo UNATTENDED=1 PORTABLE=true OCDEBUG=1 ./build.sh && \
|
||||
sudo rm -rf .git build tarballs && \
|
||||
cd /tmp
|
||||
|
||||
ENV PATH=/usr/local/osxcross/target/bin:${PATH}
|
||||
|
||||
# Install the rust compiler.
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
|
||||
ENV PATH=/home/circleci/.cargo/bin:${PATH}
|
||||
|
||||
# Install rust toolchains for cross-building.
|
||||
RUN rustup target add \
|
||||
x86_64-unknown-linux-musl \
|
||||
aarch64-unknown-linux-musl \
|
||||
x86_64-apple-darwin
|
||||
|
||||
# Configure linkers for new targets.
|
||||
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/usr/local/musl/bin/musl-gcc
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/usr/local/musl-cross/bin/aarch64-unknown-linux-musl-gcc
|
||||
ENV CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/usr/local/osxcross/target/bin/x86_64-apple-darwin15-clang
|
||||
|
||||
WORKDIR /go
|
||||
|
||||
# Install goreleaser.
|
||||
ENV GORELEASER_VERSION=v0.142.0
|
||||
RUN curl -sfL -o goreleaser-install https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh && \
|
||||
sh goreleaser-install ${GORELEASER_VERSION} && \
|
||||
rm goreleaser-install
|
||||
|
||||
# Install our cross-compiler.
|
||||
COPY --chown=circleci:circleci ./xcc.sh /go/bin/xcc
|
||||
RUN chmod a+x /go/bin/xcc
|
||||
|
||||
# Install build and test dependencies.
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
bzr \
|
||||
libprotobuf-dev \
|
||||
netcat-openbsd \
|
||||
pkg-config \
|
||||
protobuf-compiler && \
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
|
@ -9,10 +9,9 @@ GOOS=${GOOS:-$(go env GOOS)}
|
|||
GOARCH=${GOARCH:-$(go env GOARCH)}
|
||||
|
||||
case "${GOOS}_${GOARCH}" in
|
||||
linux_amd64) CC=musl-gcc ;;
|
||||
linux_arm64) CC=aarch64-linux-gnu-gcc ;;
|
||||
linux_arm) CC=arm-linux-gnueabihf-gcc ;;
|
||||
darwin_amd64) CC=/opt/osxcross/target/bin/o64-clang ;;
|
||||
linux_amd64) CC=musl-gcc ;;
|
||||
linux_arm64) CC=aarch64-unknown-linux-musl-gcc ;;
|
||||
darwin_amd64) CC=x86_64-apple-darwin15-clang ;;
|
||||
*) die "No cross-compiler set for ${GOOS}_${GOARCH}" ;;
|
||||
esac
|
||||
|
2
go.mod
2
go.mod
|
@ -50,7 +50,7 @@ require (
|
|||
github.com/influxdata/flux v0.98.0
|
||||
github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69
|
||||
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6
|
||||
github.com/influxdata/pkg-config v0.2.5
|
||||
github.com/influxdata/pkg-config v0.2.6
|
||||
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368
|
||||
github.com/jessevdk/go-flags v1.4.0
|
||||
github.com/jsternberg/zap-logfmt v1.2.0
|
||||
|
|
2
go.sum
2
go.sum
|
@ -338,6 +338,8 @@ github.com/influxdata/nats-streaming-server v0.11.3-0.20201112040610-c277f756080
|
|||
github.com/influxdata/nats-streaming-server v0.11.3-0.20201112040610-c277f7560803/go.mod h1:qgAMR6M9EokX+R5X7jUQfubwBdS1tBIl4yVJ3shhcWk=
|
||||
github.com/influxdata/pkg-config v0.2.5 h1:iC19aXlkUPiwxjxeeKk8TT8S5s3pargNPLgZE/rvOzc=
|
||||
github.com/influxdata/pkg-config v0.2.5/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk=
|
||||
github.com/influxdata/pkg-config v0.2.6 h1:GQFKw3m3OmmPMze9n75ZVVtNu4LJ2MJolHbxvg4AAvg=
|
||||
github.com/influxdata/pkg-config v0.2.6/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk=
|
||||
github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
|
||||
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9 h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE=
|
||||
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0=
|
||||
|
|
Loading…
Reference in New Issue