make error when run without access to `/proc`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, linux, node.js
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia da lib/build.js alle righe 176-179 e riproduci il risultato con zero CPU usando il comando systemd-run fornito con ProcSubset=pid. Controlla gli argomenti make risultanti e verifica che una build non passi più un numero di job pari a zero quando os.cpus() restituisce un array vuoto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- Node Version: node = v20.16.0, npm = 10.8.1
- Platform: Linux 6.8.0-40-generic x86_64
- Module: re2
Verbose output (from npm or node-gyp):
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 0 ]
npm error make: the '-j' option requires a positive integer argument
When building a package using the systemd security option ProcSubset=pid, gyp sets the number of jobs to 0, which make does not accept.
I believe the relevant code is here: https://github.com/nodejs/node-gyp/blob/e6f4ede10cca28e9edeaa85d7830914c5d1499c7/lib/build.js#L176-L179
The documentation for Node function os.cpus() says:
Returns an array of objects containing information about each logical CPU core. The array will be empty if no CPU information is available, such as if the
/procfile system is unavailable.
This can be shown by getting the number of CPUs in a transient service unit:
$ node -e "console.log(require('node:os').cpus().length)"
16
$ sudo systemd-run -p ProcSubset=pid -t -- \
node -e "console.log(require('node:os').cpus().length)"
0
In the event of os.cpus() not returning any information, I suggest that gyp should either default to some constant number of parallel jobs or let make run as many jobs as it wants.
- Lingua principale
- Python
- Stelle
- 10.7k
- Fork
- 1.9k
- Merge medio
- 1g 4h
- PR unite (30g)
- 5
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nodejs/node-gyp
-
dependencies github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
MSYS2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tutte le issue di nodejs/node-gyp
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·