aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-09-21coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens1-1/+5
Remove test_minor_version_does_not_reconfigure_wipe() because when run during dev cycle that test reconfigure with .99 -> .100 which is considered a major version change now. It is covered by a more efficient internal test now anyway. While at it, remove no-op `with Path(self.builddir):` statement, the intention was clearly to set workdir. Fixes: #9260
2021-09-20mtest: Allow gtest protocol test to fail more gracefullyDylan Baker1-1/+8
Currently, if the test fails to produce XML (or valid XML) then the test fails with a backtrace. It's actually pretty easy to get into this situation, a total failure of the test will result in no XML being written (this can happen, for example, if rpaths to gtest are not correctly set up). If we can't read the test, go ahead and complete using `TestRunExitCode.complete()`, which will fail for the bad exit code.
2021-09-20dependency: If cached version is outdated, look on system againXavier Claessens1-0/+4
Fixes: #9271
2021-09-20ninjabackend/vs: handle builddir on different drive from cwdRyan Kuester1-1/+7
When setup creates a Visual Studio environment, a message is logged which contains a path to the build directory. Typically, this path is converted to a relative path prior to printing. If the path cannot be converted to a relative path (e.g., because buildpath is on a different drive from the cwd), print out the full path instead of failing with an unhandled exception.
2021-09-20during executable lookup, do not search PATH if a directory component is givenEli Schwartz1-0/+3
This will always be wrong, because when a directory component is provided we need to match an exact filename on a manual search path, for example find_program with dirs: or the current meson.build subdir. If we ever get this far, shutil.which will do the same "is there a dirname, if so just check whether the filename exists relative to cwd"... except that the documented meson lookup path is that we check relative to meson.build subdir, not relative to the cwd, and the cwd could be anything, but is probably the root sourcedir. Since internally, meson does not actually os.chdir into the sourcedir, it could be absolutely anything at all, though. ... The actual returned name for shutil.which(name) given a literal pathname with a directory component is "return name" without adding the absolute path, which means that this is double-broken. Not only does it find things we didn't expect, the resulting ExternalProgram object doesn't have the correct path to the program, so it will report "found" and then fail to actually run when the current directory is changed, for example by ninja -C. Fixes #9262
2021-09-20dependencyfallbacks: Use default_options for implicit fallbacksXavier Claessens2-14/+10
This removes the warning when using default_options without fallback kwarg completely because a subproject does not know if the main project has an implicit fallback or not, so it could set default_options even if not fallback is available at all. Fixes: #9278
2021-09-20backends/vs: Set ObjectFileName for generated sources.Andres Freund1-0/+3
When a static library B to a static library A with generated sources, B directly references the object file corresponding to the generated source in A. For that reference in B object_filename_from_source() is used. But A did not specify the object file name, ending up with cl.exe's default. Fixes: #9235
2021-09-20compilers: Use standards compliant testRohit Goswami1-1/+1
2021-09-20backend/ninja: add generated sources to depscan order depsDylan Baker1-2/+6
Since we changed to using a json file to avoid over long command lines we created a situation where the generated files may not be ready when the depscan happens. To avoid that, we need to add all of the generated sources as order deps. Fixes: #9258
2021-09-19msubprojects: when revision is an available commit, do not fetch updatesEli Schwartz1-1/+7
It's not even worth bothering to contact the network because it can never be anything other than what we have already.
2021-09-19msubprojects: if fetching the remote fails, gracefully fallback to local copyEli Schwartz1-3/+8
This command is useful to e.g. update a cloned subproject which does not have its packagefiles merged, or which has updated packagefiles. This does not strictly require internet, so if we can satisfy the ref, simply log a warning and continue. This enables a workflow where for network-isolated builds, the subproject is cloned and moved into place and later on the build orchestrator runs `meson subprojects update` without a network interface to initialize the subproject.
2021-09-19indent code in preparation for refactoringEli Schwartz1-15/+16
Because figuring out what changed on a single line in the middle of a reindent is pain.
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens1-1/+1
Fixes: #9263
2021-09-16C2000: Added depfile generation for incremental buildsmiebka1-0/+3
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz10-18/+13
2021-09-14mark a couple of typing-only imports as noqa, to appease pyflakesEli Schwartz2-2/+6
Since it cannot resolve `import typing as T` in order to figure out that T.* is doing annotation-worthy stuff. Since T.cast('Foo') is not actually using Foo except in an annotation context (due to being a string) it requires extra work to resolve, and the only thing that would currently work is actually using 'typing.cast'. However, we have decided to not use it except as T... Since this import is only imported during mypy it's not so bad to noqa it.
2021-09-14compilers: publicly export one more constantEli Schwartz1-0/+1
It is imported from a subpackage in __init__ alongside a big list of other things which are all exported. And elsewhere, this import is re-imported by other code. It's pretty clearly an oversight that it didn't get added to __all__
2021-09-14fix untested codepath? add:item() is surely a typo, not a real functionEli Schwartz1-1/+1
2021-09-14fix traceback while trying to print error messageEli Schwartz1-1/+1
2021-09-14fix traceback for undefined exception when trying to raise exceptionEli Schwartz1-1/+1
2021-09-14unused variable -- open() does not need "as f"Eli Schwartz1-1/+1
2021-09-14semicolons are not needed in pythonEli Schwartz1-1/+1
2021-09-14backends/vs: Do not emit dummy command for alias_command().Andres Freund1-11/+19
Alias commands did not work with the vs backend, due to trying to access target.command[0] with an empty command. Fix this by just not emitting a CustomBuild node for alias targets - the project references are enough to trigger the necessary actions. Fixes: #9247
2021-09-12new custom dependency lookup for iconvEli Schwartz2-2/+31
Also internally needed by intl, so add that as a proxied dependency instead of coding it manually.
2021-09-12deprecate layout=flat and warn people never to use itEli Schwartz1-0/+7
It's broken in various circumstances, no one seems to actually use it, CI doesn't test it, no one is committed to maintaining it, etc. etc. etc. Also, projects doing trivially reasonable things, such as generating "foo/util.py" and "bar/util.py", create clashing output names. This will never, ever, ever, ever work with layout=flat. Closes #996 Closes #1521 Closes #1908 Closes #7133 Closes #7135 Closes #7480 Closes #8378
2021-09-12msetup: make xcode unsupported warning actually showEli Schwartz1-2/+5
Until we invoke interpreter.Interpreter(b, ...) the coredata options still have their default values and thus cannot be used sensibly. Currently the warning never shows (other than, unsurprising in retrospect, during --internal regenerate).
2021-09-10qt module: consolidate on one list of binsEli Schwartz1-25/+25
2021-09-10qt module: fix regression in building translations via qresourceEli Schwartz1-1/+1
In commit 3c4c7d042932c23a8ea24d85f24cd290d0a5ea13 the qresource variable stopped being overwritten with a mesonlib.File, which is reasonable. However, one call site for it which relied on being a built file did not get renamed when needed. Make the build target use the built file.
2021-09-10qt module: correctly register a found tool and stop looking for itEli Schwartz1-3/+1
Regression in commit d7ac2f10655433989e5e17867b6c8ef428fd39e8 since self.{tool_name} is not how it used to be tracked, and the "found" dictionary is a legacy of the old location.
2021-09-10nagfor OpenMP recognition.Mat Cross1-0/+6
2021-09-10nagfor preprocessor flag.Mat Cross1-0/+3
2021-09-10Comments on nagfor options setup.Mat Cross2-1/+9
2021-09-10Implemented some missing operation for the NAG Fortran Compiler.Mat Cross4-5/+59
2021-09-10objc/objcpp compiler: accept all gnu stds corresponding to c/c++ stdsEli Schwartz2-2/+2
The clang compiler now reimplements and re-checks the c_std and cpp_std options in order to use them for objc as well, but it didn't consistently support the same options. First it completely excluded all the gnu ones, and then it added a handful of them but not for C++. Be fully consistent -- or at least as consistent as we can be, given a minimally working fix. (The C/C++ compiler mixin actually gates different stds depending on detected clang version, we do not do that here.) Fixes regression in c54dd63547b030e3d9feee694ec6f49c434f0df8 Fixes incomplete fix from #8766 (which didn't fix objcpp at all) Fixes #9237
2021-09-07summary: fix dependenciesPaolo Bonzini3-3/+6
Dependencies are currently printed as [<mesonbuild.mlog.AnsiDecorator object at 0x7faa85aeac70>, ' ', <mesonbuild.mlog.AnsiDecorator object at 0x7faa85aeab50>] This was introduced in commit adb1b2f3f6ad54b346348ec6e5b8d96f2f7ba0a6, due to an incorrect type annotation on the AnsiText constructor. Fix both the annotation and the usage. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-07interpreter: detect and pass compiler to be used for linker testsPaolo Bonzini4-0/+23
Allow using the links method to test that the C++ driver (e.g. g++) can be used to link C objects. One usecase is that the C compiler's libsanitizer might not be compatible with the one included by the C++ driver. This is theoretically backwards-incompatible, but it should be treated as a bugfix in my opinion. There is no way in Meson to compile a .c file with the C++ driver as part of a build target, therefore there would be no reason to do something like meson.get_compiler(meson.get_compiler('cpp').links(files('main.c')). Fixes: #7703
2021-09-07compilers: allow link tests to use objects from a different compilerPaolo Bonzini1-2/+12
In some cases, link tests would like to use objects provided by a compiler for a different language, for example linking a C object file with a C++ compiler. This kind of scenario is what link_language is for, but it is impossible to test that it works with a linker test. This patch implements the required support in the Compiler class. The source code compiler is passed to the Compiler.links method as an argument.
2021-09-07compilers: do accept None in Compiler.compile extra_argsPaolo Bonzini1-1/+2
The type information allows it, but it is not actually handled.
2021-09-07compilers: fix flake8 issuesPaolo Bonzini1-7/+6
2021-09-06mintro: add installed_planFilipe Laíns8-59/+131
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-04Support for appleframeworks with GCC and IntelEvan Miller1-3/+1
Fixes #8792 Fixes #8733
2021-09-03mdist: use git archive with git repositories for correctnessEli Schwartz1-29/+35
Fixes various inconsistencies: - gitattributes is respected - export-subst - export-ignore - submodules with relative paths are not checked out relative to the local clone (which does not work anyway) - no need to manually remove gitfiles with inaccurate heuristics Fixes #2287 Fixes #3081 Fixes #8144
2021-09-03Improve WSL detectionWill1-1/+1
WSL 2 removes the "Microsoft" from `platform.version` but leaves it inside `platform.release`. This lets us detect both types of WSL without issue.
2021-09-03log a more informative error when wrap-git subprojects cannot be downloadedEli Schwartz1-1/+1
"ERROR: Git program not found" is both highly true, and somewhat inscrutable. Sure, looking at the line number you can basically figure out that subproject('something') must somehow need git to operate, but that may not be immediately obvious. Make mention of the fact that it is needed to "download foo.wrap". Fixes #7764
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens3-24/+23
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
2021-09-02OptionKey: Fix orderingXavier Claessens1-10/+8
When sorting options we want the same order as they are presented in "meson configure" command.
2021-09-01make the display name of a gettext translation build, look prettierEli Schwartz1-1/+1
And more accurate too, TBH. Currently it says it is building "lang.mo", even though it is actually building "domain.mo" inside lang/LC_MESSAGES/. Since meson loudly complains if I try to name the display name "lang/domain.mo", name it with a dash instead of a slash. The actual name isn't a priority here IMO, and this is nicely readable.
2021-09-01fix repr for alias_targetEli Schwartz1-0/+4
It has no command, so you cannot try printing it or it explodes with IndexError: list index out of range
2021-09-01run_target: do not yield broken names with subdirsEli Schwartz1-1/+4
A run_target object created in a subdir/meson.build always has a ninja rule name of "name", not "subdir/name". Fixes #9175
2021-09-01dependency: fallback and allow_fallback are mutually exclusiveXavier Claessens1-0/+2
That used to abort in previous Meson versions but 0.59 stopped forbidding that by mistake.