Closed Bo98 closed 2 years ago
10.11 cross-compile on 10.13 (using 10.11 dev tools: Xcode 7.3.1)
So the way I've done this is very much like a cross-compile that people would do for cross-archs or cross-systems. It sounds like overkill for doing so across macOS versions, but I think it is significantly safer to do so as it should disable any runtime configure checks that base things on the current running OS.
One caveat of cross-compiling is that Ruby requires the host Ruby to be the same version, which it isn't here. Instead of compiling twice, I have put in a workaround to use the in-tree miniruby
like the native build would. It's definitely a bit hacky but at least it doesn't require any inreplace
calls.
OpenSSL build currently fails for unrelated reasons. Looks like a test certificate has expired the moment we've entered June. It affects upstream's CI too so there should be a patch there soon. Once that's fixed we should have a test bottle we can try.
@Bo98 Nice work here so far. Just FYI: I think given the amount of code changes we're requiring for this: unless this works with minimal/no more code changes needed by EOD today or tomorrow: we should just raise the minimum requirement to 10.12 instead.
I think this is it - I don't plan any more changes. OpenSSL change is unrelated, so the only code changes are:
--build
and --host
to enable cross-compiling for the formulae using autotools configure.Here's a bottle build you can try: https://github.com/Homebrew/homebrew-portable-ruby/suites/6748677066/artifacts/257816018. It's not the release build since it doesn't have the revision bump but it's otherwise complete I think.
brew tests
passes with this on El Capitan, except some Cask quarantine tests, which are definitely a recent-ish regression but not likely to be Ruby related. So it looks like our cross-compile setup works!
I'm also going to run it against Ruby's test suite (or at least the parts which can run against an external Ruby install) but I reckon anything it flags there will be pre-existing.
Great work @Bo98!
Homebrew 3.5.0 is targetted to drop Yosemite support, so let's drop it here too.
I've set up a temporary CI node to test a 10.11 cross-compile on 10.13 (using 10.11 dev tools: Xcode 7.3.1). Very much an experimental setup but we'll see how it works.
CI changes will be dropped from the PR and I'll do it properly in a subsequent PR.