aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2023-04-11Add c++23 to the list of C++ standards.cpp23Jussi Pakkanen1-4/+4
2023-04-10Bump version number for new development.Jussi Pakkanen1-1/+1
2023-04-10Bump version number for release.1.1.0Jussi Pakkanen1-1/+1
2023-04-04propagate the most accurate node to error messagesEli Schwartz1-3/+6
During evaluation of codeblocks, we start off with an iteration of nodes, and then while evaluating them we may update the global self.current_node context. When catching and formatting errors, we didn't take into account that the node might be updated from the original top-level iteration. Switch to formatting errors using self.current_node instead, to ensure we can point at the likely most-accurate actual cause of an error. Also update the current node in a few more places, so that function calls always see the function call as the current node, even if the most recently parsed node was an argument to the function call. Fixes #11643
2023-04-03get_llvm_tool_names: add released llvm versionsChristoph Reiter1-0/+2
2023-04-02Bump version number for rc2.1.1.0rc2Jussi Pakkanen1-1/+1
2023-03-30fix regression that broken git-based wraps with dirty contentsEli Schwartz1-1/+2
In commit 8da060706c2c34fbea91898509123cb190894f3e we fixed an issue where stashing would ignore untracked files, potentially conflicting with what we reset to. Unfortunately in the process it broke the functionality entirely, by producing an invalid git command... according to some versions of git. This is actually a git bug, fixed upstream in git 2.37.0 via commit b02fdbc80a41f73ceb6c99e8e27b22285243a335. It causes git itself to re-synthesize the command line for a negation pathspec with a "." rather than "", as that's what is needed to make it match all files other than the negation. For backwards compatibility to older versions of git, we manually pass the dot pathspec ourselves.
2023-03-30backend/vs: ensure that build dir is preferred to src dirBarnabĆ”s Pőcze1-1/+2
Previously, the VS backend would add the the include directories in the reverse order that the Ninja backend does it, which means that the source directories would be preferred over the build directories. For example, this would cause the compiler to choose the file from the source directory if a file with the same name is found in both. Fixes 57ec097b5 ("vs: Use CompilerArgs() for compile and link args") Fixes #11630
2023-03-30msetup: Allow (re)configure of not empty builddirXavier Claessens1-1/+4
Also prevent from using a parent directory as builddir by mistake. Co-authored-by: Volker Weißmann <volker.weissmann@gmx.de> Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
2023-03-30msetup: use more consistent exceptions on exitXavier Claessens1-8/+13
- MesonException for errors is clearer than SystemExit('error message') and provides meson-formatted "ERROR: ..." - `raise SystemExit` with no parameter isn't obvious that it intends to exit successfully While clarifying the latter, it was observed to cause test_preprocessor_checks_CPPFLAGS() failure to be ignored. That test checks get_define() on both c and cpp compilers, which means we need to define either CPPFLAGS or both CFLAGS+CXXFLAGS.
2023-03-30coredata: Fix changing prefix optionXavier Claessens1-2/+2
This is a regression from #11537.
2023-03-29Make --vsenv a readonly builtin optionXavier Claessens12-19/+24
We need to remember its value when reconfiguring, but the Build object is not reused, only coredata is. This also makes CLI more consistent by allowing `-Dvsenv=true` syntax. Fixes: #11309
2023-03-28python dependency: avoid redefinition warnings for MS_WIN64Eli Schwartz1-1/+1
pyconfig.h defines it in limited cases, but as empty, rather than as "1" which is what command-line defines generally do. Explicitly define it as a compatible definition so the compiler does not log a warning that the value has changed. Fixes #11592
2023-03-28Bump version number for rc1.1.1.0rc1Jussi Pakkanen1-2/+2
2023-03-28backends: fix bug where meson_exe crashed if constructed with found programsEli Schwartz1-1/+1
Because we base the pickled data name on the name property of the command being run... and for built targets, `exe.name` is always just the name. However, for an ExternalProgram this is just whatever string we searched for, so, NOT just the basename. This became a bigger issue once we started using generator() with the actual program in commit 6aeec808367f05463394e30a8d40834e97c7afc0, rather than first casting it to a string, because the VS backend *always* uses the meson_exe approach for various reasons related to VS being VS. Outside of that, it's difficult to actually get an ExternalProgram object passed to meson_exe -- CustomTarget lowers it to a string, capture is handled via argparse instead of pickling, etc. Fixes #11593
2023-03-28do not resolve symlinks when calculating the meson commandEli Schwartz1-1/+1
We embed the route to executing meson in various cases, most especially regen rules in build.ninja. And we take care to ensure that it's a canonicalized path. Although the code has moved around over time, and adapted in ways both bad and good, the root of the matter really comes down to commit 69ca8f5b544f700210d9f18613311bcce3c2e37a which notes the importance of being able to run meson from any location, potentially not on PATH or anything else. For this reason, we switched from embedding sys.argv[0] to os.path.realpath, a very heavy stick indeed. It turns out that that's not actually a good thing though... simply resolving the absolute path is enough to ensure we can accurately call meson the same way we originally did, and it avoids cases where the original way to call meson is via a stable symlink, and we resolved a hidden location. Homebrew does this, because the version of a package is embedded into the install directory. Even the bugfix release. e.g. ``` /opt/homebrew/bin/meson ``` is symlinked to ``` /opt/homebrew/Cellar/meson/1.0.0/bin/meson ``` Since we went beyond absolutizing the path and onwards to canonicalizing symlinks, we ended up writing the latter to build.ninja, and got a "command not found" when meson was upgraded to 1.0.1. This was supposed to work flawlessly, because build directories are compatible across bugfix releases. We also get a "command not found" when upgrading to new feature releases, e.g. 0.64.x to 1.0.0, which is a terrible error message. Meson explicitly "doesn't support" doing this, we throw a MesonVersionMismatchException or in some cases warn you and then effectively act like --wipe was given. But the user is supposed to be informed exactly what the problem is, rather than getting "command not found". Since there was never a rationale to get the realpath anyways, downgrade this to abspath. Fixes #11520
2023-03-28Add support for meson.options as a replacement for meson_options.txtDylan Baker4-13/+32
We will still try to load `meson_options.txt` if `meson.options` doesn't exist. Because there are some advantages to using `meson.options` even with older versions of meson (such as better text editor handling) we will not warn about the existence of a `meson.options` file if a `meson_options.txt` file or symlink also exists. The name `meson.options` was picked instead of alternative proposals, such as `meson_options.build` for a couple of reasons: 1. meson.options is shorter 2. While the syntax is the same, only the `option()` function may be called in meson.options, while, it may not be called in meson.build 3. While the two files share a syntax and elementary types (strings, arrays, etc), they have different purposes: `meson.build` declares build targets, `meson.options` declares options. This is similar to the difference between C's `.c` and `.h` extensions. As an implementation detail `Interpreter.option_file` has been removed, as it is used exactly once, in the `project()` call to read the options, and we can just calculate it there and not store it. Fixes: #11176
2023-03-28Import cpu detection fix from Debian.Jussi Pakkanen1-0/+1
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033579
2023-03-27Allow --reconfigure and --wipe of empty builddirXavier Claessens1-13/+13
This allows to run setup command regardless whether the builddir has been configured or not previously. This is useful for example with scripts that always repeat all options. meson setup builddir --reconfigure -Dfoo=bar
2023-03-28Make backend option read-onlyXavier Claessens2-10/+20
2023-03-27find dll path on WindowsCharles Brunet1-10/+34
When running tests on Windows (or for devenv), paths of shared libraries need to be added to the PATH envvar for Windows to be able to find them. Meson is currently using the path of the import lib, which is wrong in many cases. This fix does two things: if there is a variable bindir in the pkg-config file, those variable values are added to the list of path. This is for conan dependencies, if conan decides to export those paths. See https://github.com/conan-io/conan/issues/13532 . The fallback is to replace `lib` by `bin` in the import library path. This heuristic will work most of the time (but the bin directory could have a different name, or the dll itself could have a different name). In all cases, it cannot be worse than current implementation, and it solves many cases.
2023-03-27custom_target: libfoo.so.1 is linkableXavier Claessens1-4/+10
2023-03-27Write wrap-redirect filename as posix pathDenis Fortin1-4/+4
2023-03-24Add a system method for obtaining GL dependency on Linux OSHelen Ginn1-1/+9
2023-03-23asm: Add sx extensionRenan Lavarec6-1/+7
docs: gcc https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html scons: https://scons.org/doc/3.0.5/HTML/scons-user/apb.html .S Windows: assembly language file ARM: CodeSourcery Sourcery Lite .sx assembly language file + C pre-processor POSIX: assembly language file + C pre-processor
2023-03-21Fix run_tool() when git is not installedAlyssa Ross1-3/+3
Previously, it would raise an exception.
2023-03-20fix one more missing explicit "setup" subcommandEli Schwartz1-0/+1
2023-03-20backends: add a new "none" backendEli Schwartz6-9/+51
It can only be used for projects that don't have any rules at all, i.e. they are purely using Meson to: - configure files - run (script?) tests - install files that exist by the end of the setup stage This can be useful e.g. for Meson itself, a pure python project.
2023-03-20mtest: move the detection of rebuild compatibility out into the entry pointEli Schwartz1-6/+6
What we are mainly doing here is checking that the options make sense, or fixing that up if they don't. And in the next commit we will want to do that by also checking the build object.
2023-03-20backends: simplify class setupEli Schwartz9-9/+25
2023-03-20Add restat = 1 to the fortran_COMPILER ruleVolker Weißmann1-1/+4
gfortran does not update the modification time of *.mod files. Fixes #11552
2023-03-19CUDA: make "Ampere" equivalent to SM8.0+SM8.6David Seifert1-1/+8
2023-03-18Small fix on how cc.sizeof (and similar functions) use the 'prefix' kwargVolker Weißmann1-14/+14
2023-03-17Better error message when custom_targets has duplicates in the output kwargVolker Weißmann1-0/+7
2023-03-17Fix "meson subprojects checkout -b" regressionXavier Claessens1-2/+3
The argument position is wrong since https://github.com/mesonbuild/meson/commit/1c631ec8abd34df9971ab03faf22d709f1c54348
2023-03-17fix meson compile with alias targetCharles Brunet1-3/+4
this fixes a bug introduced by #11528
2023-03-16coredata: Do not pickle it twiceXavier Claessens3-6/+16
Exclude coredata from build.dat because it gets pickled separately already.
2023-03-16Stop using replace_if_different() for coredata pickle fileDaan De Meyer2-21/+37
This was added in f774609 to only change the access time of the coredata file if the coredata struct actually changed. However, this doesn't work as pickle serializations aren't guaranteed to be stable. Instead, let's manually check if options have changed values and skip the save if they haven't changed. We also extend the associated unit test to cover all the option types and to ensure that configure does get executed if one of the options changes value.
2023-03-16modules/i18n: fix typo in gettext decoratorCorentin Noƫl1-1/+1
2023-03-16hotdoc: Install devhelp files at the right locationXavier Claessens2-6/+19
When devhelp is enabled, hotdoc generates a devhelp/ subdir that needs to be installed to /usr/share/devhelp/. Otherwise, the html/ subdir needs to be installed to /usr/share/doc/<project>/html/
2023-03-16prevent lib prefix warning from pkg-configCharles Brunet7-14/+15
2023-03-14add typename to AliasTargetCharles Brunet1-0/+3
It will allow to distinguish AliasTarget from RunTarget in introspection files (e.g. meson-info/intro-targets.json).
2023-03-14rewriter: fix indentation of kwargsCharles Brunet1-0/+2
2023-03-14rewriter: add missing command aliasesCharles Brunet1-3/+3
2023-03-14rewriter: activate vsenvCharles Brunet1-1/+2
2023-03-14rewriter: fix warning about empty sourcesCharles Brunet2-2/+4
2023-03-12Fix warning_level=everything with GCC 8David Robillard1-1/+3
This option was introduced with GCC 8.1.0 as in the original commit, but the value wasn't right initially and was volatile during the 8 series. To avoid this, this commit moves the warning to 9.1.0 (the next version we generally care about), since we don't want to get too deep into the weeds of point releases, and a warning not being used yet in some particular version of GCC isn't a big deal.
2023-03-09detect.py: Be more precise about detecting xtensa gcc toolchainsKhem Raj1-1/+1
clang --version can yield a string like below when its installed into such a directory clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) Target: aarch64-yoe-linux Thread model: posix InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux as you can see InstallDir has 'xt-' subtring and this trips the check to guess gcc if 'Free Software Foundation' in out or 'xt-' in out: Therefore, check if compiler output starts with xt- then assume it to be gcc Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-09configure_file: emit FeatureNew when a cmake-formatted file has too many tokensEli Schwartz2-8/+13
In commit 97a72a1c53e68cf53541285075b4000f7c85ccc6 we started to allow cmakedefine with 3 tokens, as cmake expects (unlike mesondefine). This would silently start working even if the declared minimum version was older than 0.54.1
2023-03-09emit FeatureNew warning for compiler.preprocess used multiple timesEli Schwartz1-0/+3
In commit c2a55bfe43fae1b44cf49a083297d6755c89e1cc multiple bugs were fixed, but a FeatureNew was only added for the one that was mentioned in the commit message. Make sure to warn users about the reliability of the one that wasn't mentioned, too.