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

RuntimeError - Unable to convert the ... project.pbxproj` plist file to XML: #204

Closed
briansoule opened this issue Oct 8, 2014 · 16 comments

Comments

@briansoule
Copy link

I've attempted to open an xcodeproj on ubuntu 14.04: "project = Xcodeproj::Project.open(xcode_path.first)", with CFPropertyList (2.2.8)

I'd assume something's happening in def plist_xml_contents(path)

/usr/local/rvm/gems/ruby-2.1.3/gems/xcodeproj-0.18.0/lib/xcodeproj/plist_helper.rb:73:in `plist_xml_contents'
/usr/local/rvm/gems/ruby-2.1.3/gems/xcodeproj-0.18.0/lib/xcodeproj/plist_helper.rb:48:in `read'
/usr/local/rvm/gems/ruby-2.1.3/gems/xcodeproj-0.18.0/lib/xcodeproj/project.rb:173:in `initialize_from_file'
/usr/local/rvm/gems/ruby-2.1.3/gems/xcodeproj-0.18.0/lib/xcodeproj/project.rb:94:in `open'
/root/app/app.rb:326:in `block in <class:App>'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/honeybadger-1.16.4/lib/honeybadger/rack/error_notifier.rb:43:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/lint.rb:49:in `_call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/lint.rb:37:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:217:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/chunked.rb:43:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
/usr/local/rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/usr/local/rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
/usr/local/rvm/gems/ruby-2.1.3/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
/usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.3/bin/rackup:23:in `load'
/usr/local/rvm/gems/ruby-2.1.3/bin/rackup:23:in `<main>'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
@briansoule
Copy link
Author

Hmm it would seem I'm on 18.0, I'll try 19.3

@briansoule
Copy link
Author

Hmm I've switched to 19.3 and it seems that it can't find CoreFoundation at the supplied path:
RuntimeError - Unable to convert the /root/Insert/tmp/checkout/dir/Grasshopper.xcodeproj/project.pbxproj plist file to XML:
/usr/local/rvm/gems/ruby-2.1.2/gems/xcodeproj-0.18.0/lib/xcodeproj/plist_helper.rb:73:in plist_xml_contents' /usr/local/rvm/gems/ruby-2.1.2/gems/xcodeproj-0.18.0/lib/xcodeproj/plist_helper.rb:48:inread'
/usr/local/rvm/gems/ruby-2.1.2/gems/xcodeproj-0.18.0/lib/xcodeproj/project.rb:173:in initialize_from_file' /usr/local/rvm/gems/ruby-2.1.2/gems/xcodeproj-0.18.0/lib/xcodeproj/project.rb:94:inopen'
/root/app/app.rb:326:in `block in class:App'

@briansoule briansoule changed the title RuntimeError - Unable to convert the /root/app/tmp/checkout/dir/Grasshopper.xcodeproj/project.pbxproj plist file to XML: RuntimeError - Unable to convert the ... project.pbxproj` plist file to XML: Oct 8, 2014
@briansoule
Copy link
Author

I suppose a more succinct question would be; Is it possible for xcodeproj to run on Ubuntu?

@segiddins
Copy link
Member

No, xcodeproj requires OSX.

@kylef
Copy link
Contributor

kylef commented Oct 8, 2014

@briansoule There is an update to xcpodeproj. Please update it using the following:

$ [sudo] gem install xcodeproj

There will be a CocoaPods release soon.

@briansoule
Copy link
Author

@kylef Would this provide a workaround to the CoreFoundation requirement on Ubuntu?

@alloy
Copy link
Member

alloy commented Oct 8, 2014

@briansoule It would not, as it stands. However, there are CoreFoundation ports to other platforms, such as GNU/Linux, we actually used a build of CoreFoundation-lite to test on Travis when they didn’t have OS X workers.

So what you can do is find the best one that’s available for Ubuntu, and then override the path from where the CoreFoundation library is loaded.

When you’ve figured out the details, please file a ticket on the Xcodeproj repo with the details, I love these topics.

@briansoule
Copy link
Author

I was thinking about giving that a shot, will try. Hopefully that will be the only issue.

@alloy
Copy link
Member

alloy commented Oct 8, 2014

Awesome, looking forward to hearing the details.

@alloy
Copy link
Member

alloy commented Oct 8, 2014

PS, it could well be that other implementations have other constant values, so that’s something to watch out for.

@briansoule
Copy link
Author

Ah, also does the project currently do "xcproj touch" on it's own, or do you need that library to convert the pbxproj back to ASCII? I ask because OSX/xcode is obviously a requirement for xcproj.

@alloy
Copy link
Member

alloy commented Oct 8, 2014

The only way to get ASCII plists with our current codebase is on OS X. We currently use the xcproj tool and we will soon incorporate it into our tooling itself, but it all uses private Xcode APIs. Having said that, possibly the open ports of CoreFoundation still allow writing out in ASCII format.

@kylef
Copy link
Contributor

kylef commented Oct 8, 2014

@briansoule providing xcproj is installed, CocoaPods/Xcodeproj will automatically touch it with xcproj touch to save ASCII project files.

There is a discussion from #199 and a proof of concept pull request at #203 to try and remove the dependency of xcproj and have this behaviour by default in Xcodeproj.

@briansoule
Copy link
Author

@alloy before I dive in, is there a specific place where I should try swapping in the CF open port to achieve ASCII plists?

@neonichu
Copy link
Member

neonichu commented Oct 8, 2014

FWIW, the approach from #203 will only work on OS X as well, as it utilises the same Xcode frameworks as xcproj. It just does so dynamically, without the need to compile any application first.

@alloy
Copy link
Member

alloy commented Oct 8, 2014

@briansoule Find a port that supports it and update that path I linked to: https://github.com/CocoaPods/Xcodeproj/blob/master/lib/xcodeproj/plist_helper.rb#L71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants