Skip to content

[BUG] package-lock.json integrity value for git dependencies depends on the architecture (Apple Silicon M1 differs) #2846

Closed
npm/pacote
#71
@feross

Description

@feross

Current Behavior:

The package-lock.json integrity value seems to depend on the OS/architecture. Take the following git dependency which specifies a commit hash:

npm pack "git+ssh://[email protected]/jhiesey/idb-kv-store.git#109ccad165fd6470e12fd66025da9e4743a46043"

The integrity value produced is different on these OSes/architectures:

  • Ubuntu 20.04, and macOS 11.2.3 (Intel): sha512-DnBTbDDxd9/9mwPehyraeuRTbNEqbWLcAdE3GC1trdBWWwKnkWsaU/X6mVLIKKB/IYWmG+cnL3ihg/Ql/rW5kg==
  • macOS 11.2.3 (Apple Silicon): sha512-T3ZWOM1TT+Ch/splApkEe1HwktWs+n/iHvDvtIGEI+4xuMGHite6mMujuNd8sen49ofLP/PxzprQMSPJK8APww==

Expected Behavior:

The integrity value should not be different on Apple Silicon (M1 chip) machines.

Steps To Reproduce:

Run npm pack "git+ssh://[email protected]/jhiesey/idb-kv-store.git#109ccad165fd6470e12fd66025da9e4743a46043" and inspect the integrity value from an M1 Mac. Node.js was installed from Homebrew using brew install node and the amd64 version was installed.

Also... @jhiesey and I dug into this a bit and found that the tarballs fetched from the GitHub CDN are exactly the same on M1 and other architectures, byte-for-byte. Same for the ungzipped tarballs – they are the same byte-for-byte. What differs, though, is the gzipped tarballs (.tar.gz) files. Those appear to have substantial differences when viewed in a hex editor.

Environment:

  • OS: Various, see above
  • Node: v15.11.0
  • npm: 7.6.2

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions