Is there a way to force building on OS X

I have a sinatra app that needs to run on an OS X server. However when I try to configure this in Circle CI, it won’t let me add this to an OS X configuration. It looks at the repo as a linux app, not the MAC OS X app the I need.

Is there a way to force a repo to use OS X for the environment selection?

If you got to ‘Project Settings > Build environment’ screen you can set the build to run on OS X there.

Hope that helps,
Tom

Tom,

Thanks for the reply. This did in fact start to build on OS X, so thanks again. However it assumes that I need something built in Xcode as I’m getting the following message:

No shared schemes were found in your repo. Please ensure you have shared your
scheme. See the iOS documention for more information on sharing schemes.
Alternatively, you can explicitly set a scheme with the 'XCODE_SCHEME’
environment variable.

Action failed: Configure the build

However after reading the documentation, I don’t need anything built in Xcode, but do need Xcode installed. I then need my repo checked out and run like a ruby rake command.

This may not be doable, which is fine, but any thoughts here by you or anyone would be great.

Hi,

In the different phases that CircleCI will run through, machine, dependencies, test, deployment, etc there are sometimes commands that CircleCI will infer that you need based on your project. This is called Inference. You can override a specific phase, and run your own commands instead of what CircleCI infers but using the override section of that phase.

Our Configuration Guide explains how circle.yml works and how you can override phases.

Hi!

I’m having this same last error. I’ve tried overriding the settings. But in this case, Which setting is inferring? What do I need to override in order to prevent this error from happening?

Your build output shows you each phase and what is being run. You can look there, see what phase is running something you don’t want, and that’s the phase you override.

Thanks for the response!
There’s not enough information, at least for me that I never used CircleCi before. As you can see in the image, is telling me is trying to find a scheme. I know that’s something you need when you are building for IOS or an Xcode project which is not my case, and I know the problem is somewhere on the machine module. If you can tell what do I need to override from the image that would be great!

1 Like

I had to solve some other issues, and got back around to this today. I finally got it working based on the input from this thread, so thank you. I’m posting my circle.yml file in the hopes it helps someone else trying to do a similar setup/operation.

Keep in mind that I’m trying to run a ruby on sinatra application test suite that has to run on OS X with Xcode installed. I’m not testing a Mac or iOS application (yet), so I don’t need the usual Xcode build operations. Instead i need to set the ruby version I need (2.3.1), update bundler and then only run bundle exec rake, not Xcode build.

The other thing I needed done is the location of Xcode to be /Applications/Xcode.app, so I do a quick symlink to the 7.3.app location. This may break if circleCI changes the way they deploy their container. However, for now it works.

Like I said, this is working for me, hope it helps someone else…

circle.yml

## Customize the test machine machine: environment: XCODE_SCHEME: symbolicator XCODE_WORKSPACE: symbolicator # Turn off Ruby whinning RUBYOPT: W0 xcode: version: 7.3 dependencies: pre: # The application is expecting xcode to be installed in its normal location - sudo ln -s /Applications/Xcode-7.3.app /Applications/Xcode.app - brew uninstall --force ruby20 - brew install --force ruby - gem install bundler test: override: - bundle exec rake

Sorry I can’t get the formatting on the preview to look right, hopefully you can figure out the indentation from my example. If someone has a better way to update the formatting, let me know.

For formatting, you want to either wrap the whole bit in a code block (< / > button), or start the indenting at 4 spaces in.

I did use the </> but it doesn’t apparently work. Or I used it incorrectly.

Were you able to resolve this ? I am also trying to set up some projects which are not built using xcode instead other tool chains that depends on macos build system. I get the same error of XCODE_SCHEME not defined.

Yes, this has been working for several days, using the example configuration fie I posted. In my case, the app isn’t built by Xcode, but it does use it, hence the need for the XCODE_SCHEME.

Where you able to take what I posted before and modify it to your environment?

You will have to set a “phony” Xcode scheme and either project or workspace. We enforce that because we officially only support iOS and macOS projects on the platform.

Once you’ve done that our system is happy and you can do whatever you want on the build machine by specifying it in your circle.yml file. You will receive errors but it will build just fine.
Since you run a Sinatra app there isn’t really much that you require from Xcode dependency wise so you can happily ignore it.

/cc @tonymathew @limoragni