Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
cp custom/promql-cli/promql-linux-arm64 build/_output/

- name: Build go binary for dns_interceptor
run : go build -o ./../../build/_output/dns_interceptor
run : ./../../build/go-multiarch-build.sh "go build -o ./../../build/_output/dns_interceptor" 1
working-directory: custom/dns_interceptor

- name: create release along with artifact
Expand Down
5 changes: 3 additions & 2 deletions build/go-multiarch-build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

package=$1
cgo_flag=${2:-0}
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
echo "usage: $0 <package-name> [cgo-flag]"
exit 1
fi
package_split=(${package//\// })
Expand All @@ -16,7 +17,7 @@ do
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}

env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 $package-$GOARCH
env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$cgo_flag $package-$GOARCH
if [ $? -ne 0 ]; then
echo 'An error has occurred! Aborting the script execution...'
exit 1
Expand Down
2 changes: 1 addition & 1 deletion custom/dns_interceptor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main

/*
#cgo CFLAGS: -Werror -I/usr/include
#cgo LDFLAGS: -L/usr/lib64/ -L/usr/lib/x86_64-linux-gnu/ -ldl
#cgo LDFLAGS: -ldl
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
Expand Down