Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Python 3 stable ABI to build MacVim, and better Python discovery #1428

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

ychin
Copy link
Member

@ychin ychin commented Sep 9, 2023

Vim added support for using Python 3 stable ABI in 9.0.1776, which allows us to safely load Python libraries of a different version from what Vim was built against. Modify our CI to use that. This allows user to use whatever Python version they want as long as it's above the minimum target. Given that macOS/Xcode still ships with 3.9 by default, we build using 3.9 as the minimum version.

Also, change our Python detection script to work better. Change all explicit versions in our paths to refer to the "Current" version instead which for the most part should "just work" instead of requiring an exact match every time we or Python update to a new version (e.g. Homebrew will update the Current version to point to the latest Python3). Also add support for finding Python 3 from Xcode Command Line Tools which was previously not ok to use technically because it's 3.9 and before stable ABI support we couldn't load it safely as MacVim was built using newer versions.

Fix #1351.

Vim added support for using Python 3 stable ABI in 9.0.1776, which
allows us to safely load Python libraries of a different version from
what Vim was built against. Modify our CI to use that. This allows user
to use whatever Python version they want as long as it's above the
minimum target. Given that macOS/Xcode still ships with 3.9 by default,
we build using 3.9 as the minimum version.

Also, change our Python detection script to work better. Change all
explicit versions in our paths to refer to the "Current" version instead
which for the most part should "just work" instead of requiring an exact
match every time we or Python update to a new version (e.g. Homebrew
will update the Current version to point to the latest Python3). Also
add support for finding Python 3 from Xcode Command Line Tools which was
previously not ok to use technically because it's 3.9 and before stable
ABI support we couldn't load it safely as MacVim was built using newer
versions.

Fix macvim-dev#1351.
@ychin ychin added the Scripting Languages Python / Ruby / etc binding issues label Sep 9, 2023
@ychin ychin added this to the Release 178 milestone Sep 9, 2023
@github-actions github-actions bot added the CI Vim upstream label for CI issues label Sep 9, 2023
@ychin ychin merged commit ef2cacd into macvim-dev:master Sep 10, 2023
4 checks passed
@ychin ychin deleted the python3-stable-abi-search-path branch September 10, 2023 05:00
ychin added a commit that referenced this pull request Sep 12, 2023
Updated to Vim 9.0.1897

Special Notes
====================

As some of you may have read, Bram Moolenaar, the creator of Vim, has
[passed away](https://groups.google.com/g/vim_announce/c/tWahca9zkt4)
recently. He has worked tirelessly on Vim for more than 30 years and
this release is dedicated to him. If you would like, you could pay your
respects at [this discussion
thread](vim/vim#12737).

The Vim project has transitioned to new maintainers, and MacVim will continue
to be supported as long as Vim is around.

Features
====================

More flexible Python integration
--------------------

MacVim now allows you to use Python runtime (via `pythonthreedll`, used
for Python plugins) of any version at or above 3.9. Previously you had
to use the exact same version that was used to build MacVim (Python
3.11). The Python detection logic is also updated to always just find
the latest version of Homebrew Python instead of a fixed one, and it
will also now locate the default macOS / Xcode Python provided by the
Xcode Command Line Tools if that is the only Python available. This
should hopefully make configuring Python for MacVim a lot more seamless.
See `:h python3-stable-abi`. Vim v9.0.1776 / #1428.

New Vim features
--------------------

- New built-in support for [EditorConfig](https://editorconfig.org/) via
  an optional package. Use `packadd editorconfig` to activate it. See
  vim/vim#12902.
- `g<End>` now goes to the first non-blank char. v9.0.1753
- API changes
  - `undotree()` now takes a bufnr v9.0.1686
  - `printf()` now takes positional arguments v9.0.1704
  - `virtcol()` now takes winid v9.0.1728
  - quickfix items can now have user data v9.0.1688
- Miscellaneous security fixes.

Security Fixes
====================

- Fixed insecure usages of interprocess communication in MacVim
(CVE-2023-41036)

Fixes
====================

- Fixed MacVim to correctly set up the runtime folder in the app bundle.
  As a corollary, `xxd` is now bundled with MacVim like most other Vim
  distributions, and MacVim.app now provides man page for the CLI vim
  commands if the user wants to associate man pages with the `mvim`
  comamnd (see `:h macvim-PATH`). #1430
- Fixed Vim occasionally crashing and/or hung when autocmd calls
  `serverlist()` on exit. #1427

Scripting
====================

- Scripting languages versions:
    - Python now supports 3.9 or above.

Compatibility
====================

Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)

Script interfaces have compatibility with these versions:

- Lua 5.4
- Perl 5.30
- Python2 2.7
- Python3 3.9 or above
- Ruby 3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Vim upstream label for CI issues Scripting Languages Python / Ruby / etc binding issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Macvim does not find standard macOS python3
1 participant