Closed tao12345666333 closed 4 years ago
@thaJeztah Thanks for you point. :+1:
Thank you!
Before merging, I'd like to build this locally, and test cross compile for macOS (to be sure the new value works 🤗)
Hm... wondering if this is gonna work; looking at https://github.com/docker/golang-cross/blob/03f58e718a7f632b8c401e39179fa258b7a1261c/osx-cross.sh#L23
(which corresponds with MacOS 10.10) 🤔
ok; https://formulae.brew.sh/formula/libtool looks like the codename should be el_capitan
(I tried it without an underscore initially.
Gonna try it locally first
Tried building with el_capitan
as codename, and looks like there's issues;
Wondering if it's because OSX_SDK=MacOSX10.10.sdk
, but could also be due to the bump to Buster; trying again with stretch now
edit: actually; let me first try FROM golang:1.12.9-buster
to see if it did build before the Go 1.13 bump
I haven't used macOS for a long time, sorry, I ignored this message.
I just tested the build on another mac OS 1.13 and got a similar error to you.
And I try to update OSX_SDK=MacOSX10.10.sdk
for test. :crying_cat_face:
Tried building with golang:1.12.9-buster
and get the same error; now trying again with setting the MacOs version back (but it might be related to the bump from stretch to buster)
Having dinner in a bit, so might be back later 😂
When I build using golang:1.12.9
from master branch. I get the same error, but It can be built successfully.
In file included from macho_relocatable_file.cpp:46:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/memory:80:
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/unique_ptr.h:81:2: warning: delete called on non-final 'ld::Bitcode' that has virtual functions but non-virtual destructor [-Wdelete-non-virtua
l-dtor]
delete __ptr;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/unique_ptr.h:274:4: note: in instantiation of member function 'std::default_delete<ld::Bitcode>::operator()' requested here
get_deleter()(__ptr);
^
macho_relocatable_file.cpp:76:12: note: in instantiation of member function 'std::unique_ptr<ld::Bitcode, std::default_delete<ld::Bitcode> >::~unique_ptr' requested here
File(const char* p, time_t mTime, const uint8_t* content, ld::File::Ordinal ord) :
^
macho_relocatable_file.cpp:1721:14: note: in instantiation of member function 'mach_o::relocatable::File<x86_64>::File' requested here
_file = new File<A>(_path, _modTime, _fileContent, _ordinal);
^
macho_relocatable_file.cpp:992:26: note: in instantiation of member function 'mach_o::relocatable::Parser<x86_64>::parse' requested here
return p.parse(opts);
^
macho_relocatable_file.cpp:7761:49: note: in instantiation of member function 'mach_o::relocatable::Parser<x86_64>::parse' requested here
return mach_o::relocatable::Parser<x86_64>::parse(fileContent, fileLength, path, modTime, ordinal, opts);
^
In file included from textstub_dylib_file.cpp:30:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/memory:80:
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/unique_ptr.h:81:2: warning: delete called on non-final 'ld::Bitcode' that has virtual functions but non-virtual destructor [-Wdelete-non-virtua
l-dtor]
delete __ptr;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/unique_ptr.h:274:4: note: in instantiation of member function 'std::default_delete<ld::Bitcode>::operator()' requested here
get_deleter()(__ptr);
^
./generic_dylib_file.hpp:123:7: note: in instantiation of member function 'std::unique_ptr<ld::Bitcode, std::default_delete<ld::Bitcode> >::~unique_ptr' requested here
class File : public ld::dylib::File
^
textstub_dylib_file.cpp:684:14: note: in instantiation of member function 'textstub::dylib::File<x86_64>::File' requested here
return new File<A>(fileContent, fileLength, path, mTime, ordinal,
^
textstub_dylib_file.cpp:725:28: note: in instantiation of member function 'textstub::dylib::Parser<x86_64>::parse' requested here
return Parser<x86_64>::parse(fileContent, fileLength, path, modTime, ordinal, opts, indirectDylib);
^
1 warning generated.
1 warning generated.
1 warning generated.
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
Installing libtool from brew
Removing intermediate container 0c78645cae55
---> 79783c85495e
Step 7/7 : ENV PATH /osxcross/target/bin:$PATH
---> Running in 666403bfc351
Removing intermediate container 666403bfc351
---> 666e0df4b8a9
Successfully built 666e0df4b8a9
Successfully tagged golang-cross:latest
Oh, forgot to post; yes, current master shows warnings, but doesn't fail (not sure if it's just different in reporting warnings as a non-zero exit code?)
had a script running to check what combinations built and what not, and looks that it's the 10.10
-> 10.11
change that's the trouble one. Wondering if we need a new version of the package at s3.dockerproject.org
Result | Base Image | OSX_VERSION_MIN | OSX_CODENAME |
---|---|---|---|
:white_check_mark: | golang:1.12.9-stretch |
10.10 | yosemite |
:white_check_mark: | golang:1.12.9-stretch |
10.10 | el_capitan |
:x: | golang:1.12.9-stretch |
10.11 | el_capitan |
:white_check_mark: | golang:1.12.9-buster |
10.10 | yosemite |
:white_check_mark: | golang:1.12.9-buster |
10.10 | el_capitan |
:x: | golang:1.12.9-buster |
10.11 | el_capitan |
:white_check_mark: | golang:1.13.0-buster |
10.10 | yosemite |
:white_check_mark: | golang:1.13.0-buster |
10.10 | el_capitan |
:x: | golang:1.13.0-buster |
10.11 | el_capitan |
@kolyshkin IIRC you last updated that package, or did I recall incorrectly? (not sure how it was constructed)
Actually; still trying some other things; I noticed https://github.com/tpoechtrager/osxcross.git was quite a bit behind current master; updating and testing with current master
@ndeloof pushed my "scratch" work, and opened as a PR (for easier sharing, and so that others could comment on that); https://github.com/docker/golang-cross/pull/42
For future reference; looks like I made the wrong assumption that the current version was still based on stretch
, but it looks like the current version (dockercore/golang-cross:1.12.9
) on Docker Hub has already switched to buster
, so none of the issues we're running into should be related to the switch from debian stretch to debian buster
I get a successful build with https://github.com/ndeloof/golang-cross/tree/113fix I had to re-create a 10.11 SDK downloading XCode and using osxcross script. I committed in my fork for convenience, but for legal reason we can't "redistribute" this way. I'm looking into writing a script to automate this step.
I created a Dockerfile to download XCode and build SDK https://github.com/ndeloof/golang-cross/blob/113fix/SDK.Dockerfile not fully tested as XCode takes ages to download with my Internet connexion
Replaced by #45 .
Thanks for @ndeloof 's SDK.
Signed-off-by: Jintao Zhang zhangjintao9020@gmail.com
Go 1.13 is a major release of Go.
Full diff here https://github.com/golang/go/compare/go1.12.9...go1.13
All tracking issues https://github.com/golang/go/milestone/83?closed=1