-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Closed
Labels
installing nodeIssues with installing node/io.js versions.Issues with installing node/io.js versions.pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-D
Description
Hi folks,
I did a bunch of research on detecting xz support, in pursuit of adding a "system supports xz?" check to shadowspawn/nvh and tj/n.
The gist of it for Linux and macOS:
- On Linux, chances are very great that if the
xz
binary is on the systemPATH
,tar
will support extracting xz-compressed tarballs.- Almost every Linux distro ships GNU tar. GNU tar added support for xz in version 1.22. Only very old distros ship with GNU tar older than 1.22, and those mostly don't have
xz
in the repos. It's therefore possible but very unlikely that a Linux machine hasxz
on the path but no support intar
. nvm
is basically already doing this check; It works great for Linux. If it works anywhere else, I would propose that that's pretty much just a coincidence or a happy accident.
- Almost every Linux distro ships GNU tar. GNU tar added support for xz in version 1.22. Only very old distros ship with GNU tar older than 1.22, and those mostly don't have
- On macOS, xz compression/decompression relies on support that is baked into the
libarchive
/bsdtar
that macOS ships with.- macOS started shipping new enough
libarchive
/bsdtar
in OS X Lion (10.7)... but had xz support toggled off in pre-compile configuration, and didn't ship the underlyingliblzma
library that macOS would eventually use to support xz. macOS only ships xz support in macOS 10.9 or newer. - Starting in OS X Mavericks (10.9), OS X actually shipped
libarchive
/bsdtar
with xz support toggled on, and shippedliblzma
to use for compressing/decompressing xz archives xz
on thePATH
is irrelevant (and a bit of a red herring!) for xz support intar
on macOS.- Checking just the
libarchive
/bsdtar
version on macOS will mostly work, but you will get a false positive for OS X Lion and Mountain Lion (10.7 and 10.8, respectively).
- macOS started shipping new enough
I would recommend checking for macOS 10.9+ before enabling xz, and not checking for xz
on the PATH
on macOS at all. You can conveniently check the macOS version via command-line with sw_vers
.
- https://scriptingosx.com/2017/11/on-the-macos-version/
- https://www.oreilly.com/library/view/macintosh-terminal-pocket/9781449328962/re104.html
- https://ss64.com/osx/sw_vers.html
Here are the main research findings from implementing this on nvh
/n
. (Scroll up/down in the issue for the whole convoluted research process, if you like!)
Metadata
Metadata
Assignees
Labels
installing nodeIssues with installing node/io.js versions.Issues with installing node/io.js versions.pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-D