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

xcode-select: Error: unknown command option '-p'. in v0.36.3 #3387

Closed
capnslipp opened this issue Apr 11, 2015 · 6 comments · Fixed by CocoaPods/Xcodeproj#263
Closed

xcode-select: Error: unknown command option '-p'. in v0.36.3 #3387

capnslipp opened this issue Apr 11, 2015 · 6 comments · Fixed by CocoaPods/Xcodeproj#263
Assignees
Labels
t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@capnslipp
Copy link

🌈 As of CocoaPods 0.36.3, I'm getting the follow error whenever I run a pod install:

$ pod install
Analyzing dependencies
xcode-select: Error: unknown command option '-p'.

The previous version of CocoaPods I had installed was 0.35.0, which did not have the issue.

I'm using:

  • OS X 10.8.5 (the latest 10.8.x)
  • RVM Ruby 2.1.3
  • Xcode 5.1.1 (the latest 5.x, and latest for OS X 10.8)
@kylef kylef added the t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! label Apr 12, 2015
@capnslipp
Copy link
Author

I should mention that this seems not to affect the operation of pod install— it just would appear to a naive CocoaPods user as a “false positive” error.

It looks like the latest version of the xcode-select manpage (https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html) advises against using the -p flag from/for scripts:

  -p, --print-path
         Prints  the path to the currently selected developer directory. This is useful for inspection,
         but scripts and other tools should use xcrun(1) to locate tool  inside  the  active  developer
         directory.

A saner solution might be something like:

# [existing xcode-select call w/o `-p`]

xcode_developer_path = begin
  path = `xcrun --find xcodebuild`
  concise_path = path[%r'(/.*/)usr/bin/xcodebuild', 1]
  concise_path || path
end
puts "Using Xcode directory: #{xcode_developer_path}"

@neonichu
Copy link
Member

I believe the intention of that advice is not hardcoding paths to specific tools as their location inside the Xcode bundle is suspect to change. Alas, hardcoding the relative path to xcodebuild would make this more brittle, not less.

Back to the original issue, does the Xcode 5.x xcode-select have --print-path?

BTW, this is not a hard error, because it is used inside the Xcodeproj gem to locate the DevToolsCore.framework for writing the project file as an ASCII plist, and if that fails it'll fall back to writing XML.

@neonichu
Copy link
Member

Ah, I see xcode-select is not tied to the Xcode version at all, but to the OS version. Could you please share the output of xcode-select --help on 10.8?

@capnslipp
Copy link
Author

My (OS X 10.8.5) xcode-select --help:

xcode-select: Error: unknown command option '--help'.

xcode-select: Report or change the path to the active
              Xcode installation for this machine.

Usage: xcode-select --print-path
           Prints the path of the active Xcode folder
   or: xcode-select --switch <xcode_path>
           Sets the path for the active Xcode folder
   or: xcode-select --version
           Prints the version of xcode-select

and xcode-select --version:

xcode-select version 2311.

and (why not) xcode-select --print-path; xcode-select -print-path:

/Applications/Xcode.app/Contents/Developer
/Applications/Xcode.app/Contents/Developer

P.S. which xcode-select:

/usr/bin/xcode-select

@neonichu
Copy link
Member

Thanks, --print-path it will be. I wasn't aware that the short-hand wasn't available in older OS versions.

@neonichu neonichu self-assigned this Apr 13, 2015
@capnslipp
Copy link
Author

Works for me.  Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants