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

Supporting multiple versions of xcode #1964

Closed
AshCripps opened this issue Oct 17, 2019 · 11 comments
Closed

Supporting multiple versions of xcode #1964

AshCripps opened this issue Oct 17, 2019 · 11 comments

Comments

@AshCripps
Copy link
Member

From disscusion here: nodejs/node#29493 (comment)

What is the opinion on multple xcode version?

From a bit of research you can use xcode-select to change versions inside select-compiler.sh but this requires sudo root to do so which the iojs user on the build machines does not have.

This gives two options:

  • Edit the sudoers file to whitelist xcode-select for the iojs user, and then edit select-complier to call xcode-select.
    or
  • Have multiple machines running different versions of xcode to run the builds
@sam-github
Copy link
Contributor

More versions on single machines uses less bulid machines, which seems good, so perhaps the sudoers route is the way to go? Also, old xcodes are only used for LTS lines that are rarely built, keeping the machines around for rare use isn't efficient.

Note that xcode selection (as you'd guess from needing to be root) is global, so only one built at a time could run on a machine... but maybe its like that already, its not good to have parallel builds on the same machine.

@rvagg
Copy link
Member

rvagg commented Oct 17, 2019

I think it's safe to assume a single build will occur on a machine at one time. To be safe we should probably have a default version that is always set at the end of a run regardless of what happens, because there are numerous jobs that use the osx machines other than standard test builds, like citgm and libuv, it'd be annoying for them to have one compiler for one run and another for the next.

We could create a sudoers special-case for xcode-select, we already do that on some hosts that use Docker to switch environments, giving narrow access to a certain command

- name: docker | give {{ server_user }} sudoers access to docker-exec script
lineinfile:
line: "{{ server_user }} ALL=(ALL) NOPASSWD: /usr/local/bin/docker-node-exec.sh"
dest: "/etc/sudoers"
regexp: docker-node-exec.sh$

More machines will be a bigger problem, so we should try and solve this for single machines. We need to handle this for release builds too.

@rvagg
Copy link
Member

rvagg commented Oct 17, 2019

How do we get the multiple versions of xcode onto these machines? We currently have to resort to this abomination for older versions already https://github.com/nodejs/build/blob/master/ansible/roles/package-upgrade/files/install-xcode.sh, only George has experience with that one, so I guess one of us needs to upskill here, upgrade it for 10.9, 10.10, and get ansible to do the multiple-versions thing.

@sam-github
Copy link
Contributor

If we are going the sudoers and less machines route, then @AshCripps is going to take a shot at figuring this out. He's not in the buildwg yet, not even a node collaborator, but he's working on our team and once he's made enough contributions to demonstrate his usefulness, we'll nominate him.

@rvagg
Copy link
Member

rvagg commented Oct 18, 2019

oh, awesome, help managing our macstadium setup is certainly something we're in need of

@AshCripps
Copy link
Member Author

Old versions of xcode can be found here - https://developer.apple.com/download/more/

You can scroll through the list select just the command line tools options and grab the link from there.

The link can be curled in the same way as is done in install-xcode.sh

if [[ "$osx_vers" -eq 8 ]]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_osx_mountain_lion_april_2014.dmg
fi
TOOLS=cltools.dmg
curl "$DMGURL" -o "$TOOLS"

Just need to update the script to install the versions of xcode we want.

Made a first pass at editing select-compiler.sh - #1967

I have discovered on my local machine that xcode8 does not run on mojave so we would have to be more selective on which machines run older node version builds as newer os's cannot run some older versions of xcode

@mhdawson
Copy link
Member

We'd want to install 2 or more versions on the same machine. It might make sense to have ansible select which ones to install based on the osx version. Ideally we could set a list of each OSX version that would control which xcode versions would be installed. We would then use the selector script to build each Node.js version on machines with the right osx/xcode combinations.

@rvagg
Copy link
Member

rvagg commented Oct 25, 2019

don't know if it's helpful but @cclauss just shared this with me: https://blog.macstadium.com/blog/catalina-released-and-live-on-orka

@cclauss
Copy link
Contributor

cclauss commented Oct 27, 2019

Unfortunately, MacStadium does not yet appear to support macOS 10.15 Catalina (scroll down to Choose your OS). Given that MacStadium are the source of Macs for both Node.js Jenkins and GitHub Actions CI and given that neither CircleCI nor Travis CI currently support Catalina I am currently out of options to test the current release of macOS.

@sam-github
Copy link
Contributor

Conversation on getting recent OS X hosts running in macstadium is #1732

@sam-github
Copy link
Contributor

We don't want to do this anymore, we want to always build on a current Xcode, specifically, a current enough one to do notarization, so while experimentation was done on using xcode-select to choose an Xcode version based on the release line, that turned out to be a dead end.

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

No branches or pull requests

5 participants