aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-24Bump versions to 1.0.1 for release1.0.1Nirbheek Chauhan2-2/+2
2023-02-23Implement rustc controlled whole-archive linkingDylan Baker14-14/+113
Rustc as of version 1.61.0 has support for controlling when whole-archive linking takes place, previous to this it tried to make a good guess about what you wanted, which worked most of the time. This is now implemented. Additionally, rustc makes some assumptions about library names (specifically static names), that meson does not keep. This can be fixed with rustc 1.67, where a new +verbatim modifier has been added. We can then force rustc to use the name we give it. Before that, we can sneak through `/WHOELARCHIVE:` in cases of dynamic linking (into a dll or exe), but we can't force the archiver to do what we want (rustc considers the archiver to be an implementation detail). The only solution I can come up with is to copy the library to the format that rustc expects. I've run into some issues with that as well, so we warn in that case. The decisions to leave static into static broken on MSVC for 1.61–1.66 was made because: 1) The work around is non-trivial, and we would have to support that workaround for a long time 2) The number of users of Rust in Meson is small 3) The number of users of Rust in Meson on Windows, with MSVC is tiny 4) Using rustup to update rustc on windows is trivial, and solves the problem completely Fixes: #10723 Fixes: #11247 Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
2023-02-22python dependency: handle broken pylong on many more versions of pythonEli Schwartz1-1/+2
This workaround was never exclusive to python2, and in fact only just got fixed in the upcoming python 3.12 release. Extend the version comparison to cover all those other cases. (cherry picked from commit b4e792f520b2422a3980ea74fbc566c1b332a38d) [backported to apply pre-code move] # Conflicts: # mesonbuild/dependencies/python.py
2023-02-22python dependency: fix embed handling for system dependencyEli Schwartz1-10/+15
Only search for and provide linkage to libpython, if the dependency expects to be linked to it. Fixes overlinking on Linux / macOS when pkg-config isn't installed and the sysconfig lookup is used instead. This was correctly handled for pkg-config rather than deferring it until use, since commit bf832743441a1171518d7a436164c989be679410 -- but that handling neglected to cover sysconfig dependencies. And sysconfig would always try to link to libpython, it just respected the dependency configuration barely enough to allow falling back to "don't link" if both link_libpython=False and the library wasn't found. (cherry picked from commit d3148efe4f469412fbd1d7771b36e3082467979d) [backported to apply pre-code move] # Conflicts: # mesonbuild/dependencies/python.py
2023-02-22python dependency: verify that the python header is installed for sysconfigEli Schwartz1-0/+3
We may or may not care that the library can be found. If link_libpython is false, we allow it to be missing and still find the dependency. (cherry picked from commit e22dd4345cad8e28536c83921a83915d50b56c69) [backported to apply pre-code move] # Conflicts: # mesonbuild/dependencies/python.py
2023-02-23backend/ninja: fix rust cfg parsingKarol Herbst1-1/+1
2023-02-21handle more corner cases where locking the build directory failsEisuke Kawashima1-0/+3
This can raise any OSError, but we only caught two of them that indicate a particular failure case. Also catch the generic error form with a more generic message. This produces better error messages in cases where e.g. exclusive lock is not supported.
2023-02-21CI: skip gpgme-config test on ArchEli Schwartz1-1/+1
gpgme has decided that config-tool is bad, which makes sense. They've also decided that they will only install theirs, if gpg-error also installs one, which is a bit... confusing. Anyway, it's impossible to know whether it should or should not exist, so just accept that this test is ready to be skipped on distros that currently no longer have this ancient config-tool script. Victory is within reach!
2023-02-19vala: don't build .h, .vala, and .gir if export_dynamic is FalseDylan Baker1-1/+1
The current check results in *any* value to `export_dynamic` generating vala import targets, even `false`. This is pretty clearly wrong, as it really wants to treat an unset export_dynamic as false.
2023-02-19compilers: -fprofile-correction is only a valid switch with gcc itself.Luke Elliott1-1/+4
clang++ main.cpp -fprofile-correction clang-15: warning: optimization flag '-fprofile-correction' is not supported [-Wignored-optimization-argument]
2023-02-19respect the machine file binary overrides, even if it doesn't existEli Schwartz1-1/+3
If someone specifies a binary in a machine file, but the resulting prog.found() is false because it doesn't actually exist on disk, then the user was probably trying to disable finding that program. But find_program() currently doesn't distinguish between a machine file lookup returning a not-found program, and returning a dummy program because there's no entry at all. Explicitly check for a dummy program, rather than checking if the program was found, before deciding whether to discard the lookup results and continue trying other program lookup methods.
2023-02-19mconf: Use auto_features value for auto optionsXavier Claessens1-0/+3
When project is configured with -Dauto_features=disabled, meson configure should not print "auto" value but "disabled" instead.
2023-02-19asm: Use more backward-compatible invocation syntax for nasmSimon McVittie1-1/+1
Before version 2.14.01, -MD required an output filename argument, with `-MD outfile` equivalent to later versions' `-MD -MF outfile`. The older syntax is still supported, and is still listed as the preferred syntax in documentation. Reference: https://github.com/netwide-assembler/nasm/commit/3475462e Resolves: https://github.com/mesonbuild/meson/issues/11395 Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-19cmake: check that `re.search` returned a non-None valueDylan Baker1-6/+12
If an re call fails to find a match it returns None. We're not checking that, and crashing. Fixes: #11376
2023-02-19wrap: ensure the tempfile used for downloading is closedEli Schwartz1-1/+1
This is generally a good idea, and the tempfile is already instructed to not auto-delete on close. It also fixes a bug on PyPy, where the file isn't valid because it's not explicitly closed. This is probably due to the garbage collection modes -- in CPython, the object goes out of scope and gets automatically closed before we actually attempt to unpack it. Fixes #11246
2023-02-19add a CI runner testing that Meson runs correctly under PyPy3Eli Schwartz3-2/+17
Silence a couple of framework tests that need to be skipped since we don't install their dependencies for pypy3.
2023-02-19CI: log individual steps in run_testsEli Schwartz1-4/+8
2023-02-19tests: do not run the deprecated python3 tests unless python is python3Eli Schwartz1-2/+2
It's broken in e.g. pypy, but that's okay because the module is utterly deprecated, and people should use the python module instead.
2023-02-19cython: add unittest to verify that depfiles workEli Schwartz4-0/+29
2023-02-19cython: wire up support for emitting and using depfilesEli Schwartz2-2/+14
This solves rebuild issues when e.g. importing a .pxd header from a .pyx file, just like C/C++ source headers. The transpiler needs to run again in this case. This functionality is present in the 3.0.0 alphas of cython, and is also backported to 0.29.33. Fixes #9049
2023-02-19backends: handle cython ninja rules a bit more idiomaticallyEli Schwartz1-6/+7
We want to use as much default ninja behavior as we can, so reuse $out instead of repeating the output file as a string in $ARGS, and raise that into the build rule so it is only listed once.
2023-02-19Replace dashes in Java package names with underscores when generating native ↵Tristan Partin1-3/+6
headers This was causing a ninja issue where the native headers were always being generated because io.github.hse-project.hse_Hse.h was being expected, but io.github.hse_project.hse_Hse.h was actually generated.
2023-02-19compilers: Optimize the /Zc:__cplusplus codeDylan Baker1-10/+6
This could also be handled once, in the initializer
2023-02-19internaltests: Fix tests for /utf-8 removalDylan Baker1-5/+6
Now that we don't insert /utf-8 into the always args for MSVC < 19.00 we need to use a version > 19.00 for testing. This also means that /Zc:__cplusplus will be added to the always args.
2023-02-19compilers: Remove /utf-8 from Visual Studio command args onceDylan Baker1-3/+9
Instead of looking at it each time get_always_args() is called, do it once. Also avoid mutating global state.
2023-02-19compilers: Copy const always_args before returningDylan Baker1-1/+2
Eventually we would probably be better served (to avoid unnecessary copies) to use the ImmutableListProtocol here, but for the moment this is effective, it's also what we do in every other case.
2023-02-19mtest: fix annotaion of stdo_task and stde_taskDylan Baker1-2/+2
Which are `Task`s, not `Future`s, and they return `None`, not `str`. Spotted by newer versions of mypy
2023-02-19test cases/vala: Fix clang error during int to pointer coercionNirbheek Chauhan2-3/+3
``` clang [...] -c valaprog.p/GLib.Thread.c ../test cases/vala/5 target glib/GLib.Thread.vala:17:17: error: incompatible integer to pointer conversion passing 'gint' (aka 'int') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion] g_thread_exit (get_ret_code ()); ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:158:66: note: passing argument to parameter 'retval' here void g_thread_exit (gpointer retval); ^ 1 error generated. ```
2023-02-19Visual Studio: Drop /utf-8 if it is not supportedChun-wei Fan1-0/+10
We assume /utf-8 for all C builds unless /source-charset or /execution-charset is specified, but then this will cause trouble for Visual Studio 2013 or earler since the /utf-8 flag is only supported since Visual Studio 2015. Specifically, if we try to check whether compiler flags are supported, those checks will fail since /utf-8 is never supported on these older Visual Studio versions. Drop /utf-8 from get_always_args() if we are using Visual Studio 2013 or earlier.
2023-02-19set default install_tag of python.install_sources() to "python-runtime"Peter Urban1-1/+1
the default parameter for python.install_sources is set to "runtime" but should be "python-runtime" according to the existing documentation - https://mesonbuild.com/Python-module.html#install_sources - https://mesonbuild.com/Installing.html#installation-tags
2023-02-19pylint 2.16: join iterables without repeated appendEli Schwartz1-3/+1
We do += style joining in a loop, but we could just join with `''.join()` which is faster, neater, and simpler.
2023-02-19pylint 2.16: raise a more intentional exceptionEli Schwartz1-1/+1
Include a frivolous error message too. We never see it, but if someone reads the code and wonders why on *earth* there's a DSL function to raise a RuntimeError, the message string will clue them in.
2023-02-19pylint 2.16: remove pointless parens around equality assignmentsEli Schwartz3-3/+3
Given the construct `foo = (bar == baz)` some people like parentheses and some do not. They're pointless and don't mean anything, though. I don't feel this is particularly helpful to code clarity, tbh, and pylint now notices this and warns about it in our current pylint config. I think this is reasonable, so let's remove the odd parens.
2023-02-19remove unneeded type commentEli Schwartz1-1/+1
2023-02-19simplify instantiation of builtin type using builtins instead of functionsEli Schwartz6-17/+47
2023-02-19micro-optimize: define typing-only objects in TYPE_CHECKINGEli Schwartz8-51/+43
Union types that exist solely for use as annotations don't need to be created in normal runs.
2023-02-19treewide: add future annotations importEli Schwartz102-2/+118
2023-02-19pyupgrade: use set literalEli Schwartz1-1/+1
2023-02-19remove /utf-8 option when /validate-charset- is presentCharles Brunet2-1/+25
2023-02-19cuda: enable C++20 for CUDA 12David Seifert1-2/+15
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-compilers
2023-02-19log running commands a bit better by doing proper shell quotingEli Schwartz2-4/+4
2023-02-19runpython: make it work for -c as wellEli Schwartz2-4/+19
In commit 4e4f97edb3d475273108b203bc02b04bd6840b06 we added support for runpython to accept `-c 'code to execute'` in addition to just script files. However, doing so would mangle the sys.argv in the executed code -- which assumes, as python itself does, that argv is the stuff after the code to execute. We correctly handled this for script files, but the original addition of -c support pushed this handling into a script-file specific block.
2023-02-19mlog: do not squelch console output for errorsEli Schwartz1-1/+7
We have functionality to squelch logging, and we use this for situations where we run a fake interpreter and then emit output. e.g. `introspect`. It's reasonable to avoid logging your bog-standard noisy `mlog.log()` here, but unfortunately, we also avoided logging the output of `mlog.exception()` followed by `sys.exit(2)`, because that went through mlog! :P Special-case this to keep on printing, even if mlog.disable() was used -- in such a case, we really do want to emit log output no matter what. Users need this info to ensure they have any clue why Meson returned a non-zero exit code.
2023-02-19introspect: avoid crashing when add_languages for an optional language failsEli Schwartz1-6/+16
Because that is what the real interpreter does, too. It logs a failure and carries on.
2023-02-19gnome: Deduplicate include dirs to generate girThibault Saunier1-3/+3
Ensuring the order is respected
2023-02-19tests: avoid unexpected failure when cmake is not installedEli Schwartz1-1/+2
This test case checks stdout and demands a `dependency()` lookup fail. The resulting error message can be different depending on whether cmake is installed, or not. For cmake-specific tests we would simply skip the test if cmake is not installed, but here we can just fine-tune the pattern matching we use to determine if the test failed "correctly". Fixes #11320
2023-02-19mtest: do not warn when the TAP stream version is 12Eli Schwartz1-4/+1
Partial rollback of commit b7a5c384a1f1ba80c09904e7ef4f5160bdae3345. The rationale was based on a confusing wording of the TAP14 spec, which is under discussion for clarification / amendment. TAP14 doesn't (shouldn't) really say that missing a version line is potentially an error. Rather, this is the correct way to denote TAP12, which a TAP14 harness may not understand or try to parse. The intention was never to suggest that harnesses "should" take exception to the missing version line on the grounds that one should really add a version line. So, stop emitting an annoying warning for something that's valid usage. Meson understands TAP12 and that's okay. However, we do need to keep the part of that commit which set the version to 12 if it was otherwise unspecified. But instead of distinguishing between None and a version, just default to 12.
2023-02-19Revert "debug cygwin CI"Eli Schwartz1-1/+0
This reverts commit 79d7891746a7864a1407d48eac8a753b225ec6c3. This debug print probably should not have ended up live. Moreover, the function it debugs is, surprisingly, called rather often. Adding I/O to it causes it to begin to noticeably lag, on the scale of adding actual *minutes* to a setup run. Fixes #11322
2023-02-19Haiku pkgconfig directory layout supportX5121-0/+3
2023-02-19haiku: set default prefix and library pathsX5122-9/+66