Open phil-blain opened 4 years ago
Due to Qt’s long-term servicing approach, Qt 5.10 and 5.11 are only available in source releases. LTS branches are 5.9, 5.12 and 5.15.
So https://download.qt.io/archive/qt/5.9/5.9.9/qt-opensource-mac-x64-5.9.9.dmg.mirrorlist is a supported copy of Qt for older MacOS.
Starting in 5.15, LTS releases will not occur after the next version increment (Qt is switching to a model similar to Java’s), which means compiling from open source or applying patches to source would be the only way to stay current on older versions of Qt. I’d be okay with the new policy if backwards compatibility were maintained, but to see that get disregarded so quickly means if a third-party developer (us) want to support older releases, we’d have to compile our own distribution of Qt.
That said, it’s possible the only incompatibility Qt has is that by default the compatible SDK define is set as 10.13 at https://doc-snapshots.qt.io/qt5-5.15/macos.html#target-platforms ... it’s thus possible to set that value to an earlier value, 10.11 for example, and then run UI test suites in 10.11 to validate the app’s functionality. To that end, older macOS support is very likely limited by what VMs we have available for automated CI testing in future, and we’d probably have to compile those older Mac VMs ourselves or simply say the builds are experimental.
Thanks for looking into this and providing this extensive description! I think it would be a good idea to move to Travis for our macOS builds, if it also works for all languages. Currently I'm building macOS builds locally on my machine, which sometimes causes some issues.
@egraether on your machine do you build with make, ninja or Xcode (or xcode-build) ? I was surprised that I needed to tweak bundle_install.sh.in
to fix the library paths for Sourcetrail_indexer
...
Xcode
Thanks for looking into this and providing this extensive description! I think it would be a good idea to move to Travis for our macOS builds, if it also works for all languages. Currently I'm building macOS builds locally on my machine, which sometimes causes some issues.
Apologies for the driveby but I noticed this linked from Homebrew's issue tracker. I'd strongly recommend using GitHub Actions rather than Travis CI if you're building on macOS; the workers are significantly more powerful.
You may notice I am a GitHub employee: this is unrelated to the above; if I thought GitHub Actions was trash I wouldn't be using it for Homebrew (as I'm not paid for my Homebrew work) 😁
As I discovered in https://github.com/CoatiSoftware/Sourcetrail/issues/619#issuecomment-609498312, the currently available binary releases of Sourcetrail (2020.1.117, 2019.4.102 and 2019.4.61) all do not work on macOS 10.11. When clicked, the app appears in the Dock for a few milliseconds then disappears.
As @egraether made me realize in https://github.com/CoatiSoftware/Sourcetrail/issues/619#issuecomment-609501931, this is due to the fact that the app is built against a version of Qt > 5.11 (5.12 according to the README), and Qt 5.11 is the last release supporting El Capitan.
I was able to compile the app against Qt 5.11 using Travis CI, it can be downloaded from my fork: https://github.com/phil-blain/Sourcetrail/releases/tag/el_capitan
I will describe the steps I took if other people want to use Sourcetrail on El Capitan and don't want to just download the binary from my fork.
The plan
.travis.yml
by the macOS build script below, commit, push and let Travis build the app for you!Justification for using Travis
I first tried to download and install Qt 5.11 locally, but for an unknown reason neither Qt 5.10 nor Qt 5.11 are available on the Qt downloads archive. I also tried extracting the Qt@5.11 formula from Homebrew and using it to build Qt 5.11 and my Mac but there was an obscure compilation error that I did not want to dwelve into.
Detailed steps
1. Extracting Qt@5.11
We will use Homebrew to install Qt 5.11 in the Travis environment. The recommended way to install old versions of packages with Hombrew is
brew extract
.Note: this step can be skipped if you want to use my extracted formula: https://github.com/phil-blain/homebrew-versions/blob/master/Formula/qt%405.11.rb
Fix the extracted formula to be able to use existing bottles, i.e. apply this patch to the formula:
homebrew-versions
, add it as yourorigin
remote and push:2. Transforming
.travis.yml
for building on macOS.The current
.travis.yml
file in the repo is used to build on Linux. We will remove its content and replace it with instructions to build the app on macOS, and use Travis' integration with GitHub releases to get a downloadable disk image and zip archive.Clone your fork of Sourcetrail, then replace the content of the
.travis.yml
with the following:Don't forget to replace
<gh_username>
with your GitHub username, or mine (phil-blain
) if you want to use my extracted formula.Notes:
osx_image: xcode9.4
(one of Travis' High Sierra images) because all Sourcetrail dependencies exists in Hombrew as binary packages for High Sierra, which speeds up the build a lot.export MACOSX_DEPLOYMENT_TARGET=10.11
for the app to be able to run on El Capitan.Then, create a new branch and commit:
Then, install the Travis CI command line client to setup deployment to GitHub releases.
Setup the integration.
This should add a
deploy
section to the.travis.yml
.Modify the
file
entry and addon.tags
andskip_cleanup
sections, so that thedeploy
section looks like this:Don't forget to replace with your GitHub username.
Commit this change:
I also needed to modify the
bundle_install.sh.in
CMake script template so that the needed library paths for theSourcetrail_indexer
companion app are relocatable. Also, I removed interaction (read
), skipped app notarization since this is not needed on El Capitan, and added a zip archive. Apply this patch:Note: this patch can be applied by copying the above content, pasting it a file that you name
bundle.diff
, then runninggit apply bundle.diff
.Then, commit it :
Tag this commit and push it to your fork:
Travis CI will build the app and deploy it your fork. You can monitor the process by navigating to
https://travis-ci.com/github/<gh_username>/Sourcetrail
Once the build is green, navigate to
https://github.com/<gh_username>/Sourcetrail/releases/tag/el_capitan
, download the disk image or the zip file, install the app and enjoy !Caveats
.travis.yml
will build Sourcetrail with support for C++ only (since this is what I use). Refer to the README and the Travis CI macOS build environment documentation for adding Java and Python support.At link time, you will get a lot of warnings regarding LLVM objects:
The app seems to work fine despite these warnings.