Skip to content

build failure on FreeBSD w/o optimization #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 7 tasks
hajimehoshi opened this issue Mar 9, 2025 · 0 comments · May be fixed by #314
Open
1 of 7 tasks

build failure on FreeBSD w/o optimization #305

hajimehoshi opened this issue Mar 9, 2025 · 0 comments · May be fixed by #314
Labels
bug Something isn't working

Comments

@hajimehoshi
Copy link
Member

hajimehoshi commented Mar 9, 2025

PureGo Version

009f4b0

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • NetBSD
  • Android
  • iOS

Go Version (go version)

go1.22.12 (but also other versions)

What steps will reproduce the problem?

Run the test CGO_ENABLED=0 w/o optimization

What is the expected result?

The test passes

What happens instead?

The test fails

https://github.com/hajimehoshi/purego/actions/runs/13751525916/job/38453081556

  => go test CGO_ENABLED=0 w/o optimization
  # github.com/ebitengine/purego/internal/fakecgo
  internal/fakecgo/freebsd.go:23:3: //go:cgo_export_dynamic environ only allowed in cgo-generated code
  internal/fakecgo/freebsd.go:24:3: //go:cgo_export_dynamic __progname only allowed in cgo-generated code
  FAIL	github.com/ebitengine/purego [build failed]
  FAIL	github.com/ebitengine/purego/examples/libc [build failed]
  ?   	github.com/ebitengine/purego/internal/cgo	[no test files]
  FAIL	github.com/ebitengine/purego/internal/fakecgo [build failed]
  FAIL	github.com/ebitengine/purego/internal/load [build failed]
  ?   	github.com/ebitengine/purego/internal/strings	[no test files]
  FAIL

Anything else you feel useful to add?

We should add -e to the shebang #!/bin/sh.

I don't think this is happening in the stable branch, where the test is not executed in a shell script.

EDIT: This might happen in the stable branch, as the test didn't include building w/o optimization. See

echo "=> go test CGO_ENABLED=0"
env CGO_ENABLED=0 go test -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -shuffle=on -v -count=10 ./...
echo "=> go test CGO_ENABLED=1"
env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...

@hajimehoshi hajimehoshi added the bug Something isn't working label Mar 9, 2025
hajimehoshi added a commit to hajimehoshi/purego that referenced this issue Mar 17, 2025
This change retracts the support of NetBSD temporarily. Let's revert
README again after ebitengine#304 is fixed.

Updates ebitengine#304
Updates ebitengine#305
hajimehoshi added a commit that referenced this issue Mar 17, 2025
This change retracts the support of NetBSD temporarily. Let's revert
README again after #304 is fixed.

Updates #304
Updates #305
hajimehoshi added a commit to hajimehoshi/purego that referenced this issue Mar 17, 2025
Without -e in the shebang #!/bin/sh, the script passed even some
commands failed and then we missed some errors happened. This change
adds -e to abort tests with an error code explicitly.

As ebitengine#305 says, FreeBSD tests w/o optimization fails. This change skips
the test temporarilly.

This change also retracts the support of NetBSD temporarily. Let's
revert README again after ebitengine#304 is fixed.

Updates ebitengine#304
Updates ebitengine#305
hajimehoshi added a commit that referenced this issue Mar 17, 2025
…ts (#306)

Without -e in the shebang #!/bin/sh, the script passed even some
commands failed and then we missed some errors happened. This change
adds -e to abort tests with an error code explicitly.

As #305 says, FreeBSD tests w/o optimization fails. This change skips
the test temporarilly.

This change also retracts the support of NetBSD temporarily. Let's
revert README again after #304 is fixed.

Updates #304
Updates #305
JupiterRider added a commit to JupiterRider/purego that referenced this issue May 9, 2025
@JupiterRider JupiterRider linked a pull request May 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant