Skip to content

fakecgo: restrict freebsd/netbsd build constraints to amd64/arm64#472

Closed
gdams wants to merge 1 commit into
ebitengine:mainfrom
gdams:s390x
Closed

fakecgo: restrict freebsd/netbsd build constraints to amd64/arm64#472
gdams wants to merge 1 commit into
ebitengine:mainfrom
gdams:s390x

Conversation

@gdams

@gdams gdams commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What issue is this addressing?

What type of issue is this addressing?

bug

What this PR does | solves

This PR restricts the freebsd and netbsd build constraints in fakecgo's shared files (go_util.go, go_setenv.go, go_libinit.go) to amd64/arm64, matching the arch constraints already present in the OS-specific go_freebsd.go and go_netbsd.go files. This prevents build failures on unsupported architectures (e.g. freebsd/386), where the shared files would otherwise compile but reference symbols like _cgo_sys_thread_start that are never defined.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates internal/fakecgo build constraints so that shared fakecgo files only build on freebsd/netbsd when the architecture is amd64 or arm64, matching the existing arch restrictions in the OS-specific implementations.

Changes:

  • Narrow //go:build constraints in shared fakecgo Go files to ((freebsd || netbsd) && (amd64 || arm64)).
  • Keep darwin and linux behavior unchanged by leaving them unconstrained by arch in these files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/fakecgo/go_util.go Restricts fakecgo thread-start helper to freebsd/netbsd on amd64/arm64.
internal/fakecgo/go_setenv.go Restricts fakecgo env helpers to freebsd/netbsd on amd64/arm64.
internal/fakecgo/go_libinit.go Restricts fakecgo runtime-init helpers to freebsd/netbsd on amd64/arm64.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux || netbsd)
//go:build !cgo && (darwin || linux || ((freebsd || netbsd) && (amd64 || arm64)))
@gdams gdams marked this pull request as draft July 2, 2026 10:55
@gdams gdams closed this Jul 2, 2026
@gdams gdams deleted the s390x branch July 2, 2026 11:07
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.

2 participants