Skip to content

Makefile: enable CGO for make test in dev shell - #3402

Merged
kradalby merged 1 commit into
juanfont:mainfrom
sfllaw:make-test-with-cgo-enabled
Jul 28, 2026
Merged

Makefile: enable CGO for make test in dev shell#3402
kradalby merged 1 commit into
juanfont:mainfrom
sfllaw:make-test-with-cgo-enabled

Conversation

@sfllaw

@sfllaw sfllaw commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #3401

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

Testing

sfllaw@h2co3:~/Projects/headscale/make-test-with-cgo-enabled$ nix develop
sfllaw@h2co3:~/Projects/headscale/make-test-with-cgo-enabled$ echo $CGO_ENABLED
0
sfllaw@h2co3:~/Projects/headscale/make-test-with-cgo-enabled$ make test
Running Go tests...
CGO_ENABLED=1 go test -race ./...
?   	github.com/juanfont/headscale/cmd/dev	[no test files]
?   	github.com/juanfont/headscale/cmd/gen-openapi	[no test files]
ok  	github.com/juanfont/headscale/cmd/headscale	1.053s

Fixes juanfont#3401

Signed-off-by: Simon Law <sfllaw@tailscale.com>
@sfllaw
sfllaw requested review from juanfont and kradalby as code owners July 28, 2026 17:49
@kradalby
kradalby merged commit 54a2746 into juanfont:main Jul 28, 2026
30 checks passed
@sfllaw
sfllaw deleted the make-test-with-cgo-enabled branch July 28, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] nix develop && make test fails because CGO_ENABLED=0 is incompatible with go test -race

2 participants