Skip to content

Commit

Permalink
fix: Linker warnings on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljurecko committed Jun 5, 2024
1 parent 591d20a commit 8c64959
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test-e2e-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ jobs:
export TEST_BINARY_CLI="${{ runner.temp }}/test-build-cli"
fi
# Prevent linker warnings on macOs (https://github.com/golang/go/issues/61229#issuecomment-1988965927)
if [ "$RUNNER_OS" == "macOS" ]; then
export GOFLAGS=-ldflags=-extldflags=-Wl,-ld_classic"
else
# Build binary for test without external inputs
env -i \
TERM="$TERM" \
HOME="$HOME" \
PATH="$PATH" \
GOFLAGS="$GOFLAGS" \
APPDATA="$APPDATA" \
BUILD_TARGET_PATH="$TEST_BINARY_CLI" \
CLI_BUILD_DATE="-" \
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ jobs:
- name: Run tests
shell: bash
run: |
# Prevent linker warnings on macOs (https://github.com/golang/go/issues/61229#issuecomment-1988965927)
if [ "$RUNNER_OS" == "macOS" ]; then
export GOFLAGS=-ldflags=-extldflags=-Wl,-ld_classic"
else
# ENVs can affect test caching, make sure to only run tests with expected ENVs
env -i \
TERM="$TERM" \
HOME="$HOME" \
PATH="$PATH" \
GOFLAGS="$GOFLAGS" \
APPDATA="$APPDATA" \
DATADOG_ENABLED="false" \
UNIT_ETCD_ENABLED="$UNIT_ETCD_ENABLED" \
Expand Down

0 comments on commit 8c64959

Please sign in to comment.