-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
syscall: Under FreeBSD Stat_t field names (eg Ctimespec) have changed in a backwards incompatible way #29393
Comments
The breaking change is mentioned in dc6eb20
I see there was some discussion of this in https://go-review.googlesource.com/c/go/+/138595
;-) |
I made a patch to a8m/tree to see what it looked like to work around this - it turns out it isn't too ugly. Renaming the diff --git a/csort_bsd.go b/csort_bsd.go
index f5895a6..50a769b 100644
--- a/csort_bsd.go
+++ b/csort_bsd.go
@@ -1,4 +1,4 @@
-//+build darwin freebsd netbsd
+//+build darwin freebsd,!go1.12 netbsd
package tree
diff --git a/csort_unix.go b/csort_unix.go
index 6acd092..eead420 100644
--- a/csort_unix.go
+++ b/csort_unix.go
@@ -1,4 +1,4 @@
-//+build linux openbsd dragonfly android solaris
+//+build linux openbsd dragonfly android solaris freebsd,go1.12
package tree
|
See discussion in golang/go#29393 also.
These names were introduced more than 8 years ago: And the syscall structs are semi-automatically generated from the C headers. |
According to the go compatibility promise
I read this as the syscall package is frozen from go 1.4 so backwards incompatible changes should not be introduced unless absolutely necessary. Personally speaking, I'm easy either way, but I'd like this issue to have a statement from the go team so when go1.12 is released and it breaks people's programs, they will have have some rationale to read. Cc: @bradfitz since he reviewed the original CL. |
It's not actually clear to me why we changed the names of the |
I'm slightly in favor of renaming them back. But since some fields are necessarily changing anyway, I didn't fight too much breaking some other fields while we're at it. (People who use syscall are due for some pain in any case.) But we could reduce some of it here. |
Change https://golang.org/cl/155958 mentions this issue: |
@ianlancetaylor we were carrying our own hard-coded version of FreeBSD 12 introduces a I've sent a CL to rewrite them back using mkpost.go. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to run the compilation tests of https://github.com/a8m/tree to find out why it wasn't compiling under go1.12beta1
What did you expect to see?
I expected it to compile
What did you see instead?
None of the FreeBSD architectures compiled.
Digging into this I can see the
Stat_t
type has changed from go1.11 to go1.12beta1This is mentioned in the draft release notes
The changes to the types seem reasonable, however the change to the names of
Atimespec
,Mtimespec
,Ctimespec
seem like gratuitous breaking changes - the types are the same as previously, if the names had been left the same then the program above would have compiled just fine!Can these be changed back?
The text was updated successfully, but these errors were encountered: