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

chore(nix): bump nixpkgs to prevent glibc issues #2937

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

teto
Copy link
Contributor

@teto teto commented Jun 1, 2022

I've had errors with the current HLS built via nix since it uses an older
nixpkgs than mine with a different glibc

Unexpected usage error
/nix/store/lyl6nysc3i3aqhj6shizjgj0ibnf1pvg-glibc-2.34-210/lib/libc.so.6: undefined symbol: _dl_audit_symbind_alt, version GLIBC_PRIVATE

NB: Maybe I should add pre-commit to the devShell since I got:

`pre-commit` not found.  Did you forget to activate your virtualenv?

@guibou
Copy link
Collaborator

guibou commented Jun 1, 2022

Approved. The problem with this is that it will break nix flake for all users who are using older nixpkgs version.

A more robust solution would be to encourage users to use the nix flake follows feature.

Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new .pre-commit-config.yaml is a link into your nix store, which seems definitely wrong...

@guibou
Copy link
Collaborator

guibou commented Jun 1, 2022

To give a bit more context about this issue.

Nixpkgs bumped glibc to 2.34 where some symbols changed.

Nix flake provide reproducible build because HLS is set to use a specific nixpkgs. However a user of the HLS flack may use another version of nixpkgs, with incompatible glibc.

In theory, it is not a problem. However, HLS (built with glibc A) will try to communicate with ghc provided by the user using another nixpkgs with a different glibc, hence the symbol conflicts. I'm not too sure about how this happen (how does HLS call GHC?)

The follows feature allows user to force their nixpkgs to match HLS one (or the other way). In both cases there may be conflicts (i.e. different informations in nixpkgs), but at least user can handle that locally

@michaelpj
Copy link
Collaborator

I don't think the flake is really a reliable way of getting HLS installed on your system for this reason amongst others. Most users just install it from nixpkgs directly.

@teto
Copy link
Contributor Author

teto commented Jun 1, 2022

I had failed to see that the pre-commit hook was versioned. Seems like pre-commit is installed via nix develop .\#haskell-language-server-922-dev-nix (I probably ran initally just a nix develop .#haskell-language-server-922).

I don't think the flake is really a reliable way of getting HLS installed on your system for this reason amongst others. Most users just install it from nixpkgs directly.

When it comes to software installation, I find nix is the most reliable. but true historically (with HIE too) there has been glibc issues with HLS, not sure why. I sometimes need to fetch a HLS from master because of some bugfixes and flakes make it incredibly easy to test/update.

Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement regardless!

@michaelpj michaelpj merged commit 140f904 into haskell:master Jun 1, 2022
hololeap pushed a commit to hololeap/haskell-language-server that referenced this pull request Aug 26, 2022
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