realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

CI - M1 Setup

Open sync-by-unito[bot] opened this issue 2 years ago • 4 comments

The Realm JS team needs an M1 self-hosted runner in order to properly ensure Realm JS functions on an M1. This ticket will be used to track what is needed to be configured on this machine:

  • homebrew
  • ccache
  • cmake
  • watchman
  • ios-deploy
  • android build environment
  • ios build environment
  • nvm
  • ??? anything else ???

sync-by-unito[bot] avatar Aug 10 '22 14:08 sync-by-unito[bot]

The Kotlin team will only be using the M1 for building and testing things specifically for the M1, so by the looks of it we only need ccache, cmake and XCode right now.

I'm slightly concerned about how we handle different versions though, e.g. Kotlin has checks and limits on what versions of cmake we can use, since their versions have various breaking changes. Right now we are using 3.22.1. So maybe we need to find a pattern where multiple versions can be installed and then setup on the PATH

cmelchior avatar Aug 24 '22 08:08 cmelchior

I'm not sure I understand the need for all those items on the list. To be clear, the intention is to run macOS tests on the M1 runner, not build anything native or run any mobile platform tests. Can you clarify the need for the software listed above and make sure to remove anything that is not strictly necessary.

nirinchev avatar Aug 24 '22 09:08 nirinchev

I would recommend against homebrew - the self-hosted builders are not ephemeral and we should be able to provision what we need ahead of time instead of installing things during the build.

@cmelchior CMake is backwards-compatible so you really shouldn’t need to keep multiple versions around. If you’ve had issues with compatibility please ping me and I’ll be happy to help you solve them so you aren’t dependent on a set of CMake versions.

@nirinchev I’m not sure about Kotlin, but the JS tests on Node.js and React Native sadly require ability to build the test application on the same machine it runs on and the cost of splitting building and running tests across CI machines is not trivial.

fealebenpae avatar Aug 24 '22 10:08 fealebenpae

Yeah, building the tests on the machine is fine, but we've already built the native binaries there, so I imagine we'd only need node and whatever RN needs to build an application.

nirinchev avatar Aug 24 '22 11:08 nirinchev

I have updated the description, and software on the list should make it possible to build for node.js.

kneth avatar Oct 19 '22 11:10 kneth

ccache/cmake/nvm should be available from the runner now. Homebrew is installed, but the github runner doesn't have permission to install things.

bwachter avatar Nov 02 '22 12:11 bwachter

Unfortunately the Kotlin buildsystem also requires the Android SDK, even though it is building for Mac

cmelchior avatar Nov 04 '22 11:11 cmelchior

@kneth What's the status of this and what's missing (if anything)?

bmunkholm avatar Jan 11 '23 12:01 bmunkholm

@bmunkholm

kneth avatar Jan 11 '23 12:01 kneth

I had clarified in slack that "android SDK" means "platform tools", which are available - so for both I'm waiting for feedback.

This has been added last week: https://github.com/realm/realm-dart/issues/1104

A new requirement is CocoaPods (didn't find a new issue for that) which needs some discussion.

bwachter avatar Jan 26 '23 10:01 bwachter