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

Make glibc static for Linux builds #2284

Closed
ReinerBforartists opened this issue Mar 11, 2021 · 19 comments
Closed

Make glibc static for Linux builds #2284

ReinerBforartists opened this issue Mar 11, 2021 · 19 comments
Assignees
Labels
0 - task A normal development task 1- Fixed This task is fulfilled

Comments

@ReinerBforartists
Copy link
Contributor

I compile at Ubuntu. And i always keep the environment up to date. Latest Ubuntu version is 20.10

We have currently the problem that Ubuntu 20.10 has a newer glibc version than many other Linux distributions. And so our build just runs at linux distributions that has similar or higher glibc version. And errors out at linux distributions that has a lower glibc version installed. Even Ubuntu 20.04 is not to convince to start Bforartists.

We might drag this problem with us with every new Ubuntu version. And staying at older Ubuntu versions is no option really.

So the idea was to include glibc into the Bforartists binary as a static library.

Another idea is to bypass this problem by creating a snap or a appimage or flatpak package. They come with static libraries by design. I always failed so far though to create such a package.

@ReinerBforartists ReinerBforartists added the 0 - task A normal development task label Mar 11, 2021
@ReinerBforartists ReinerBforartists self-assigned this Mar 11, 2021
@ghost
Copy link

ghost commented Mar 11, 2021

Wouldn't running an environment with a lower glibc be easier?
Like a Virtual Machine or a container

@ReinerBforartists
Copy link
Contributor Author

ReinerBforartists commented Mar 11, 2021

Too late, i have already udpated to 20.10 :)
It takes some days to set up yet another Ubuntu version. And as told, we drag the problem with us with every new Ubuntu version then. So the better option is to make it compatible instead :)

@ReinerBforartists
Copy link
Contributor Author

Not sure if related. But i got some warning in cmake when setting up with static. Blender devs have updated the libs lately ...

cmakemecker

@ReinerBforartists
Copy link
Contributor Author

As a note, the current Ubuntu developer version is compiled at Ubuntu 20.04 again. I found an old intact vm ...

@ReinerBforartists
Copy link
Contributor Author

Unassigning for now.

@ReinerBforartists ReinerBforartists removed their assignment Mar 20, 2021
@seanr
Copy link
Collaborator

seanr commented Mar 31, 2021

There is code in the repo for build environments and buildbots. Shouldn't we ultimate look into implementing that? I'm not sure what the infrastructure requirements are for that, but in an ideal world, we'd be doing this the same way upstream Blender does.

@ghost
Copy link

ghost commented Mar 31, 2021

I searched a bit and it seems statically linking glibc is not a good idea, we should just build with a system with same glibc version as officialimage

https://stackoverflow.com/questions/57476533/why-is-statically-linking-glibc-discouraged

https://wiki.blender.org/wiki/Building_Blender/Linux/Generic_Distro

@naetherm
Copy link
Contributor

There is code in the repo for build environments and buildbots. Shouldn't we ultimate look into implementing that? I'm not sure what the infrastructure requirements are for that, but in an ideal world, we'd be doing this the same way upstream Blender does.

I am actually working on that issue. The official Blender binaries are, as @iyadahmed quoted, built on a RHEL7 version. For that to work I am building a CentOS 7 docker image, producing all relevant cmake packages.

@ghost
Copy link

ghost commented Apr 10, 2021

As a note I recently did a build on Debian, documented steps in the process, I also found this interesting project

https://github.com/wheybags/glibc_version_header

@ReinerBforartists
Copy link
Contributor Author

Phew, i am lost with this one. But definitely an interesting find :)

@ghost
Copy link

ghost commented Apr 10, 2021

Phew, i am lost with this one. But definitely an interesting find :)

Indeed, but again I think we stick to original plan of compiling on same system as Blender

@ReinerBforartists
Copy link
Contributor Author

ReinerBforartists commented Apr 10, 2021

Yes, naetherm has created a docker now, based on CentOS. We are currently at testing it :)

@ghost
Copy link

ghost commented Apr 10, 2021

Awesome

@ReinerBforartists
Copy link
Contributor Author

The tar version is now up in the developer build download section https://www.bforartists.de/download/

https://www.bforartists.de/data/dev/centos-devbuild-08-04-2021.tar.xz

The deb has still a little problem at the moment. It does not add a starter icon. Means you have to navigate to the folder and start it from there, or you need to start it from the console. But when everything else fails then i can do the deb packing at Ubuntu. This way already works with a starter icon. But that's future music. The developer builds are tars. Just he final version comes as a deb.

@ReinerBforartists ReinerBforartists added the 4 - needs work Needs further work. Usually for reassigning a task, or having a break from a task. label Apr 14, 2021
@ghost
Copy link

ghost commented May 26, 2021

@ReinerBforartists
Copy link
Contributor Author

Thanks for the link :)

@naetherm
Copy link
Contributor

Useful

https://developer.blender.org/P1013

Completely out of date. The devtoolset 6 cannot be used for building blender/bforartists as it requires at least version 9 (if I remember it correctly).
The provided script does also nothing more than installing python, cmake, and some more required libraries.
My centos docker container is already working and produces all packages (TGZ, TXZ, DEB), I just have to clean up the Dockerfile and write some more documentation around it.

@ghost
Copy link

ghost commented May 27, 2021

Useful

https://developer.blender.org/P1013

Completely out of date. The devtoolset 6 cannot be used for building blender/bforartists as it requires at least version 9 (if I remember it correctly).

The provided script does also nothing more than installing python, cmake, and some more required libraries.

My centos docker container is already working and produces all packages (TGZ, TXZ, DEB), I just have to clean up the Dockerfile and write some more documentation around it.

Ah ok I just got it from Blender devs, didn't notice the problems

@ReinerBforartists
Copy link
Contributor Author

Completely forgotten about this issue. I will close this issue now. Mnaether has a working docker solution. And he will at least compile the release versions with it. We are also back at Ubutu 20.04 for compiling the devbuild. Means this task is fulfilled. Thanks friends :)

@ReinerBforartists ReinerBforartists added 1- Fixed This task is fulfilled and removed 4 - needs work Needs further work. Usually for reassigning a task, or having a break from a task. labels Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - task A normal development task 1- Fixed This task is fulfilled
Projects
None yet
Development

No branches or pull requests

3 participants