Drone

Exec runner & support for xcode projects

I want to continue a discussion happening in this github issue related to the exec runner creates a per-pipeline workspace for every build, where each workspace has its own HOME directory.

On MacOS, building native apps with Xcode is to all intents and purposes impossible with a redirected $HOME. In the most common scenario (using fastlane, xcodebuild etc) keychain security, provisioning profiles etc will be looking in the local user’s ~/Library directory for data.

An immediate workaround is to set the environment variable in your yaml, like this:

steps:
- name: build
  environment:
    HOME: /Users/drone

I am also interested in long-term solutions for improved xcode support. Please note that we use a custom HOME per-pipeline by design. We will need to work within these existing constraints, as opposed to changing how the runner works.

I am open to ideas and hoping to spark discussion in this thread.

I also think it would help to post simple example projects to github that demonstrate where the runner falls short. This will help the Drone maintainers better understand the problem and will help us experiment with and test solutions.

@bradrydzewski, I setup this repo to demonstrate the issue. https://github.com/CubicNitrous/rvm_test
The crux of the issue is being unable to use RVM which is installed on the Mac. With the current config as is anything we call that uses ruby tries to use the built-in ruby that comes with the OS.

Thanks for providing the example! Uust to clarify, is this related to HOME or PATH or both?

From what I can tell rvm has a configuration file installed in $HOME/.rvm. Would a solution to this problem be to allow you to populate the pipeline’s temporary HOME directory with files from another location?

For testing purposes, what happens if you do something like this:

steps:
  - name: setup
    commands:
      - cp -a /Users/foo/.rvm $HOME/.rvm
      - gem install bundler
      - bundle install
      - bundle exec fastlane

or this

steps:
  - name: setup
    commands:
      - cp -a /Users/foo/.rvm $HOME/.rvm
      - source $(rvm 2.6.3 do rvm env --path)
      - gem install bundler
      - bundle install
      - bundle exec fastlane

I noticed in the rvm documentation that you need to execute the source command when running in a non-interactive terminal session. https://rvm.io/rvm/basics#post-install-configuration.

Once we have an understanding of various problems and workarounds, we can start to figure out how to build permanent solutions into the system.