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

Build fail on Darwin/arm64 because of libc dependency #122

Open
pavlov-tony opened this issue Feb 27, 2024 · 2 comments
Open

Build fail on Darwin/arm64 because of libc dependency #122

pavlov-tony opened this issue Feb 27, 2024 · 2 comments

Comments

@pavlov-tony
Copy link

go version
go version go1.22.0 darwin/arm64

I'm trying to build application but get this error:

go run main.go

../../../../../.asdf/installs/golang/1.22.0/packages/pkg/mod/modernc.org/[email protected]/libc_darwin.go:484:20: undefined: unix.Getcwd```

Did you test you library on Apple Silicon?
@pavlov-tony
Copy link
Author

Code for reproducing:

package main

import (
	"github.com/glebarez/sqlite"
	"gorm.io/gorm"
)

func main() {
	db, err := gorm.Open(sqlite.Open(":memory:?_pragma=foreign_keys(1)"), &gorm.Config{})
	if err != nil {
		panic(err)
	}
	_ = db
}

@lanpang
Copy link

lanpang commented May 13, 2024

go env -w CGO_ENABLED=0 go run main.go 

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

2 participants