Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mktemp invocation in "install.sh" fails on older OS X images #1984

Closed
BanzaiMan opened this issue Nov 22, 2016 · 4 comments
Closed

mktemp invocation in "install.sh" fails on older OS X images #1984

BanzaiMan opened this issue Nov 22, 2016 · 4 comments
Labels

Comments

@BanzaiMan
Copy link
Contributor

What is the current behavior?

On OS X 10.10 and older, the install script fails due to incorrect mktemp invocation. The same invocation works on 10.11 and newer.

If the current behavior is a bug, please provide the steps to reproduce.

Run the following on OS X Yosemite:

curl -o- -L https://yarnpkg.com/install.sh | bash

What is the expected behavior?
Installation succeeds (or, when gpg is not available and $YARN_GPG is not set to no, the installation fails with gpg being unavailable).

Please mention your node.js, yarn and operating system version.

Node.js 6.9.1 on OS X 10.10.

See https://travis-ci.org/BanzaiMan/travis_production_test/jobs/177976869#L83

@Daniel15
Copy link
Member

Sorry about that, I'm not very familiar with Mac OS and how it differs from Linux. Is this a BSD-ism or a MacOS-ism? What is the standard way for creating a temporary file in Mac OS X?

@BanzaiMan
Copy link
Contributor Author

That is an excellent question. I expected mktemp to work in all cases, but it apparently does not. I honestly do not know how this was supposed to be done on older OS X releases. (I no longer have direct access to it.)

@Daniel15
Copy link
Member

I no longer have direct access to it.

Me neither... I use Windows, and at Facebook everyone on OSX was forced to upgrade to Sierra as there's several security patches that Apple are not backporting to older OSX versions.

@Daniel15
Copy link
Member

Daniel15 commented Nov 23, 2016

Got an explanation from someone internally at Facebook :)

mktemp on older macOS did not support skipping the template.
10.9 man page you can compare to mktemp(1) on your Sierra. https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/mktemp.1.html
So, the portable way to achieve this to actually supply the template:

tarball_tmp="$(mktemp -t yarn-tarball.XXXXXXXX)"

Daniel15 added a commit to Daniel15/yarn that referenced this issue Nov 24, 2016
 - Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp`
 - The check for GPG wasn't returning correctly, and tried to run GPG even when not available

Closes yarnpkg#2012
Closes yarnpkg#1984
Daniel15 added a commit that referenced this issue Nov 24, 2016
- Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp`
 - The check for GPG wasn't returning correctly, and tried to run GPG even when not available

Closes #2012
Closes #1984
Ivshti referenced this issue in yarnpkg/website Sep 13, 2017
* Fix: Make install.sh Alpine linux compatible

**Summary**

Alpine Linux comes with BusyBox tar, which lacks the `--strip` option. This patch updates the `install.sh` script to not rely on this option.

**Test plan**

Manually verified on local Ubuntu for Windows.

* Respect humans
yaxu added a commit to yaxu/ghcup that referenced this issue Oct 31, 2019
Older versions of MacOS seem to require a template in calls to mktemp.
Ref: yarnpkg/yarn#1984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants