betabuilder icon indicating copy to clipboard operation
betabuilder copied to clipboard

Xcodebuild create the build output in the same dir

Open luca-bernardi opened this issue 13 years ago • 16 comments

It seems that if you call xcodebuild command from the command line as betabuilder does all the build product are placed in ./build and not in the DerivedData folder. This means that for example rake beta:archive doesn't work because wasn't able to read the output because it expect the build output in a different folder

luca-bernardi avatar Nov 16 '11 16:11 luca-bernardi

Have you configured the build location in your Rake file?

config.build_dir = :derived

This will become the default in 0.8 (Xcode 3 support is deprecated but will not be removed until 0.8).

lukeredpath avatar Nov 16 '11 17:11 lukeredpath

Yes, but the problem seems regarding the xcodebuild command. If i execute the plain xcodebuild -target 'Test' -configuration 'Ad-Hoc' -sdk iphoneos build i've got the same issue

luca-bernardi avatar Nov 16 '11 17:11 luca-bernardi

Yes, I'm seeing this too. This appears to be an issue with xcodebuild though, not betabuilder.

What problem is this causing you?

lukeredpath avatar Nov 16 '11 17:11 lukeredpath

rake beta:archive fail because it can't parse the build output.

luca-bernardi avatar Nov 16 '11 17:11 luca-bernardi

OK, something odd is definitely going on because xcodebuild should be using the derived data location and I'm sure it used to. I'm looking into this now.

lukeredpath avatar Nov 16 '11 17:11 lukeredpath

It seems that if you specify a -project and -target using xcodebuild, it builds to PROJECT_DIR/build but if you specify the workspace (all projects have an implicit workspace in YourProject.xcodeproj/project.xcworkspace) and a scheme it uses the derived data directory.

lukeredpath avatar Nov 16 '11 17:11 lukeredpath

Can you try configuring your betabuilder rake task to use a workspace/scheme and let me know if that works.

lukeredpath avatar Nov 16 '11 17:11 lukeredpath

This is my config:

require 'rubygems'
require 'betabuilder'

BetaBuilder::Tasks.new do |config|
  config.target = "Test"
  config.configuration = "Ad-Hoc"
  config.build_dir = :derived
  config.xcode4_archive_mode = true
  config.workspace_path = "Test.xcodeproj/project.xcworkspace"
  config.scheme         = "Test"
  config.app_name       = "Test"
end

And still getting the following error:

......
** BUILD SUCCEEDED **

Archiving build...
rake aborted!
Cannot parse build_dir from build output.

luca-bernardi avatar Nov 16 '11 19:11 luca-bernardi

Try removing the target setting, wiping the build dir then running again. Check that it's no longer using a build dir.

lukeredpath avatar Nov 16 '11 23:11 lukeredpath

I forget to mention the fact that, as you pointed out, using the workspace/scheme xcodebuild output in the derived data directory.

I've removed the target settings but still got error. I'm looking into your gem's source code and try to find out what's wrong.

luca-bernardi avatar Nov 17 '11 08:11 luca-bernardi

this is the output with --trace enabled

Archiving build... rake aborted! Cannot parse build_dir from build output. /Library/Ruby/Gems/1.8/gems/betabuilder-0.7.4.1/lib/beta_builder.rb:93:in derived_build_dir_from_build_output' /Library/Ruby/Gems/1.8/gems/betabuilder-0.7.4.1/lib/beta_builder.rb:80:inbuilt_app_path' /Library/Ruby/Gems/1.8/gems/betabuilder-0.7.4.1/lib/beta_builder/archived_build.rb:60:in save_to' /Library/Ruby/Gems/1.8/gems/betabuilder-0.7.4.1/lib/beta_builder.rb:174:indefine' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:inexecute' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:insynchronize' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in run' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/bin/rake:33 /usr/bin/rake:19:inload' /usr/bin/rake:19 Tasks: TOP => beta:archive

luca-bernardi avatar Nov 17 '11 09:11 luca-bernardi

Any news? Can you reproduce the issue?

luca-bernardi avatar Nov 29 '11 11:11 luca-bernardi

Just ran into this same issue - seems to be breaking because 0.7.4.1 wants the path to be quoted and it isn't necessarily in the Xcode output. It's fixed in pull request #30 (https://github.com/lukeredpath/betabuilder/pull/30, which is merged into master), so changing your Gemfile to refer to Github master should do the trick. Or at least, it did for me. Would be awesome if there was a point release to fix this on Rubygems though.

jayzes avatar Dec 05 '11 07:12 jayzes

@lukabernardi - could you confirm if this works for you? If so I'll get a point release out ASAP.

Ultimately, the fix would be to find a more reliable way of getting the build directory, which I'm hoping to find some time for soon.

lukeredpath avatar Dec 05 '11 11:12 lukeredpath

I confirm that now works fine. Thanks!

luca-bernardi avatar Dec 07 '11 14:12 luca-bernardi

@lukeredpath couldn't you tap into the environment vars that Xcode is setting by that point in the script?

I'll second that it would be nice for a minor release to update the gems for this. I just stumbled my way through this manually. now i'm getting hung up on the CFBundleIconFiles stuff :-\

peelman avatar Apr 24 '12 18:04 peelman