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

Try to link against an older glibc for releases #414

Closed
darosior opened this issue Apr 6, 2023 · 9 comments · Fixed by #1488
Closed

Try to link against an older glibc for releases #414

darosior opened this issue Apr 6, 2023 · 9 comments · Fixed by #1488
Assignees
Labels
Build system / Distribution Help wanted The author needs some help from external people or other contributors Nice to have If it's not completed in time for the current version, it can be postponed

Comments

@darosior
Copy link
Member

darosior commented Apr 6, 2023

The release build for Linux is a reproducible and bootstrappable one using Guix (see #140 and the documentation at contrib/reproducible/).

The glibc this build links against is Guix's gcc-toolchain which ships Glibc 2.33. Unfortunately, it's quite recent (February 2021) and some operating systems still only provide older glibc. See https://sourceware.org/glibc/wiki/Release for a table of glibc version per distribution version. I'd like to at least get Ubuntu Focal (Glibc 2.31) and Debian 10 (Glibc 2.28).

Unfortunately building against an older Glibc within the Guix container is non-trivial (to me). Another approach could be to link against musl (see #255).

The quickest solution for anyone running into an issue of the type:

./liana-gui: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./liana-gui)

Is to compile the project from source. There are instruction at doc/BUILD.md on how to do this reasonably. But you can also just use the simple (not really decent) way of installing the Rust toolchain from their website and build Liana like so (example for v1):

git clone https://github.com/wizardsardine/liana
cd liana/
git checkout v1.0
cd gui/
cargo run
@darosior darosior self-assigned this Apr 6, 2023
@darosior darosior added this to Liana v1 Apr 6, 2023
@darosior darosior moved this to Todo in Liana v1 Apr 12, 2023
@darosior darosior moved this from Todo to Nice to have in Liana v1 Apr 12, 2023
@darosior
Copy link
Member Author

darosior commented May 6, 2023

Removing from the 1.0 project. I've had another look at it and it is really non-trivial (to me) to build against an older glibc within the Guix container.

@darosior darosior removed this from Liana v1 May 6, 2023
@darosior darosior added the Help wanted The author needs some help from external people or other contributors label May 6, 2023
@DesobedienteTecnologico
Copy link

DesobedienteTecnologico commented May 7, 2023

As commented in this Merged PR #140 (comment) , I will try to get hands on it by next week. It doesn't see that trivial to fix.
I you fix it I will try to keep track on this PR.

Thanks!

@darosior
Copy link
Member Author

I've added details about this issue to the OP. Since it's been hit (as expected..) by a couple users already i've added troubleshooting instructions (basically you have to build from source).

I will try to get hands on it by next week

Good to hear. A PR for this would be very welcome. But note i do not want to compromise on reproducible and bootstrappable builds, so it has to happen within the Guix toolchain.

@Sosthene00
Copy link

Sosthene00 commented Jun 8, 2023

Hi, actually building from source doesn't always work either, I have Ubuntu 20.04 with glib 2.31 and I can build from source, but somehow the gui crash at startup with the following error:

$cargo run --release
/.../
     Running `target/release/liana-gui`
  2023-06-08T14:46:38.541243Z  INFO winit::platform_impl::platform::x11::window:147: Guessed window scale factor: 1.75

2023-06-08T14:46:38.541277Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1.75    
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
liana-gui: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

I could reproduce the issue on another machine that runs the same system.

It seems that the problem appears when I first build lianad and liana-cli, then build the gui. If I already built the daemon I need to cargo clean it first before building the gui.

Best I could track so far is that it was an issue with winit that was supposedly fixed by rust-windowing/winit#554, but was reported again later by other projects. Not sure what to do about it.
[[EDIT1]] minor edits for clarity

@DesobedienteTecnologico
Copy link

DesobedienteTecnologico commented Jun 29, 2023

Hi @darosior,

I have tried to for a while to change the GCC version. I success to install the correct version but it still install the new one and I think is because of Rust packages dependences. I will explain:

As you probably know, the different GCC versions uses different glibc versions too.
For example:

  1. TestVM
    image

  2. My PC
    image

In this line it tries to get the version 10.3.0 and as we can see here we have many other possibilities to get different versions.

image

To reach your goal we need at least the version 9.5.0. So I added [email protected] to the line commented before...
At compilation time, I can see that it downloads the right version, and even shows the correct glibc version needed, BUT at some point after getting working with Rust it download the new version. For that reason makes me think that some Rust dependence needs new version of glibc. (I need to check if there is a way to explicitly add glibc version to use in Rust)

Here I saw that you tried to get directly the Glibc version directly and I'm not sure it worked.
Same with rust glib:
image

At the time writing this I noticed that there are another versions...
image

Searcher: https://packages.guix.gnu.org/search/

I'm trying this time to time. Hope all I have written here, helps to push this a bit forward.

Regards :)

@darosior darosior moved this to Nice to have in Liana v2 Jul 13, 2023
@darosior darosior removed this from Liana v2 Aug 29, 2023
@darosior darosior moved this to Nice to have in Liana v3 Aug 29, 2023
@pythcoiner
Copy link
Collaborator

Hi, actually building from source doesn't always work either, I have Ubuntu 20.04 with glib 2.31 and I can build from source, but somehow the gui crash at startup with the following error:

$cargo run --release
/.../
     Running `target/release/liana-gui`
  2023-06-08T14:46:38.541243Z  INFO winit::platform_impl::platform::x11::window:147: Guessed window scale factor: 1.75

2023-06-08T14:46:38.541277Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1.75    
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
liana-gui: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

I could reproduce the issue on another machine that runs the same system.

It seems that the problem appears when I first build lianad and liana-cli, then build the gui. If I already built the daemon I need to cargo clean it first before building the gui.

Best I could track so far is that it was an issue with winit that was supposedly fixed by rust-windowing/winit#554, but was reported again later by other projects. Not sure what to do about it. [[EDIT1]] minor edits for clarity

look like #523

@darosior
Copy link
Member Author

darosior commented Oct 8, 2023

Discussed this with someone much more knowledgeable about Guix and it is indeed non-trivial, for what it's worth.

@darosior darosior removed this from Liana v3 Oct 18, 2023
@darosior darosior moved this to Nice to have in Liana v4 Oct 18, 2023
@pythcoiner
Copy link
Collaborator

any way to link against a static glibc?

@DesobedienteTecnologico

When I helped Rana to have binaries I tried also on that time to build Liana. CLI worked fine, but not GUI. For some reason it needed libc for a rust package as far I remember...
I had on mind, that I wrote this before when I tried it and seems I completely forgot.

Please, take a look what I did just in case you want to try (Is not using Guix as needed here) but is an approach to create the binaries.
grunch/rana#44 (comment)
grunch/rana#44 (comment)

Hope this help some how to push this a bit forward. Regards

@darosior darosior removed this from Liana v4 Dec 8, 2023
@darosior darosior added this to Liana v5 Dec 8, 2023
@darosior darosior moved this to Nice to have in Liana v5 Dec 8, 2023
@darosior darosior removed this from Liana v5 Mar 12, 2024
@darosior darosior moved this to Nice to have in Liana v6 Mar 12, 2024
@nondiremanuel nondiremanuel moved this to Nice to have in Liana General Jun 11, 2024
@nondiremanuel nondiremanuel removed this from Liana v6 Jun 11, 2024
@nondiremanuel nondiremanuel added the Nice to have If it's not completed in time for the current version, it can be postponed label Jun 19, 2024
@nondiremanuel nondiremanuel moved this from To be discussed / Defined to Todo in Liana General Jun 19, 2024
@nondiremanuel nondiremanuel added this to the Liana v7 milestone Jun 25, 2024
@nondiremanuel nondiremanuel removed this from the v7 - Liana milestone Jul 19, 2024
@nondiremanuel nondiremanuel moved this from Todo to In Progress in Liana General Nov 27, 2024
@nondiremanuel nondiremanuel moved this from In Progress to In Review in Liana General Nov 28, 2024
@nondiremanuel nondiremanuel moved this from In Review to Done in Liana General Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build system / Distribution Help wanted The author needs some help from external people or other contributors Nice to have If it's not completed in time for the current version, it can be postponed
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants