`cabal init` can fail with "Too many open files"

Aperta
#12,609 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
haskell
Ambito
cli

Direzione di ricerca

Start by locating the cabal init code that scans source directories and opens module files; the issue names no implementation file or test. Reproduce with a large source tree and a low file descriptor limit, then trace how files are opened during scanning. Done when cabal init handles many modules without exhausting open files.

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

Descrizione

needs triage type: bug

Describe the bug

cabal init fails with openFile: resource exhausted (Too many open files) when the source directory has many modules.

To Reproduce

$ gh repo clone cabalism/stack
Cloning into 'stack'...
...

$ cd stack

$ ulimit -Sn 1024

$ cabal init -n
Warning: this is a debug build of cabal-install with assertions enabled.
The name stack is already in use by another package on Hackage.
Warning: found module that doesn't match directory structure: Main
Warning: found module that doesn't match directory structure: implements
Warning: found module that doesn't match directory structure: does
Warning: found module that doesn't match directory structure: which
Warning: found module that doesn't match directory structure: which
Warning: found module that doesn't match directory structure: scans
Warning: found module that doesn't match directory structure: rather
/home/.../dev/src/cabalism/stack/src/Stack/Types/Cache.hs:
  openFile: resource exhausted (Too many open files)

HasCallStack backtrace:
  ioError, called at libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs:291:5 in
  ghc-internal:GHC.Internal.Foreign.C.Error

Expected behavior

The init command is able to cope with many modules.

Lingua principale
Haskell
Stelle
1.8k
Fork
766
Merge medio
5g 21h
PR unite (30g)
27

Preparare l'ambiente

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 haskell/cabal

Tutte le issue di haskell/cabal

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.