macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.51k stars 683 forks source link

Update Python3 from 3.10 to 3.11 in CI #1340

Closed ychin closed 1 year ago

ychin commented 1 year ago

Also, refactor CI configs to only specify the Python 3 and Perl versions in one place, so we don't have to multiple lines in the config file. Additionally, add checks to make sure the Homebrew Python 3 version matches the configured one, so we will have a failed build and be notified this way instead of silently building against an old version of Python in CI, which would still work as GitHub CI has older versions of Python installed.

ychin commented 1 year ago

Need to wait till Homebrew has made the switch to point python3 alias from 3.10 to 3.11 before this can be merged and pass builds.

eirnym commented 1 year ago

Can we have 2 builds, with python 3.11 and 3.10 in parallel (last 3 major versions as supported would be the best, but last two is enough). I think that many devs would appreciate it

ychin commented 1 year ago

Why would we need to do that? We can't just build against all permutations, nor would most users want to have to worry about something like this when they download the app and use the software update. The only differentiation we make now is just to support macOS 10.9 - 10.12 and that's only because it's impossible to build a backward compatible build that supports macOS 13.0 Ventura features.

MacVim is built against the common use case (brew install python3). If people want to use off-nominal Python versions somehow, they can just use pythonthreedll to set it. While using a different version of Python is not guaranteed to work, in reality it works just fine. Python also supports multiple installed versions, so even if they have other versions of Python installed there's no reason why they can't also install 3.11 and use that for Vim.

eirnym commented 1 year ago

I understand you. With Python and MacVim it's always a Russian roulette (you never know what feature break first and how fast), when you use a version different from default.

Let's state some obvious things:

To minimise time and resources used and maximise result I propose following

ychin commented 1 year ago

I understand you. With Python and MacVim it's always a Russian roulette (you never know what feature break first and how fast), when you use a version different from default.

That's why the policy is just to have MacVim build against the latest Python release. Some of the issues we have seen before came from MacVim not staying on top of things and building against old Python versions even though Homebrew has long since pinned to the newer version. As long as we do that, people can just use brew upgrdae python3 and that's all they need to know.

Python ABI is different and it's not backward compatible

Fair enough, but I just don't see this as a huge issue in reality, as long as people keep Python 3 up-to-date. And most of the time when they use an old DLL it's not going to break anyway. The ABI isn't that unstable.

there's a lot of native code which is dependent on Python version and platform

What do you mean native code? The only thing that matters here is Vim plugins. I'm not personally aware of any Vim plugins that require older versions of Python3. If those plugins exist they should upgrade to be 3.11 compatible, because if a user has more than one Python plugins installed, it's not like Vim can easily run multiple Python versions at the same time easily.

I couldn't care less about other Python code the user has for their own code. A lot of people have multiple versions of Python installed on their computer and it works just fine. As long as they have the latest (3.11) installed, MacVim will work fine with their Python Vim plugins.

there's 3 latest versions of Python Language is officially supported

Sure, but that has nothing to do with what MacVim builds against.

To minimise time and resources used and maximise result I propose following

  • build MacVim for all supported Python versions

  • run all tests for a single version of Python (it's the biggest part of tests),

  • run only Python tests for all other Python versions (it's only a very small portion of tests)

I don't think this is a good idea. Maybe I am just not understanding the rationale here. Why can't users just install Python 3.11? If they care so much about using older versions like 3.10 they can build MacVim themselves, as I currently don't see a good reason why they should be opposed to simply install 3.11. They don't have to make 3.11 the default Python on their system either (just don't brew link it). It just needs to be installed. People who are serious about using older versions of Python probably would have some kind of pyenv type setup anyway.

Building multiple binaries is a lot of work. Running tests is the least of our worries. It requires signing/notarization, and it significantly complicates the software update design. It also makes it complicated for the user who has to now understand the intricacies of the different builds to decide which one to download, while 99% of them wouldn't care about this at all.

ychin commented 1 year ago

Merged this for now. Stable ABI is still sitting in Vim's PR queue, unfortunately.