-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set more portable 'mode' value in portable mode
Fix #235 The `mode` value in `portable` mode will be set to a reasonable default across Unix systems. First, the user must always have read and write permissions. (Ie, a mode of 0o044 becomes 0o644.) Next, the mode is masked against 0o022. (Ie, a file of 0o777 becomes 0o755. 0o666 becomes 0o644.) In practice, this means that all entries will usually have a mode of either 0644 or 0o755, depending on whether the executable bit was set. This avoids a situation where an archive created on a system with a umask of 0o2 creates an archive with files having modes 0o775 and 0o664, whereas an archive created on a system with a umask of 0o22 creates an archive with files having modes 0o755 and 0o644, for the same content. (Especially, for a check-out of the same git repository.) Without this consistency, it's impossible to honor the contract that the same content will produce the same archive, which is necessary for npm to create reprodicible build artifacts that match both in CI and development. This unfortunately still does not address windows, where the executable bit is never set on files. (This bit the mocha project when a publish from a Windows machine did not archive binaries with executable flags set: #210 (comment))
- Loading branch information
Showing
4 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters