You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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))
0 commit comments