Skip to content

Commit

Permalink
build: Cross compile with CGO
Browse files Browse the repository at this point in the history
* Some archs cannot be compiled with go due to sqlite driver

* Use CGO for covering rest of the cases

Signed-off-by: mahendrapaipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Nov 30, 2023
1 parent d29e7e2 commit 572877c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
- prometheus/setup_environment
- run: go mod download
- run: make
- prometheus/store_artifact:
file: ./bin/batchjob_exporter
test-arm:
executor: arm
steps:
Expand All @@ -35,7 +33,7 @@ jobs:
- prometheus/setup_environment
- run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97
- run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
# - run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
- run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
- persist_to_workspace:
root: .
paths:
Expand Down
7 changes: 5 additions & 2 deletions .promu-cgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ tarball:
- NOTICE
crossbuild:
platforms:
# We are not sure if our exporter will work on netbsd. So dont bother on
# cross compiling for now
- netbsd/amd64
- netbsd/386
- linux/mips
- linux/mipsle
- linux/mips64
- linux/mips64le
- linux/ppc64le
6 changes: 1 addition & 5 deletions .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ crossbuild:
- linux/amd64
- linux/386
- linux/arm64
- linux/mips
- linux/mipsle
- linux/mips64
- linux/mips64le
- linux/ppc64le

0 comments on commit 572877c

Please sign in to comment.