elliotweiser / ansible-osx-command-line-tools

An Ansible role for installing OS X Command Line Tools
https://galaxy.ansible.com/elliotweiser/osx-command-line-tools/
MIT License
96 stars 42 forks source link

Cannot install on macOS 10.15.3 #67

Closed jdumas closed 3 years ago

jdumas commented 3 years ago

Hi,

I was trying to run this role on a fresh install of macOS 10.15.3. This fails with the following log:

TASK [elliotweiser.osx-command-line-tools : Is the C++ compiler useable?] ******************************************************************************************************************************************
fatal: [xxx.foo.com]: FAILED! => {"changed": false, "cmd": ["g++", "--version"], "delta": "0:00:00.011904", "end": "2021-06-11 08:04:35.781916", "msg": "non-zero return code", "rc": 1, "start": "2021-06-11 08:04:35.770012", "stderr": "xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'.", "stderr_lines": ["xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'."], "stdout": "", "stdout_lines": []}
...ignoring

TASK [elliotweiser.osx-command-line-tools : Check the Command Line Tools package metadata] *************************************************************************************************************************
fatal: [xxx.foo.com]: FAILED! => {"changed": false, "cmd": ["pkgutil", "--pkg-info=com.apple.pkg.CLTools_Executables"], "delta": "0:00:00.029960", "end": "2021-06-11 08:04:37.625898", "msg": "non-zero return code", "rc": 1, "start": "2021-06-11 08:04:37.595938", "stderr": "No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.", "stderr_lines": ["No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'."], "stdout": "", "stdout_lines": []}
...ignoring

TASK [elliotweiser.osx-command-line-tools : Prepare to install Command Line Tools] *********************************************************************************************************************************
changed: [xxx.foo.com] => {"changed": true, "dest": "/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress", "gid": 0, "group": "wheel", "mode": "0644", "owner": "admin", "size": 0, "state": "file", "uid": 501}

TASK [elliotweiser.osx-command-line-tools : Check for Command Line Tools in Software Update list (MacOS < 10.15).] *************************************************************************************************
skipping: [xxx.foo.com] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [elliotweiser.osx-command-line-tools : Check for Command Line Tools in Software Update list (MacOS >= 10.15).] ************************************************************************************************
fatal: [xxx.foo.com]: FAILED! => {"changed": false, "cmd": "set -o pipefail; softwareupdate -l | grep -B 1 -E 'Command Line Tools' | awk -F'*' '/^\\*/ {print $2}' | sed 's/^ Label: //' | grep -iE '[0-9|.]' | sort | tail -n1\n", "delta": "0:00:06.431488", "end": "2021-06-11 08:04:48.428174", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-06-11 08:04:41.996686", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

The problem seems to be that the command-line tool is not available from the softwareupdate -l command:

softwareupdate --list
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Label: macOS Catalina 10.15.7 Update-
    Title: macOS Catalina 10.15.7 Update, Version:  , Size: 4667570K, Recommended: YES, Action: restart,

I have another VM on 10.15.4 where this works fine though.

elliotweiser commented 3 years ago

Incidentally, I believe last time I tried 10.15.3, it turned out to be quite buggy and the only solution that occurred to me was to upgrade to 10.15.7. I would recommend upgrading to the latest Catalina version (which I think is also 10.15.7), or at least prefer the 10.15.4 VM which you have already tested against. Unfortunately, there isn't much I can do about this problem. If you spot any more issues on either Catalina 10.15.7 or on latest Big Sur, please open another issue.

jdumas commented 3 years ago

Yeah that's what I ended up doing =/