-
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
cmd/go: consider matching newly added _goos.go, _goarch.go or _goos_goarch.go suffixes based on go.mod go version (rather than Go toolchain version only) #44626
Comments
Yes, I'm not sure whether it makes sense to adjust this based on the language in the go.mod file. That is more intended for language changes, and this is not a language change. This is going to be a surprising change no matter when it happens, and I don't see why it is better for it to happen when the language version is updated than when updating to a new release. |
Change https://golang.org/cl/296849 mentions this issue: |
Thanks! I think the documentation clarification CL is helpful.
Reading the compatibility promise again, I do see that although it says " It is intended that programs written to the Go 1 specification will continue to compile and run correctly, unchanged, over the lifetime of that specification.", it seems like the specification does not mention build tags or which files are included in a build at all. This was very surprising to me!
The main advantage of having this based on the go.mod version number is that if I depend on any modules that have such files my app will continue to build even as I upgrade the compiler version (the build tag proposal handles this problem by leaving the old syntax as valid forever, but that's not an option here)
…On Fri, Feb 26, 2021 at 7:27 AM, GopherBot < ***@***.*** > wrote:
Change https:/ / golang. org/ cl/ 296849 ( https://golang.org/cl/296849 ) mentions
this issue: _content/doc/go1.16: explicit point out ios as a build tag
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (
#44626 (comment) ) , or unsubscribe
(
https://github.com/notifications/unsubscribe-auth/AAAXAQGCOJCW7JH7KH2ZLZDTA64UVANCNFSM4YH2HJGQ
).
|
I agree this is working as intended, and it's consistent with the behavior when new GOOS/GOARCH values were reserved in the past. Since this issue is still open, I've added a NeedsInvestigation label so it can be used to determine if anything should be done differently in the future (e.g., evaluate whether it'd be better to tie the change to go.mod's version as you suggested). CC @bcmills, @matloob, @jayconrod. |
The Changing the interpretation of an existing filename (from a non-constraint to a constraint or vice-versa) seems like it is pretty clearly a redefinition (in the sense of http://golang.org/design/28221-go2-transitions#language-redefinitions). On the other hand, it would be really confusing to apply the implicit constraints for certain I don't think there are any good options here. |
We made an effort to add all plausible CPU values to the list of valid |
For golang/go#44626 For golang/go#40700 Change-Id: I42c064f1d7a7bda42cd1de161a923720021eeda5 Reviewed-on: https://go-review.googlesource.com/c/website/+/296849 Trust: Ian Lance Taylor <iant@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
For golang/go#44626 For golang/go#40700 Change-Id: I42c064f1d7a7bda42cd1de161a923720021eeda5 Reviewed-on: https://go-review.googlesource.com/c/website/+/296849 Trust: Ian Lance Taylor <iant@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
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 upgraded to
go1.16
and rango test
.What did you expect to see?
No failures
What did you see instead?
My build failed because I had a file called
send_log_ios.go
. In go before 1.16, this file was included in the build (because there was no ios build tag). In go 1.16 this file is excluded from the build because it assumed to match theios
build tag.My
go.mod
still listsgo 1.15
.This is not a problem for me (I can just rename the file), but I do think this is surprising and a breakage of the go1 compatibility promise – a program that used to build no longer builds because I upgraded my version of go.
I would propose that this change should only happen in module mode if I change the version in
go.mod
.The text was updated successfully, but these errors were encountered: