-
Notifications
You must be signed in to change notification settings - Fork 449
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
fix gcc and cc for darwin (no cli tools installed) #941
Conversation
If darwin is found: 1. shell out to /usr/bin/xcode-select -p 2a. If it returns an exit code other than 0, assume xcode command line tools are not installed and do not run these commands. 2b. If it returns an exit code of 0, run the commands. Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
To be clear, the integration tests are probably failing due to the current code and not my changes as the CI tools do not run on macOS. |
@erikng the tests are failing due to expectations in the specs that are no longer true, so you'll need to fix those up. Chefstyle also has some errors that you'll need to fix (run In general though, I think each check ought to be more split out. For darwin, linux, etc, the checks that matter are gcc and glibc, so we could wrap those in a function, and then do something like:
If that seems like a too major refactor, that's ok, just let us know and we can take it on from here (but please tick the box to "Allow edits from maintainers" on this PR - https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/ ) |
I would certainly be willing to do it for the Darwin side, but as this PR was designed to fix the specific issues presented, I had no intention of doing other operating systems. If you were to do the refactor, what are the timetables here? This would infinitely make our deployments easier and I would hate for other factors to delay this fix. |
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
I went ahead and completely refactored it, based on the feedback you gave @thommay (wasn't as bad as I expected) and the Chefstyle is no longer producing errors. That said, I have very little ideas on how to fix the spec tests, especially now. Some feedback would be greatly appreciated. |
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
No problem. I've tried various things today to understand the spec, but I'm not getting any closer to writing it. If someone could give me a little feedback on where to start here it would be appreciated, otherwise I may not be able to finish this PR. I would hate to close it, but it may be infinitely easier for me to just deploy this as a hotfix (to our macOS devices) rather than spend time I don't have fixing the specs. If I sound bitter, I apologize, but I've wasted about 4 hours of time today and gotten almost zero progress. |
Closing due to #944 |
If darwin is found:
2a. If it returns an exit code other than 0, assume xcode command line tools are not installed and do not run these commands.
2b. If it returns an exit code of 0, run the commands.
Signed-off-by: Erik Gomez e@eriknicolasgomez.com
Description
This removes the requirement for both Ohai and Chef to have the Xcode command line tools installed on macOS machines.
This is a huge win for managing client devices as the Xcode Command Line tools were previously a dependency. Companies have worked around these issues, but they are not ideal and require additional management overhead/engineering effort.
One such example: https://github.com/facebook/IT-CPE/blob/master/chef/tools/chef_bootstrap.py#L239-L284
Issues Resolved
Fixes #940
Check List
Since this only impacts Darwin, I have tested both use cases where xcode command line tools are installed and when they are not installed.