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

Explicitly build on Ubuntu 20.04 #54

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

jorgenpt
Copy link
Contributor

ubuntu-latest maps to 22.04, which uses a more modern libstdc++ (and libc), which is too new for the binary to run on Ubuntu 20.04 (which is still under LTS).

This fixes the following error:

./ScoreDataExtractor: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by ./ScoreDataExtractor)

`ubuntu-latest` maps to 22.04, which uses a more modern libstdc++ (and
libc), which is too new for the binary to run on Ubuntu 20.04 (which is
still under LTS).

This fixes the following error:

```
./ScoreDataExtractor: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by ./ScoreDataExtractor)
```
@Viladoman
Copy link
Owner

I don't understand the fix. If the issue is that ubuntu-latest maps to 22.04, how is the change to ubuntu-22.04 making any difference. On top of that, I think we should rather fix the action/code to work with the latest changes instead of getting stuck to a fixed version.

Maybe I am misunderstanding something. What are your thoughts?

@jorgenpt
Copy link
Contributor Author

jorgenpt commented Apr 2, 2024

@Viladoman I am specifying 20.04, not 22.04 -- so we're building on the previous (still-supported) LTS of Ubuntu, rather than the most recent LTS. The problem here is that when you're building against libstdc++ and libc on Linux systems, the resulting binary will depend on the installed version of those. So systems with an older version will not be able to load the executable. That means that your released executable isn't compatible with Ubuntu 20.04 LTS, which is officially supported by Canonical for another year and quite widespread.

It's not trivial to explicitly depend on an older version of these, since these are system-wide packages. As far as I know, the easiest way to accomplish this is building on an older distribution, for example via a docker container or a chroot.

Creating redistributable binaries for Linux can be a bit of a pain. :(

There are projects like e.g. https://github.com/phusion/holy-build-box that provide a Docker container specifically intended for letting you build in an isolated environment with older dependencies. GitHub actions allows you to run your build inside a docker container when needed.

@Viladoman
Copy link
Owner

Thanks for the explanation! I totally missed the 20.04. That makes sense. Then I guess moving forward it would make sense to have multiple ubuntu verisons generated, at least when transitions like this are happening.

@Viladoman Viladoman merged commit 9f72bc1 into Viladoman:master Apr 2, 2024
4 checks passed
@Trass3r
Copy link
Contributor

Trass3r commented Apr 2, 2024

Yeah it's painful. You can use a matrix with different OSes, just need to name the artifacts differently or they silently overwrite each other.

https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs

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

Successfully merging this pull request may close these issues.

3 participants