godotengine / build-containers

Godot engine build containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binary compiled with Dockerfile.mono fails to run

ricardoalcantara opened this issue · comments

I have used build.sh and achieve to build all dockers images I needed then I ran:

docker run -it --rm \
--name build_mono \
-v $(pwd)/godot-master:/root/godot \
-v $(pwd)/build.linux.mono.glue.sh:/root/build.sh \
-w /root/ \
godot-mono-glue:master-mono-6.6.0.161 bash build.sh

docker run -it --rm \
--name build_mono \
-v $(pwd)/godot-master:/root/godot \
-v $(pwd)/build.linux.mono.sh:/root/build.sh \
-w /root/ \
godot-mono:master-mono-6.6.0.161 bash build.sh

build.linux.mono.glue.sh

cd godot
scons -j8 p=server tools=yes module_mono_enabled=yes mono_glue=no
bin/godot_server.x11.tools.64.mono --generate-mono-glue modules/mono/glue

build.linux.mono.sh

cd godot
scons -j8 p=x11 target=release_debug tools=yes module_mono_enabled=yes
cd bin
./godot.x11.tools.64.mono
./godot.x11.tools.64.mono: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./godot.x11.tools.64.mono)
./godot.x11.tools.64.mono: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./godot.x11.tools.64.mono)

System:
Distributor ID: Ubuntu
Description: Pop!_OS 18.04 LTS
Release: 18.04
Codename: bionic

docker --version
Docker version 19.03.5, build 633a0ea838

build-containers commit 6466947

The mono-glue container is based off of Fedora 31 and the resulting binary is only used to generate the mono glue from inside the container for reuse for next builds. There is no expectation that what gets built in those containers will run on the host, unless the host is also running Fedora 31.

The mono-glue should be generated inside the godot-mono container for reuse inside the older ubuntu containers to generate a proper build. The build scripts that automate this are not yet ready for public consumption, once they are this will be done for you.

I did not quit understand everything you said but could you share that script?

I tried to build mono glue inside godot-mono image and use it inside Ubuntu but it has failed too.

[Edit]
A also tried to build everything with ubuntu image but had the same problem

docker run -it --rm \
--name build_mono \
-v $(pwd)/godot-master:/root/godot \
-v $(pwd)/build.linux.mono.glue.sh:/root/godot/build.sh \
-w /root/godot/ \
godot-ubuntu-64:master-mono-6.6.0.161 bash

docker run -it --rm \
--name build_mono \
-v $(pwd)/godot-master:/root/godot \
-v $(pwd)/build.linux.mono.sh:/root/godot/build.sh \
-w /root/godot/ \
godot-ubuntu-64:master-mono-6.6.0.161 bash

in this case I run manually ./build.sh inside the container

I executed the binary and I had the same error with a different lib version:

$ ./godot.x11.opt.tools.64.mono 
./godot.x11.opt.tools.64.mono: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by ./godot.x11.opt.tools.64.mono)
./godot.x11.opt.tools.64.mono: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./godot.x11.opt.tools.64.mono)

Use the ubuntu dockers to build.

Your compiled binaries probably work fine, but your base system is too old.

GLIBCXX_3.4.22 -> Can't find glibc++ >=3.4.22, which is in the libstdc++6 package. The other message had GLIBCXX_3.4.26.

CXXABI_1.3.11 is also in libstdc++6.

The last message says it needs GLIBC_2.29, which is in libc6 and was released in January, 2019. Bionic (18.04 LTS) is only on 2.27.

Either upgrade your libc6 >=2.29 and libstdc++6 >= 3.4.26, or build with the ubuntu dockers.

Last time I used them in November it had Ubuntu 14 (trusty) which links against an old glibc 2.14. Confirm which versions of libc6 and libstdc++6 are in the docker vs in your system. The docker should be <=, as that's what it's going to link with and require.

So, if you are building Godot inside of the Ubuntu docker and yet the executable requires Glibc 2.29, then you did something wrong. The docker build script still references Ubuntu 14 (trusty), so must have glibc 2.14. There's no way it can be linking against 2.29.

I don't use the godot-mono, godot-mono-glue, godot-export, or godot-fedora dockers at all. I build for linux/windows/osx with and without mono.

Closing as it's not an issue with those containers. As mentioned, you need to build binaries against the oldest glibc version you want to support, and thus the oldest distro release you want to support, otherwise they won't be able to run on old distros.

@akien-mga I just don't understand how you use those containers, I built and used just like they came and I attempt to build godot using it and had those issues, how come you guys use this containers and don't have those issues, it may not be an issue for you, but there's also no explanations about the usage, I created a Dockerfile myself using the steps provided from the documentation about how to 'build on linux' and I achieve to build godot with it. You may close and leave this issue but I didn't get my answer =/.

These containers are not meant for general use currently. We'll publish a tool to use them when it's ready, but until now it's just documentation on what we actually use, not ready to use tools for end users.

What we do is that we build the Mono glue in the Fedora 31-based mono-glue container (which is also the base for the Windows and macOS containers), and we use that glue to build Linux binaries in the ubuntu-32 and ubuntu-64 containers (based on Ubuntu 14.04).
You can also build both the mono glue and the Linux binaries from the ubuntu-64/ubuntu-32 containers directly if you want.

I explained the challenges you ran into, but you didn't respond. Read the documentation I wrote which is sitting in Pr #12.