Skip to content
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

Can not build: Build constraints exclude all Go files #38

Open
PritishMishraa opened this issue Mar 24, 2024 · 2 comments
Open

Can not build: Build constraints exclude all Go files #38

PritishMishraa opened this issue Mar 24, 2024 · 2 comments

Comments

@PritishMishraa
Copy link

can not build when running the command GOOS=darwin GOARCH=amd64 go build

error: github.com/webview/webview_go: build constraints exclude all Go files in /Users/pritishmishra/go/pkg/mod/github.com/webview/webview_go@v0.0.0-20240220051247-56f456ca3a43

but the go build command works. if I do this go build .

my go env:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/pritishmishra/Library/Caches/go-build'
GOENV='/Users/pritishmishra/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/pritishmishra/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/pritishmishra/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/pritishmishra/Documents/Projects/sql-editor/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/60/92p0hs5x0v5fsfw5hfmpwbm80000gn/T/go-build4183224487=/tmp/go-build -gno-record-gcc-switches -fno-common'

go version: go version go1.22.1 darwin/arm64
g++ version: Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin23.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@terrywh
Copy link

terrywh commented Apr 1, 2024

same problem on windows.

> go build -ldflags="-H windowsgui" ./cmd/test
github.com/webview/webview_go: build constraints exclude all Go files in C:\Users\*\go\pkg\mod\github.com\webview\webview_go@v0.0.0-20240220051247-56f456ca3a43

after a while googling, using the following fix things for me (but only for a while 😭):

go clean -modcache

@W1M0R
Copy link

W1M0R commented May 22, 2024

You may also need to set the CGO_ENABLED=1 environment variable if you are doing cross-compilation. Also be sure to have the necessary cross-compilation toolchain on your system and that your CC and CCX environment variables are using the correct toolchains: #18 (comment)

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

No branches or pull requests

3 participants