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

cmd/link: minimum macOS version changed going from 1.12.5 to 1.12.9 #33968

Closed
bep opened this issue Aug 30, 2019 · 16 comments
Closed

cmd/link: minimum macOS version changed going from 1.12.5 to 1.12.9 #33968

bep opened this issue Aug 30, 2019 · 16 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@bep
Copy link
Contributor

bep commented Aug 30, 2019

I guess this relates to 4cd6c3b

  • Reading the error message below (was built for newer OSX version (10.10) than being linked (10.9)) vs 4cd6c3b#diff-f44dab9aab3c3c3aaff916e6bb1fb763R418 does not line up.
  • Upping the min OSX version in my build script to 10.10 removes the warning (but the build still fails, I need to investigate more on that).

Note that I did not open up this issue to fix my particular problem (I will eventually figure that out), but more of a "heads up" issue. Reading the issues surrounding 4cd6c3b I see a lot of the same guesswork that I'm doing in this area and my own guessing tells me that this change was unintentionally a little too big for a patch release.

  • building                  binary=dist/hugo_extended_darwin_darwin_amd64/hugo
   ⨯ release failed after 329.09s error=failed to build for darwin_amd64: # crypto/x509
ld: warning: object file (/tmp/go-build936638053/b091/_cgo_main.o) was built for newer OSX version (10.10) than being linked (10.9)
ld: warning: object file (/tmp/go-build936638053/b091/_x001.o) was built for newer OSX version (10.10) than being linked (10.9)
ld: warning: object file (/tmp/go-build936638053/b091/_x002.o) was built for newer OSX version (10.10) than being linked (10.9)
# github.com/wellington/go-libsass/libs
In file included from unity.cpp:4:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libs/../libsass-build/ast.cpp:2:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libsass-build/ast.hpp:14:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libsass-build/ast_fwd_decl.hpp:11:
In file included from /usr/local/osx-ndk-x86/bin/../SDK/MacOSX10.11.sdk/usr/include/c++/v1/unordered_map:369:
@ianlancetaylor ianlancetaylor changed the title Hugo release build fails when going from Go 1.12.5 go 1.12.9 cmd/link: minimum macOS version changed going from 1.12.5 to 1.12.9 Aug 30, 2019
@ianlancetaylor
Copy link
Contributor

In the discussion on #30448 people requested the the minimum version be increased on the 1.12 branch. Here you are suggesting that that should not have happened. I don't know what is best.

CC @eliasnaur @pieterclaerhout @networkimprov @macetw : discuss.

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Aug 30, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.12.10 milestone Aug 30, 2019
@bep
Copy link
Contributor Author

bep commented Aug 30, 2019

people requested the minimum version be increased on the 1.12 branch. Here you are suggesting that that should not have happened.

To be accurate, I suggest two things:

  1. You got the numbering wrong and increased it one version too far up somewhere. I know a little too little about this to state any absolute.
  2. Given that this has prevented real projects (I'm still working on it) to update to Go 1.12.9 (a security patch), in retrospect I think that commit should not have been backported. But this relates to 1).

@eliasnaur
Copy link
Contributor

@iant, I believe you mean issue #30488.

The fix for #30488 bumped the minimum version to 10.9, not 10.10. What is setting the 10.10 minimum?

@networkimprov
Copy link

networkimprov commented Aug 30, 2019

That change was necessary for binaries to be acceptable in the Mac App Store, which is why it landed in a bugfix release. There is a reminder issue for future reference at #31918.

@bep can you give steps to reproduce (and fix) your problem?

@cherrymui
Copy link
Member

I'm not sure CL https://go-review.googlesource.com/c/go/+/175918 (commit 4cd6c3b) is related. It seems that CL only affects internal linking mode, i.e. using the Go linker, instead of the system linker. But the warning in this issue is from ld, the system linker, which suggests it is using external linking mode.

@pieterclaerhout
Copy link

Isn't this actually an issue on the CGO side? My wild guess is that CGO is linking against 10.10 while the normal Go builds are linking against 10.9 hence the error message…

@pieterclaerhout
Copy link

The system linker on macOS has the following option to define this from whjat I can find:

-compatibility_version number
            Specifies the compatibility version number of the library.  When a library is loaded by dyld, the compatibility version is checked and if
            the program's version is greater that the library's version, it is an error.  The format of number is X[.Y[.Z]] where X must be a posi-
            tive non-zero number less than or equal to 65535, and .Y and .Z are optional and if present must be non-negative numbers less than or
            equal to 255.  If the compatibility version number is not specified, it has a value of 0 and no checking is done when the library is
            used.  This option is also called -dylib_compatibility_version for compatibility.

@FiloSottile FiloSottile modified the milestones: Go1.12.10, Go1.12.11 Sep 25, 2019
@ianlancetaylor
Copy link
Contributor

I don't understand this issue. When linking a Go program that uses cgo, the Go linker will generate a Macho-O object file that is marked as requiring macOS release version 10.9. The error that you are reporting says that the C linker wants to generate code for macOS 10.9, but is seeing C code that was marked as requiring macOS 10.10.

But this seems to be entirely a problem with the C toolchain: the compiler says it needs 10.10, the linker says that it expects 10.9. I don't understand what Go has to do with it. I particularly don't understand what https://golang.org/cl/175918 has to do with it; that CL changes the minimum requirement from 10.7 to 10.9. The problem you are seeing is that the C toolchain is requiring 10.10, so both 10.7 and 10.9 should be fine.

How sure are you that https://golang.org/cl/175918 is the problem?

Is there a way that we can reproduce the problem ourselves?

Thanks.

@dmitshur
Copy link
Contributor

dmitshur commented Oct 8, 2019

I'll move this issue to WaitingForInfo state, because we can't proceed with investigating it without more information. I'll also remove release-blocker, as it doesn't need to block the release of Go 1.12.11 in the current state.

@dmitshur dmitshur added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Oct 8, 2019
@macetw
Copy link

macetw commented Oct 8, 2019 via email

@networkimprov
Copy link

@macetw the issue is waiting for info from @bep. Are you writing on his behalf?

We established that this issue is probably unrelated to #30488, which you filed, and is fixed.

@ianlancetaylor
Copy link
Contributor

@macetw Thanks. The error reported in the original bug report here was pretty clearly from a cgo build. Are you sure you are seeing the same problem? Do you have instructions for how to recreate it?

@katiehockman katiehockman modified the milestones: Go1.12.11, Go1.12.12 Oct 17, 2019
@toothrot toothrot modified the milestones: Go1.12.12, Go1.12.13 Oct 17, 2019
@networkimprov
Copy link

Looks like a dup of #22281 & #35193

@andybons andybons modified the milestones: Go1.12.13, Go1.12.14 Oct 31, 2019
@bep
Copy link
Contributor Author

bep commented Nov 1, 2019

@networkimprov I have nothing to add here. I fixed on my end by updating from Mac OS SDK 10.11 to 10.12. This works fine, but it's unfortunate that this happens in a patch release.

@cagedmantis cagedmantis removed this from the Go1.12.14 milestone Dec 4, 2019
@cagedmantis
Copy link
Contributor

This is a duplicate issue. We will track further progress for this issue in #22281.

@networkimprov
Copy link

Most activity on this issue is now on #36025

@golang golang locked and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests