xcode-install icon indicating copy to clipboard operation
xcode-install copied to clipboard

Return non-zero code when unzipping xip fails.

Open wrutkowski opened this issue 8 years ago • 4 comments

I used xcversion install 9.2 to install Xcode 9.2. There had to be some error with download as it was 100% instantaneously. Then xcode-install tried unpacking the xip and failed. Errors where printed to stderr, but return code of xcversion was zero, so my CI continue without informing anyone about the issue. Should return code be non-zero in case of a failure?

CI report:

{"rc": 0,
"stderr": "\r######################################################################## 100.0%\r
######################################################################## 100.0%\r
######################################################################## 100.0%\n
No `Xcode.app(or Xcode-beta.app)` found in XIP. Please remove /Users/iosmacmini/Library/Caches/XcodeInstall/Xcode_9.2.xip if you suspect a corrupted download or run `xcversion update` to see if the version you tried to install has been pulled by Apple. If none of this is true, please open a new GH issue. ", 
"stdout": "", 
"stdout_lines": []}

I checked the cache file and it had a size of 46KB.

wrutkowski avatar Dec 07 '17 12:12 wrutkowski

I've also experienced several continuous failures when attempting to install 9.2.

So far, I've experienced this issue in macOS Parallels virtual machines (Vagrant boxes) as well as bare metal, macOS versions 10.13.1 and 10.12.6.

Downloading appears to work and the .xip files remain in ~/Library/Caches/XcodeInstall/, but installation does not complete and exits successfully. The contents of the directory look like this after logging in:

10.12.6

sierra-macos-10126:~ vagrant$ ll ~/Library/Caches/XcodeInstall/
total 40
drwxr-xr-x   5 root     staff  -  170B Dec  7 15:19 ./
drwxr-xr-x  22 vagrant  staff  -  748B Dec  7 15:23 ../
-rw-r--r--   1 root     staff  -   14B Dec  7 15:19 Xcode_9.2.xip
-rw-r--r--   1 root     staff  -  132B Dec  7 15:19 Xcode_9.2.xip.cpgz
-rw-r--r--   1 root     staff  -  9.4K Dec  7 15:19 xcodes.bin

10.13.1

high-sierra-macos-10131:~ vagrant$ ll ~/Library/Caches/XcodeInstall/
total 40
drwxr-xr-x   5 root     staff  -  170B Dec  7 15:30 ./
drwx------  19 vagrant  staff  -  646B Dec  7 15:33 ../
-rw-r--r--   1 root     staff  -   14B Dec  7 15:30 Xcode_9.2.xip
-rw-r--r--   1 root     staff  -  131B Dec  7 15:30 Xcode_9.2.xip.cpgz
-rw-r--r--   1 root     staff  -  9.4K Dec  7 15:30 xcodes.bin
high-sierra-macos-10131:~ vagrant$

Note that previous versions of Xcode (9.0.1, and 9.1) are continuing to install successfully on the same virtual machines.

americanhanko avatar Dec 07 '17 23:12 americanhanko

I was prompted twice for my password (and was also reproducing the original issue) until I disabled Gatekeeper with sudo spctl --master-disable. 9.2 installs for me on a clean system if I run the disable command prior to attempting a 9.2 install, and there's an additional line in the output: override=security disabled.

Please authenticate for Xcode installation.
Password:
/Applications/Xcode-9.2.app: accepted
source=Apple System
override=security disabled

Xcode 9.2
Build version 9C40b

jazaval avatar Dec 08 '17 00:12 jazaval

New issue submitted #253

americanhanko avatar Dec 08 '17 00:12 americanhanko

Just encountered this bug, which has been open for 3 years. The xcode-install tried unpacking the xip and failed.

Shouldn't the return code be non-zero in case of a failure?

There are multiple factors - certainly fixing the download is the main goal. However, a small issue remains, as the title says "Return non-zero code when unzipping xip fails."

sdarwin avatar Apr 23 '21 15:04 sdarwin