The installed files are not consistent
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- nodejs
- 領域
- build-system, tooling
調査の方向性
cpu-features@0.0.10 の macOS での 2 回のインストールを再現し、生成された build/Release/cpufeatures.node のハッシュを比較します。まず buildcheck.js、Makefile、node-gyp rebuild の出力を確認します。繰り返しインストールしても一貫したインストール済みファイルが生成され、キャッシュが期待どおりに動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
- Node Version:
❯ node -v
v20.12.2
❯ npm -v
10.5.0 - Platform:
❯ uname -a
Darwin JACK 23.6.0 Darwin Kernel Version 23.6.0: Fri Jul 5 17:54:20 PDT 2024; root:xnu-10063.141.1~2/RELEASE_X86_64 x86_64 - Compiler:
❯ gcc -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin - Module:
cpu-features@0.0.10
Verbose output (from npm or node-gyp):
❯ npm r cpu-features;npm i cpu-features@0.0.10 --verbose
removed 3 packages, and audited 1 package in 491ms
found 0 vulnerabilities
npm verb cli /Users/jackzhang/.nvm/versions/node/v20.12.2/bin/node /Users/jackzhang/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.0
npm info using node@v20.12.2
npm verb title npm i cpu-features@0.0.10
npm verb argv "i" "cpu-features@0.0.10" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/jackzhang/.npm/_logs/2024-09-10T14_15_06_383Z-
npm verb logfile /Users/jackzhang/.npm/_logs/2024-09-10T14_15_06_383Z-debug-0.log
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/cpu-features 19ms (cache hit)
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/buildcheck 12ms (cache hit)
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/nan 13ms (cache hit)
npm info run cpu-features@0.0.10 install node_modules/cpu-features node buildcheck.js > buildcheck.gypi && node-gyp rebuild
npm http fetch POST 200 https://npmreg.proxy.ustclug.org/-/npm/v1/security/advisories/bulk 567ms
npm info run cpu-features@0.0.10 install { code: 0, signal: null }
added 3 packages, and audited 4 packages in 7s
found 0 vulnerabilities
npm verb exit 0
npm info ok
~/src/workshop/hello-world-node 9s 22:15:13
❯ md5sum node_modules/cpu-features/build/Release/cpufeatures.node
c7cea303f2b61a426712f207f516b59d node_modules/cpu-features/build/Release/cpufeatures.node
~/src/workshop/hello-world-node 22:15:16
❯ npm r cpu-features;npm i cpu-features@0.0.10 --verbose
removed 3 packages, and audited 1 package in 366ms
found 0 vulnerabilities
npm verb cli /Users/jackzhang/.nvm/versions/node/v20.12.2/bin/node /Users/jackzhang/.nvm/versions/node/v20.12.2/bin/npm
npm info using npm@10.5.0
npm info using node@v20.12.2
npm verb title npm i cpu-features@0.0.10
npm verb argv "i" "cpu-features@0.0.10" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/jackzhang/.npm/_logs/2024-09-10T14_15_19_828Z-
npm verb logfile /Users/jackzhang/.npm/_logs/2024-09-10T14_15_19_828Z-debug-0.log
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/cpu-features 20ms (cache hit)
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/nan 12ms (cache hit)
npm http fetch GET 200 https://npmreg.proxy.ustclug.org/buildcheck 16ms (cache hit)
npm info run cpu-features@0.0.10 install node_modules/cpu-features node buildcheck.js > buildcheck.gypi && node-gyp rebuild
npm http fetch POST 200 https://npmreg.proxy.ustclug.org/-/npm/v1/security/advisories/bulk 543ms
npm info run cpu-features@0.0.10 install { code: 0, signal: null }
added 3 packages, and audited 4 packages in 7s
found 0 vulnerabilities
npm verb exit 0
npm info ok
~/src/workshop/hello-world-node 8s 22:15:26
❯ md5sum node_modules/cpu-features/build/Release/cpufeatures.node
6cbebb24ba9321c032ab68e897579978 node_modules/cpu-features/build/Release/cpufeatures.node
As we can we see, I tried to install the same version of cpu-features twice, the content in node_modules is different.
The md5 of node_modules/cpu-features/build/Release/cpufeatures.node is c7cea303f2b61a426712f207f516b59d at first time while it is 6cbebb24ba9321c032ab68e897579978 at second time.
All files except node_modules/cpu-features/build/Release/cpufeatures.node are the same.
It would be great if the content keeps consistent no matter how many times I install it. If the content is different, the hash would be different as well. And finally, the cache does not work.
BTW, there is no this issue on Linux but it exists on MacOS.
I am not sure it is an expected behavior.
Thanks @ben-zalekta-lmnd 's work in PR #3062 to ensure the Makefile consistent.
- 主要言語
- 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 ·