aqtinstall icon indicating copy to clipboard operation
aqtinstall copied to clipboard

Update Mac CI pipelines to use MacOS-11

Open ddalcino opened this issue 1 year ago • 2 comments

The MacOS-10.15 CI runners are now deprecated, and will begin brownouts in August. See discussion here: https://github.com/actions/virtual-environments/issues/5583

~MacOS-11 is also available, in case there are any issues with 12.~ There are issues with 12 so I went to 11.

Update: Something's wrong with MacOS-11 too: https://dev.azure.com/miurahr/github/_build/results?buildId=5481&view=logs&j=bae13455-f657-522d-e2b4-64495419fb63&t=5c902093-735e-5ee6-b7c8-ba98a93e04e2&l=58

ddalcino avatar Jul 24 '22 08:07 ddalcino

Maybe it's too early to go up to MacOS-12 yet: this ios build failed, because there's a file at Qt/6.2.2/ios/mkspecs/features/uikit/devices.py that specifies that it must be run with /usr/bin/python in the shebang. MacOS-12 removed /usr/bin/python in 12.3, because it was a version of Python 2. Python 3.8 is still at /usr/bin/python3.

I am not sure if we can (or should) get around this by adding a symlink at /usr/bin/python to python3. It's probably not a good idea, and not something we should expect our users to do. I think this is probably something the Qt devs should fix.

ddalcino avatar Jul 24 '22 16:07 ddalcino

Ok, I don't know why the ios builds are using a "legacy build system" in CI, but until we figure out how to use the "new build system", our ios builds are going to fail in CI. There are docs on apple.com that describe the fix using a GUI interface here: https://help.apple.com/xcode/mac/current/#/dev396bc94c7. I do not see any way to choose the build system in a headless environment. Maybe this can be done in Applescript?

It's hard for me to see this issue as anything other than a bug in the MacOS-11 environment.

I'll change this to "draft" status until the issue is fixed.

ddalcino avatar Jul 24 '22 22:07 ddalcino

I took another look at Qt/*/ios/mkspecs/features/uikit/devices.py, and here's what I've found so far:

  • The shebang line in this file, for every version of Qt that I have looked at starting at 6.3.0, requests /usr/bin/env python3. Additionally, the 7z archive filenames indicate that they have been built for MacOS 11 or 12.
  • For Qt 6.2.4, and several earlier versions that I checked, the shebang line specifies /usr/bin/python, which is generally Python 2 on MacOS. The 7z archive filenames indicate MacOS 10.15 or earlier.
  • For some reason, despite requesting /usr/bin/python in the devices.py file, the Qt 6.2.2 job on MacOS 11 and 12 passed, while the Qt 5.15.2 job did not. I cannot explain this.

I am getting the impression that Python 2 is necessary to complete the older ios builds successfully. There are ways to do this on modern MacOS; we could try using pyenv.

However, keep in mind that every version of Qt 6.1 and below is now past end-of-life. Qt 5.15.* LTS is not past end-of-life, but the newest versions aren't available via aqtinstall (they are paid only). We should seriously consider dropping support for the older ios versions. It's probably not a good idea to install Python 2 in CI, or try to convince the system that Python 3 will do the same job as Python 2, as suggested earlier.

ddalcino avatar Sep 14 '22 05:09 ddalcino

Ok, I've gotten a little further, and here's what I've found:

I was able to install Python 2, and convince the Python 2 files in Qt to use the right version of Python. This helped, but it was not sufficient to fix the failing builds.

The Qt 5.15.2 and 6.0.4 binaries available on download.qt.io are built for MacOS 10.14, which was released four years ago. qmake from Qt 5.15.2 and 6.0.4 will build a Makefile that relies on the 'legacy build mode' of the XCode toolchain, for every version of XCode since version 10 (the version of XCode that works with MacOS 10.14). 'Legacy build mode' was the default build mode in MacOS 10.14. It is not the default in MacOS 11 or 12. You can turn it on with a command line flag, but I'm not sure how to do that in CI. If we want to continue testing Qt 5.15.2 and 6.0.4 in CI, we will need to find a way to turn this flag on.

Unfortunately, legacy build mode will be removed in a future version of MacOS. Any effort we put into this will be undone as soon as Apple removes legacy mode.

The Qt 6.1.4 build is a little different: The Qt 6.1.4 binary on download.qt.io was built for MacOS 11, and it does not require legacy build mode. The Accelbubble example mostly builds OK, but it fails when it tries to link to the -lqtsensors_ios library. There's a qtsensors module for every version of Qt 6.2 and greater, but I cannot find any evidence of a such a library anywhere in Qt 6.1.4. I think that if we want to test Qt 6.1.4 for ios, we should use an example that does not use qtsensors.

I think that at this point, we should only test ios builds for Qt 6.2 and up. It's only going to get harder to support older versions Qt for ios, and I don't think the effort is worth it. We should include warnings in our documentation about these issues, and state very clearly that we cannot provide support when users have trouble with Qt for ios 6.1.4 and below.

ddalcino avatar Sep 17 '22 19:09 ddalcino

I'd like to squash and merge. Thank you for hard work!

miurahr avatar Sep 18 '22 04:09 miurahr