1
mirror of https://github.com/neovim/neovim.git synced 2024-12-29 14:41:06 -07:00
Commit Graph

163 Commits

Author SHA1 Message Date
dundargoc
e268fcbdaa build: work around bug in make when PATH includes cmake as dir
There appears to be a bug in `make` where if a rule asks `make` to
invoke a command called `foo`, and `foo` exists somewhere in `$PATH` as
a directory (not an executable file), `make` will attempt to `execve`
that directory instead of continuing to search in later parts of the
`$PATH` for `foo` as a true executable.

The cause can be traced back to a bug in Make 4.3 which stems from their
use of the findprog function in Gnulib. This was reported to the Make
maintainers here:

https://savannah.gnu.org/bugs/index.php?57962

and then forwarded to the Gnulib maintainers here:

https://github.com/coreutils/gnulib/commit/7b1de4a

Make 4.4 does not have this bug, and I can confirm that I'm able to run
make in the Neovim repo with no further modifications to my system than
upgrading the version of make I'm using to 4.4 or 4.4.1.

As the change is small enough, and it's unlikely that make version
around the world is going to be updated in a timely manner, it makes
sense to just add a workaround for this. Using `command -v` to resolve
the `cmake` command, similar to what is already being done with
`cmake3`, makes it work correctly in all cases. Continuing to include
`... || echo cmake` at the end means that if neither `cmake3` nor
`cmake` are installed, the user will still see a message about CMake
being missing.

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
2024-09-20 22:16:34 +02:00
dundargoc
ef8067a19d build: add quotes around CMAKE_GENERATOR variable
This will fix the following error when using generators that have a
space in them, e.g. "Unix Makefiles":

"CMake Error: Could not create named generator Unix".

Closes https://github.com/neovim/neovim/issues/30218.
2024-09-02 17:37:15 +02:00
dundargoc
4ee65484b1 build: make makefile work on windows
Using powershell as the default windows shell as using cmd alters $PATH
in a way that makes building neovim fail (powershell prioritizes visual
studio tools which is arguably more correct).

This was tested with gnu make for windows, which can be installed with
e.g. scoop. It does not work with nmake and it is extremely unlikely we
want to add nmake support as the makefile is merely supposed to be
syntactic sugar for the most common case. For similar reasons, the only
supported generator is ninja.
2024-08-31 23:05:36 +02:00
dundargoc
3085c9d9da revert: "Makefile: use pattern rules for build/.deps ()"
This reverts commit 7f6ff829aa.

The given reasoning and usecase is unsatisfactory. While it is true that
it allows to run `make build/bin/nvim`, it can easily be recreated with
`ninja -C build bin/nvim` which does the exact same thing. This minor
convenience is not worth adding the extra code given how rare this
usecase should be.
2024-08-28 12:37:29 +02:00
Gregory Anders
a75ef40f4c
build: set deps default build type to Release ()
Debugging dependencies is rare so a Debug build type is usually not
needed. In cases where it _is_ needed it is easy to rebuild in Debug
mode. But since Release builds are more common, it makes more sense as a
default.

For Neovim itself we stick with a Debug build as a default, since
rebuilding and debugging is done _much_ more frequently than with
dependencies (which we _mostly_ expect to "just work").

Also remove the CMAKE_BUILD_TYPE variable in the Makefile, since this is
set by default in CMake.
2024-02-16 11:56:52 -06:00
Jongwook Choi
01e82eba20
build(docs): separate lint job to validate vimdoc
Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc,
it is no longer as a part of functionaltest (help_spec).

Build (cmake) and CI:

- `make lintdoc`: validate vimdoc files and test-generate HTML docs.
  CI will run this as a part of the "docs" workflow.

- `scripts/lintdoc.lua` is added as an entry point (executable script)
  for validating vimdoc files.

scripts/gen_help_html.lua:

- Move the tests for validating docs and generating HTMLs from
  `help_spec.lua` to `gen_help_html`. Added:
  - `gen_help_html.run_validate()`.
  - `gen_help_html.test_gen()`.

- Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from
  `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files
  on `./runtime/doc`, not on `./build/runtime/doc`.

- Add type annotations for gen_help_html.
2024-01-28 14:22:39 -08:00
dundargoc
ae3eed53d6 build: various build improvements
- remove "ran-" prefix from touch files as it's redundant since the
  they're already in the directory named `touches`.
- Include `contrib` when formatting with `make formatlua`.
- Use TARGET_FILE generator expression instead of assuming the
  executable location.
- reuse logic that determines whether to use lua or luajit.
- add translations to the `nvim` target.

Makefile improvements:
- rename variable `CMAKE_PRG` to `CMAKE` to make it more consistent with
  the builtin `MAKE` variable.
- stop propagating flags to generator. Users should use cmake for
  non-standard use cases.
- remove `+` prefix from targets. If the user for whatever reason wants
  to dry-run a target then they should be able to.
2024-01-24 12:41:09 +01:00
dundargoc
af93a74a0f refactor: run IWYU on entire repo
Reference: https://github.com/neovim/neovim/issues/6371.
2023-12-21 17:38:42 +01:00
zeertzjq
8533adb484
refactor(IWYU): move decor provider types to decoration_defs.h () 2023-12-21 16:50:05 +08:00
zeertzjq
6abdc1ac1f
refactor: split WIN_EXECUTE() into two functions () 2023-12-18 09:05:59 +08:00
zeertzjq
d82a586a9e
refactor: move some anonymous enums back to non-defs headers ()
It isn't really useful to put anonymous enums only used as arguments to
functions calls in _defs.h headers, as they will only be used by a file
that calls those functions, which requires including a non-defs header.

Also move os_msg() and os_errmsg() back to message.h, as on Windows they
are actual functions instead of macros.

Also remove gettext.h and globals.h from private/helpers.h.
2023-12-18 06:18:11 +08:00
dundargoc
69bc519b53 refactor: move non-symbols to defs.h headers 2023-12-17 19:03:18 +01:00
zeertzjq
1457272726
refactor(IWYU): move marktree types to marktree_defs.h () 2023-12-05 20:05:12 +08:00
zeertzjq
0bbe8e7fc2
refactor(IWYU): fix includes for highlight_group.h () 2023-12-01 09:38:04 +08:00
zeertzjq
09e93d7c4d
refactor(IWYU): create {ex_getln,rbuffer,os/fileio}_defs.h () 2023-12-01 08:06:37 +08:00
zeertzjq
a6f26c86cb
refactor(IWYU): fix includes for cmdhist.h () 2023-11-30 22:48:15 +08:00
zeertzjq
c8e37a589a
refactor(IWYU): move typedefs out of globals.h () 2023-11-30 19:52:23 +08:00
zeertzjq
ce56e0a845
refactor(IWYU): move UI and LineFlags to ui_defs.h () 2023-11-30 17:16:57 +08:00
zeertzjq
86cc791deb
refactor: move function macros out of vim_defs.h () 2023-11-29 23:10:21 +08:00
zeertzjq
a6cba103ce
refactor: move some constants out of vim_defs.h () 2023-11-29 20:32:40 +08:00
zeertzjq
64b53b71ba
refactor(IWYU): create normal_defs.h () 2023-11-29 12:10:42 +08:00
dundargoc
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
zeertzjq
71e954ad30
refactor(IWYU): fix includes for ugrid.h () 2023-11-28 17:01:27 +08:00
zeertzjq
1a8f60c7d2
refactor: move hashtab types to hashtab_defs.h () 2023-11-28 10:47:22 +08:00
zeertzjq
718053b7a9
refactor: fix runtime_defs.h () 2023-11-28 07:47:36 +08:00
dundargoc
e3f735ef10 refactor: fix includes for api/autocmd.h 2023-11-27 21:53:07 +01:00
dundargoc
f9231603c4 refactor: fix includes for iconv.h 2023-11-27 21:52:34 +01:00
dundargoc
ab7c0e9904 refactor: create runtime_defs.h 2023-11-27 21:35:21 +01:00
dundargoc
f4aedbae4c build(IWYU): fix includes for undo_defs.h 2023-11-27 19:33:17 +01:00
dundargoc
40139738eb build: enable IWYU on mac 2023-11-27 15:50:45 +01:00
zeertzjq
38a20dd89f
build(IWYU): replace most private mappings with pragmas () 2023-11-27 20:58:37 +08:00
zeertzjq
574d25642f
refactor: move Arena and ArenaMem to memory_defs.h () 2023-11-27 17:21:58 +08:00
zeertzjq
6343d41436
refactor: move autocmd types to autocmd_defs.h () 2023-11-27 11:17:04 +08:00
zeertzjq
7e2387f41b
build(clint): more precise check for "defs" headers () 2023-11-27 08:34:06 +08:00
dundargoc
71141e8cf5 build(IWYU): fix headers for arabic.h 2023-11-26 22:15:53 +01:00
zeertzjq
6361806aa2
refactor: move garray_T to garray_defs.h () 2023-11-26 22:58:52 +08:00
dundargoc
34509bbea3
build: sync IWYU and clint to ignore the same headers ()
Also fix headers for autocmd.c.
2023-11-26 22:34:29 +08:00
dundargoc
ce6075f82a build: add check to clint to prevent non-defs header includes
Also enable iwyu on headers, but add an ignore for each file separately.

Work on https://github.com/neovim/neovim/issues/6371.
2023-11-26 15:06:51 +01:00
dundargoc
a827003e30 build: rework IWYU mapping files
Create mapping to most of the C spec and some POSIX specific functions.
This is more robust than relying files shipped with IWYU.
2023-11-25 17:41:33 +01:00
dundargoc
5cefec7349 build: various cmake fixes
- silence false warnings on MSVC
- merge `clang-tidy` cmake target into `lintc` and remove the
  corresponding make target
- use cmake's built-in endianness detection
2023-11-04 18:32:47 +01:00
dundargoc
6c0f900699 ci: enable clang-analyzer warnings
This adds the checks in https://neovim.io/doc/reports/clang/ when using
clang-tidy. The strategy is to enable all clang-analyzer checks, and
disable only the checks for the warnings that exist currently. This
allows us to eliminate each warning type without blocking ongoing work,
but also without adding bugs for already eliminated warnings.

The plan is to eventually eliminate https://neovim.io/doc/reports/clang/
by completely integrating it into the clang-tidy check.

Also add make and cmake targets `clang-analyzer` to run this check.
2023-10-09 16:52:28 +02:00
zeertzjq
5bb17958c5
build: fix "make iwyu" not working () 2023-08-26 17:20:40 +08:00
Lewis Russell
2234b84a1b docs(generators): bake into cmake 2023-08-23 12:16:04 +01:00
Lewis Russell
48d533272e
feat(lua-types): types for vim.api.* () 2023-08-01 14:20:44 +01:00
Yuma Ueda
fd9ac5aa8e
build(makefile): remove a phony target uninstall ()
`uninstall` target was removed from makefile
2023-07-14 15:51:15 +02:00
dundargoc
ebb10d6248
build: remove functionaltest-lua target
It's not needed anymore as it does the exact same thing as
functionaltest. The functionaltest target will test the lua type neovim
was built with, which can be toggled with the PREFER_LUA option.
2023-05-24 21:14:47 +02:00
luukvbaal
39771b2238
build(Makefile): add nvim to oldtest phony target
This is to force a rebuild each time a file is changed.
2023-04-27 08:26:07 +02:00
dundargoc
339011f59c
build: remove uninstall target
The `make uninstall` target can't be expected to find all files it
installs in many cases. It is therefore better to remove it rather than give
the impression to users that it is a robust.
2023-04-08 23:07:09 +02:00
dundargoc
6801befcc5
build(uninstall): don't build if installation manifest not found
Due to the way neovim project is set up, running `make uninstall` would
previously build neovim in order to determine whether neovim was
installed. Instead, check if installation manifest file exists and if
not then skip building entirely.
2023-04-08 15:12:38 +02:00
dundargoc
829d92eca3
revert: "build: enable cmake workflow presets ()"
This reverts commit 00a976129b.

Visual Studio fails the build if the CMakePresets.json version is too
high and the CMakePresets.json integration is enabled.

Closes https://github.com/neovim/neovim/issues/22608.
2023-03-11 19:21:54 +01:00