Setting LD_LIBRARY_PATH for Nix dev shells might be bad advice

Ouverte
#6,331 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
28/100
Type d'issue
Documentation
Clarté
À clarifier
Activité
À l'abandon
Stack technique
haskell, nixos
Domaine
documentation

Piste de recherche

Commencez par la section Supporting both Nix and non-Nix developers de la page de documentation liée, puis reproduisez l’interaction signalée entre devShell, nix develop et direnv. Étudiez les indications concernant LD_LIBRARY_PATH ainsi que l’approche suggérée avec --extra-lib-dirs et --extra-include-dirs ; le travail est terminé lorsque la documentation ne recommande plus une configuration qui casse des outils sans rapport et explique une alternative vérifiée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

component: nix
Location of the documentation

https://docs.haskellstack.org/en/stable/nix_integration/#supporting-both-nix-and-non-nix-developers

Is it inaccurate?

I currently have a devShell in a flake.nix defined along the lines of the docs linked above. This works well for building and running the project, but interacts poorly with nix develop and direnv: tools not specified in the devshell will break because of libc version mismatches. For example, the devshell puts openssl in LD_LIBRARY_PATH, but this breaks tools which (indirectly) depend on it like git fetch, which will fail with a dynamic linking error like

/home/${USER}/.nix-profile/bin/ssh: /nix/store/vq3sdi8l15rzfl5zvmwpafrzis4sm6xf-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/vzajrlhsdv2d39s7v6zv09ggajs05gwj-openssl-3.0.11/lib/libcrypto.so.3)

(My ssh happens to be installed via Nix, but I've also seen it happen with Ubuntu's own /usr/bin/ssh.)

Is it incomplete?

There's probably a better way to do things. I don't know if the old-fashioned approach using haskell.lib.buildStackProject has the same issue. It ought to be possible to set up things with --extra-lib-dirs and --extra-include-dirs instead, but I haven't gotten this to work myself yet and I suspect that would actually just be duplicating the functionality of buildStackProject.

Langage dominant
Haskell
Étoiles
4.1k
Forks
857
Merge moyen
17 h 32 min
PR mergées (30 j)
5

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de commercialhaskell/stack

Toutes les issues de commercialhaskell/stack

Issues similaires

Plus d'issues Haskell

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.