godotengine / build-containers

Godot engine build containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker.osx fails to build

TokisanGames opened this issue · comments

I put Xcode-10.3.xip in files/ then let it build godot-xcode-packer. Now my files/ also contains iPhoneOS12.4.sdk.tar.xz, iPhoneSimulator12.4.sdk.tar.xz, and MacOSX10.14.sdk.tar.xz.

Godot-osx fails here:

 /usr/bin/mkdir -p '/root/osxcross/target/share/man/man5'
 /usr/bin/install -c -m 644 'Mach-O.5' '/root/osxcross/target/share/man/man5/x86_64-apple-darwin17-Mach-O.5'
 /usr/bin/install -c -m 644 'a.out.5' '/root/osxcross/target/share/man/man5/x86_64-apple-darwin17-a.out.5'
 /usr/bin/install -c -m 644 'ranlib.5' '/root/osxcross/target/share/man/man5/x86_64-apple-darwin17-ranlib.5'
 /usr/bin/install -c -m 644 'stab.5' '/root/osxcross/target/share/man/man5/x86_64-apple-darwin17-stab.5'
make[2]: Leaving directory '/root/cctools-port/cctools/man'
make[1]: Leaving directory '/root/cctools-port/cctools/man'
make[1]: Entering directory '/root/cctools-port/cctools'
make[2]: Entering directory '/root/cctools-port/cctools'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/root/cctools-port/cctools'
make[1]: Leaving directory '/root/cctools-port/cctools'
you must run ./build.sh first before you can start building compiler-rt
Error: error building at STEP "RUN dnf -y install automake autoconf bzip2-devel clang git libicu-devel libtool libxml2-devel llvm-devel make openssl-devel patch scons xz bzip2 yasm && dnf clean all &&     git clone https://github.com/tpoechtrager/osxcross.git &&     cd /root/osxcross &&     ln -s /root/files/MacOSX10.14.sdk.tar.xz /root/osxcross/tarballs &&     UNATTENDED=1 ./build.sh ;    cd /root &&     git clone https://github.com/tpoechtrager/apple-libtapi.git &&     cd apple-libtapi &&     INSTALLPREFIX=/root/osxcross/target ./build.sh && ./install.sh &&     cd /root &&     git clone https://github.com/tpoechtrager/cctools-port.git &&     cd cctools-port/cctools/ &&     ./configure --prefix=/root/osxcross/target --target=x86_64-apple-darwin17 --with-libtapi=/root/osxcross/target &&     make -j && make install &&     cd /root &&     ln -fs /root/osxcross/target/bin/x86_64-apple-darwin17-install_name_tool /root/osxcross/target/bin/install_name_tool &&     ln -fs /root/osxcross/target/bin/x86_64-apple-darwin17-ar /root/osxcross/target/bin/ar &&     cd /root/osxcross/ &&     ./build_compiler_rt.sh &&     export CLANG_LIB_DIR=$(clang -print-search-dirs | grep "libraries: =" | tr '=' ' ' | tr ':' ' ' | awk '{print $2}') &&     mkdir -p ${CLANG_LIB_DIR}/include &&     mkdir -p ${CLANG_LIB_DIR}/lib/darwin &&     cp -rv /root/osxcross/build/compiler-rt/include/sanitizer ${CLANG_LIB_DIR}/include &&     cp -v /root/osxcross/build/compiler-rt/build/lib/darwin/*.a ${CLANG_LIB_DIR}/lib/darwin &&     cp -v /root/osxcross/build/compiler-rt/build/lib/darwin/*.dylib ${CLANG_LIB_DIR}/lib/darwin": error while running runtime: exit status 1

I'll step through the docker file and figure out what needs to happen in a day or two.

I began stepping through the docker.

There is a line here with a ; instead of && so the errors are skipped when running the whole thing. And probably why it says you need to run build.sh later on.

UNATTENDED=1 ./build.sh ;\

...
create_symlink /usr/bin/dsymutil x86_64-apple-darwin18-dsymutil
create_symlink /usr/bin/dsymutil x86_64h-apple-darwin18-dsymutil
create_symlink x86_64-apple-darwin18-wrapper xcrun
create_symlink x86_64-apple-darwin18-wrapper x86_64-apple-darwin18-xcrun
create_symlink x86_64-apple-darwin18-wrapper x86_64h-apple-darwin18-xcrun


Given SDK does not contain libc++ headers (-stdlib=libc++ test may fail)
You may want to re-package your SDK using 'tools/gen_sdk_package.sh' on OS X

testing o64-clang++ -stdlib=libc++ -std=c++11 ... failed (ignored)

testing o64-clang ... osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target

exiting with abnormal exit code (1)
run 'OCDEBUG=1 ./build.sh' to enable debug messages

Also their build.sh already clones these two repositories:

git_clone_repository https://github.com/tpoechtrager/apple-libtapi.git 1000.10.8 apple-libtapi
git_clone_repository https://github.com/tpoechtrager/cctools-port.git 927.0.2-ld64-450.3 cctools-port

which makes these lines in the Docker.osx file redundant:

git clone https://github.com/tpoechtrager/apple-libtapi.git
git clone https://github.com/tpoechtrager/cctools-port.git

I recently went through the osxroot instructions outside of a docker and they were very simple: just run ./build.sh.

I built this binary with those instructions, using Xcode-11.2, MacOSX sdk 10.15, and darwin19. I had an OSX user able to run it just fine on OSX10.14.

Built on ubuntu with gcc 8.3.0. My only issue was that I couldn't build as a user. I had to build as root. I and the project maintainer didn't figure out why, but also stopped looking.

It seems that osxcross recently got updated. The lines you say are redundant are there because previously osxcross did not function with anything newer than xcode 7 :) I'll switch to this new fixes osxcross then it should all just work.

Sounds good.