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

Install Vim runtime to the MacVim app bundle properly #1430

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

ychin
Copy link
Member

@ychin ychin commented Sep 11, 2023

Previously, MacVim's build process simply used an Xcode post-build script to copy the runtime folder to the target app bundle's Contents/Resources/vim/runtime folder and called it a day. However, that's actually not the correct procedure because the runtime folder contains misc files (e.g. Makefile/testdir for testing) and they should go through a install step using make install to properly deploy the proper files to the target folder.

Fix this by changing the post-build script to call the relevant make targets instead of just blindly copying it over. We still copy the vim/view/etc and vimtutor binaries separately for now, because the mvim script is a custom script for MacVim, although that could change in future.

One of the corollary of using the builtin installation scripts is that man pages (for CLI vim/gvim usage) are now properly generated. They are now stored under MacVim.app/Contents/man, and a user can set MANPATH to it if they so wish.

Another corollary is that we now bundle xxd with MacVim like most Vim distributions. It was probably an oversight before, and now it's built and bundled in the MacVim.app/Contents/bin folder like the vim/view/mvim scripts.

One annoying thing with Xcode is that in order for incremental builds to work properly we want it to only run this installation step if the runtime folder has changed (it takes a couple secs to finish) and Xcode's input file lists doesn't support recursive folder search. To fix this, add a build step to manually generate the list of all runtime folders called runtime_folder_list.xcfilelist which we pass to the build step.

Fix #1417

@ychin ychin added this to the Release 178 milestone Sep 11, 2023
Previously, MacVim's build process simply used an Xcode post-build
script to copy the runtime folder to the target app bundle's
Contents/Resources/vim/runtime folder and called it a day. However,
that's actually not the correct procedure because the runtime folder
contains misc files (e.g. Makefile/testdir for testing) and they should
go through a install step using `make install` to properly deploy the
proper files to the target folder.

Fix this by changing the post-build script to call the relevant make
targets instead of just blindly copying it over. We still copy the
vim/view/etc and vimtutor binaries separately for now, because the mvim
script is a custom script for MacVim, although that could change in
future.

One of the corollary of using the builtin installation scripts is that
man pages (for CLI vim/gvim usage) are now properly generated. They are
now stored under `MacVim.app/Contents/man`, and a user can set MANPATH to
it if they so wish.

Another corollary is that we now bundle xxd with MacVim like most Vim
distributions. It was probably an oversight before, and now it's built
and bundled in the `MacVim.app/Contents/bin` folder like the
vim/view/mvim scripts.

One annoying thing with Xcode is that in order for incremental builds to
work properly we want it to only run this installation step if the
runtime folder has changed (it takes a couple secs to finish) and
Xcode's input file lists doesn't support recursive folder search. To fix
this, add a build step to manually generate the list of all runtime
folders called runtime_folder_list.xcfilelist which we pass to the build
step.

Fix macvim-dev#1417
@github-actions github-actions bot added the CI Vim upstream label for CI issues label Sep 11, 2023
@ychin ychin merged commit a340dda into macvim-dev:master Sep 11, 2023
4 checks passed
@ychin ychin deleted the install-runtime-properly branch September 12, 2023 00:16
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacVim does not properly copy runtime files to the app bundle
1 participant