Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Issue #168 wrap xcodebuild calls within ruby system environment #176

Merged
merged 3 commits into from Jan 12, 2016

Conversation

lacostej
Copy link
Contributor

@lacostej lacostej commented Jan 7, 2016

This pull request aims to provide a safe wrapper.

The xcbuild-wrapper.sh originates from a gist linked from a stackoverflow, and was modified to make sure it works when:

  1. using rvm
  2. using rbenv
  3. using system ruby under the following conditions:
export GEM_HOME=/Users/lacostej/.gem/ruby/2.0.0
export PATH=/Users/lacostej/.gem/ruby/2.0.0/bin:$PATH
gem install bundler
bundle install
fastlane ...

I suspect this is good enough and I don't need to use sudo to test the same thing.


@wrapped_xcodebuild_path = File.join("/tmp", "xcbuild-safe.sh")

unless File.exist?(@wrapped_xcodebuild_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why we don't just run it directly from there?

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of copying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally meant it like that because of:

  • cleaner command line
  • easy to access the script to modify it and adapt it while developing
  • similar to the way we install other wrapper scripts.

But I can see that this can cause problems with upgrades as is (it your newer version of gym contains an improved wrapper, it won't be copied over).

So I'll make it run in place instead. I'll fix it later today.

@KrauseFx
Copy link
Contributor

KrauseFx commented Jan 8, 2016

Thanks for testing this. We'd need to test it on a System Ruby installation as well before we can merge it 👍

@claybridges
Copy link

My little gist done all growd up!

@KrauseFx
Copy link
Contributor

KrauseFx commented Jan 9, 2016

Thanks @lacostej for preparing this. As this is taken from https://gist.github.com/claybridges/cea5d4afd24eda268164 via @claybridges we'd also need to be sure the license is okay.

@claybridges do you give permission to merge this in under the MIT license of fastlane?

@KrauseFx
Copy link
Contributor

KrauseFx commented Jan 9, 2016

@lacostej There seems to be a merge conflict 😢

@lacostej
Copy link
Contributor Author

lacostej commented Jan 9, 2016

Merge conflict was 9cda56e which had been fixed as de553c5 already. I just dropped it from the branch.

@lacostej
Copy link
Contributor Author

lacostej commented Jan 9, 2016

WRT the gist license, @claybridges's gist went from 5 lines including shebang and enabling debugging to 14, so I hope it's not that of a blocker :)

While I am at it, there are probably other ways to implement this, like in pure ruby: https://github.com/pitluga/subcontractor/blob/master/lib/subcontractor/cli.rb#L9-L33

@claybridges
Copy link

Hi guys. I release this tiny script into the public domain with no copyright attachments whatsoever. Happy it's seeing some use.

@lacostej
Copy link
Contributor Author

Merci @claybridges !

KrauseFx added a commit that referenced this pull request Jan 12, 2016
Issue #168 wrap xcodebuild calls within ruby system environment
@KrauseFx KrauseFx merged commit e77dc79 into fastlane-old:master Jan 12, 2016
@KrauseFx
Copy link
Contributor

Perfect, thanks @claybridges and @lacostej 🚀

@lacostej lacostej deleted the features/wrap_xcodebuild branch January 27, 2016 13:16
@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants