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

Link static all #579

Open
4 tasks
root-kidik opened this issue May 10, 2024 · 0 comments
Open
4 tasks

Link static all #579

root-kidik opened this issue May 10, 2024 · 0 comments

Comments

@root-kidik
Copy link
Contributor

root-kidik commented May 10, 2024

-> - 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

  • curl
  • protobuf
  • grpc
  • ...

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant