make error when run without access to `/proc`
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript, linux, node.js
- 領域
- build-system, tooling
調査の方向性
lib/build.js の176-179行目から始め、ProcSubset=pid を指定した提供済みの systemd-run コマンドを使って、CPUが0の場合の結果を再現します。結果として得られる make の引数を確認し、os.cpus() が空の配列を返したときに、ビルドがジョブ数0を渡さなくなっていることを検証します。
索引モデルが issue の本文から書いたものです。
説明
- 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.
- 主要言語
- Python
- スター
- 10.7k
- フォーク
- 1.9k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 5
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node-gyp のほかの issue
-
dependencies github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
MSYS2
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
nodejs/node-gyp の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·