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

C Plugin: Expand GCC data & only shellout to gcc if Xcode is installed on macOS #944

Merged
merged 14 commits into from
Jan 23, 2017

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Jan 21, 2017

Builds on the work that @erikng did in #941

Additions:

Rework the specs to be per platform and remove some the guards that existed for *nix plugins on Windows
Add more useful fields to the gcc data
Use the same logging format everywhere
Add specs for the xcode change and rework other specs to run per platform

erikng and others added 12 commits January 20, 2017 11:34
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>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
cl / devenv are windows only so avoid checking those on *nix
HP UX things should only get checked on HPUX
We’re only collecting this data on Windows now so don’t bother checking
if we’re on Windows again
CC is clang on Darwin and the output is different so this just fails
every time. We *should* add clang checks at some point though.
None of the values were being populated with the refactoring. Also gcc
hadn’t been collecting anything for a while. This gives us real data
for gcc:

  "c": {
    "gcc": {
      "configured_with":
"--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1",
      "description": "Apple LLVM version 8.0.0 (clang-800.0.42.1)",
      "version": "8.0.0",
      "target": "x86_64-apple-darwin16.3.0",
      "thread_model": "posix"
    }
  },
Add specs for checking that xcode exists on darwin
Remove the odd double glibc mess
Don't do ruby logic in the expects. That defeats the entire purpose of
the specs if we're doing the same faulty logic. Just include the
expected string

Signed-off-by: Tim Smith <tsmith@chef.io>
@tas50 tas50 changed the title C Plugin: Fix GCC output & only shellout to gcc if Xcode is installed on macOS C Plugin: Expand GCC data & only shellout to gcc if Xcode is installed on macOS Jan 21, 2017
@erikng
Copy link
Contributor

erikng commented Jan 22, 2017

Awesome job @tas50. Looks like the CI is failing, but not due to the PR.

I don't want to speak for too many people, but both @natewalck and I would love to see this merged into the next chef release.

Signed-off-by: Tim Smith <tsmith@chef.io>
collect_gcc
collect_glibc
collect_xlc
collect_cc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collect_cc is pretty badly named here, and is solaris specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@c = Mash.new
collect_gcc
collect_glibc
collect_xlc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

believe this is AIX specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: Tim Smith <tsmith@chef.io>
@tas50 tas50 merged commit dff145b into master Jan 23, 2017
@tas50 tas50 deleted the pr/941 branch January 23, 2017 19:26
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants