Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix gcc and cc for darwin (no cli tools installed) #941
If darwin is found:
Signed-off-by: Erik Gomez email@example.com
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.
Since this only impacts Darwin, I have tested both use cases where xcode command line tools are installed and when they are not installed.
@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.
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.
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.