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

mod: update go version in go mod #2431

Closed
wants to merge 1 commit into from

Conversation

likzn
Copy link

@likzn likzn commented Aug 2, 2022

Main Change

For now, we use Go version 1.18.4 to build in makefile.
I think we can update go version in go mod to make it more clearer.

@likzn
Copy link
Author

likzn commented Aug 2, 2022

@evanw Hi, PTAL~

@evanw
Copy link
Owner

evanw commented Aug 2, 2022

No. Go 1.13 support is deliberate. It's for people that need it.

@evanw evanw closed this Aug 2, 2022
evanw added a commit that referenced this pull request Aug 2, 2022
@likzn likzn deleted the update_go_mod_version branch August 2, 2022 11:42
@likzn
Copy link
Author

likzn commented Aug 2, 2022

image
@evanw But i find go 1.18 still says that it requires macOS 10.13 or later. So maybe it will not break about old OS versions?

@evanw
Copy link
Owner

evanw commented Aug 2, 2022

There are versions of macOS older than macOS 10.13. See the link I already posted above: #2183

os: mac 10.12.6

@likzn
Copy link
Author

likzn commented Aug 2, 2022

@evanw Yes, I mean go1.18 and go1.13 are required the same version for macOS, both require macOS 10.13 or later. And i find you added a note. So for go1.18, this doesn't break the os version.

// Support for Go 1.13 is deliberate so people can build esbuild
// themselves for old OS versions. Please do not change this.

@evanw
Copy link
Owner

evanw commented Aug 2, 2022

both require macOS 10.13 or later

No. From https://go.dev/doc/go1.13:

As announced in the Go 1.12 release notes, Go 1.13 now requires macOS 10.11 El Capitan or later; support for previous versions has been discontinued.

@likzn
Copy link
Author

likzn commented Aug 2, 2022

As announced in the Go 1.12 release notes, Go 1.13 now requires macOS 10.11 El Capitan or later; support for previous versions has been discontinued.

Thanks. But in #2183 , his macOS is 10.12.6 , it is newer than macOS 10.11. But he build fails which is strange.

@likzn
Copy link
Author

likzn commented Aug 2, 2022

go directive https://go.dev/ref/mod#go-mod-file-go
A go directive indicates that a module was written assuming the semantics of a given version of Go

Hi, I think go directive in go mod only has an effect on syntax. For the used version of macOS, I think it is related to the version of the real go build. So for #2319, he will fail to compile, just because we are currently using go1.18 compiler to build and compile, so the version of macOS must be after 10.13. What do you think

@evanw
Copy link
Owner

evanw commented Aug 2, 2022

go directive in go mod only has an effect on syntax

That's the point. If you use new syntax from Go 1.18 (e.g. generics), then esbuild will fail to compile with Go 1.13. That's bad. Enforcing Go 1.13 syntax ensures esbuild can be compiled with Go 1.13.

So for #2319, he will fail to compile, just because we are currently using go1.18 compiler to build and compile, so the version of macOS must be after 10.13.

Official esbuild releases are done with Go 1.18 (now Go 1.19) but you can build it yourself using an older Go compiler if you have an older OS. You obviously wouldn't use Go 1.18 to build for macOS 10.12 because Go 1.18 doesn't support macOS 10.12.

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

Successfully merging this pull request may close these issues.

None yet

2 participants