Setting LD_LIBRARY_PATH for Nix dev shells might be bad advice

Aperta
#6,331 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
haskell, nixos
Ambito
documentation

Direzione di ricerca

Inizia dalla sezione Supporting both Nix and non-Nix developers nella pagina della documentazione collegata, quindi riproduci l’interazione segnalata tra devShell, nix develop e direnv. Analizza le indicazioni su LD_LIBRARY_PATH e l’approccio suggerito con --extra-lib-dirs e --extra-include-dirs; il lavoro è concluso quando la documentazione non raccomanda più una configurazione che rompe strumenti non correlati e spiega un’alternativa verificata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Haskell
Stelle
4.1k
Fork
857
Merge medio
17h 32m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di commercialhaskell/stack

Tutte le issue di commercialhaskell/stack

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.