-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Using // +build directives does not show unknown syscall.Stat_t build error #24005
Comments
Sorry, this looks like a bug in go-git (or simply lack of plan9 support in go-git). But there's nothing owned by the Go project here, so closing this bug. I suggest you file this bug at .... oh, you already did: src-d/go-git#756 That's the right place. |
Is the issue not with the //+build not finding the syscall.Stat_t? The lack of support in go-git is not the issue I'm pointing out here. Should //+build if not given a target for a platform (in this case plan9) build the usage of syscall.Stat_t in without throwing an error? |
I don't know what this question means. But I imagine if you read https://golang.org/pkg/go/build/#hdr-Build_Constraints you'll see how it works. For questions about Go, see https://golang.org/wiki/Questions. |
My apologies for the lack of clarity. I have made a simpler proof of concept: https://github.com/henesy/buildpoc In the state that the linked demo is in, if built, it yields:
If we delete test_plan9.go (leaving the only built file as test_linux.go) then the build completes as follows:
If we then go up to the base folder we get a successful build, but running will fail:
|
That's not true and that's why you're confused. Look at And read the URL I sent you before. (https://golang.org/pkg/go/build/#hdr-Build_Constraints) For questions about Go, see https://golang.org/wiki/Questions. |
The list output clarified the situation for me, I had not read the build doc closely enough, thank you. My apologies for the noise. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.10 plan9/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
I ran/built https://github.com/src-d/go-git with a patch on the https://github.com/src-d/go-billy dependency as per src-d/go-billy#52.
If you
go install
go-git without any changes, the library builds and you can then build the demo programs ingo-git/_examples
clone.go and commit.go successfully. Clone will run successfully, but if you build and run commit you get the following crash error:If you copy the linux worktree file as follows in go-git and change the header to
// +build plan9
, the compiler catches the error:cp worktree_linux.go worktree_plan9.go
What did you expect to see?
A compiler error pointing out that
syscall.Stat_t
is not present on Plan 9.What did you see instead?
No errors at build time. Running the program results in a crash with an error.
The text was updated successfully, but these errors were encountered: