userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.36k stars 272 forks source link

Link static all #579

Open root-kidik opened 3 months ago

root-kidik commented 3 months ago

-> - depends on glibc++ -> glibc -> kervel version

glibc2.39: minimum kernel version 3.2

Upgrade gcc: https://github.com/docker-library/gcc/blob/master/14/Dockerfile

Before: OS: Ubuntu14.04 Kernel version: 4.4 Compiler: gcc4.8.2 glibc: 2.23 (libc.so) glibc++: 2.23 +- (libc++.so) c++ standard: < 11

After manual upgrade: OS: Ubuntu14.04 Kernel version: 4.4 Compiler: gcc14.0.0 glibc: 2.39 (libc.so) glibc++: 2.39 +- (libc++.so) c++ standard: < 29 +- (accept c++23)

We must remove all find_package and add dependencies as submodule or CPM and compile

We can compile all with c++23 standard Link all static (include glibc)
Profit!

We can ship userver work with minimum kernel version 4.4

userver-all-linux-amd64.deb userver-all-linux-arm64.deb ~userver-all-macos-amd64.deb~ ~userver-all-macos-arm64.deb~

Pros: + control version of all dependencies (It won't happen that updating some dependency will break build, we can use latest version of all dependency) + we can stop thinking about supporting old versions of dependencies +++ user-friendly (anyone can download our single .deb and immediately write a microservice without worrying about missing any dependencies) + we will be able to get the same stacktraces absolutely everywhere + we can compile with any с++ standard

Cons: - if CVE is found in any dependency, we must manually update version with fixes this dependency, recompile and re-upload .deb - the first time it will take time