aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24rustc: implement pic argsDylan Baker2-0/+10
2021-09-24compilers/rust: Implement warning levelsDylan Baker2-0/+15
Currently this implements 3 warning levels, 1 and 2 are just the "default" set by rustc, 3, is "everything is a warning", and 0 is "nothign is a warning".
2021-09-24rust: Add werror argumentsDylan Baker2-0/+9
2021-09-24compilers/detect: avoid mutating rustc compiler listDylan Baker1-0/+2
Because mutation is bad.
2021-09-24pylintrc: add function-redefinedDylan Baker1-0/+1
2021-09-25compilers: Add default search path stdlib_only_link_flagsDylan Baker5-18/+62
This should be done in all cases of language_stdlib_only_link_flags, but I don't have access to all of the compilers to test it. This is required in cases where object files created by gfortran are linked using another compiler with a differen default search path, such as gfortran and clang together.
2021-09-24Merge pull request #9167 from dcbaker/submit/meson-main-type-checkingJussi Pakkanen16-154/+208
Add type annotations and type checking to meson main
2021-09-24Add option to to transpile Cython to C++Dylan Baker8-7/+123
This patch adds a new meson built-in option for cython, allowing it to target C++ instead of C as the intermediate language. This can, of course, be done on a per-target basis using the `override_options` keyword argument, or for the entire project in the project function. There are some things in this patch that are less than ideal. One of them is that we have to add compilers in the build layer, but there isn't a better place to do it because of per target override_options. There's also some design differences between Meson and setuptools, in that Meson only allows options on a per-target rather than a per-file granularity. Fixes #9015
2021-09-24interpreter/mesonmain: remove unreachable codeDylan Baker1-5/+2
Now that we have type checking, we can be sure that this code is unreachable, and remove it.
2021-09-24pylint: check for duplicate importsDylan Baker7-8/+7
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-09-24interpreter/mesonmain: Fix remaining typing problems and add to run_mypyDylan Baker2-25/+37
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker7-15/+32
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
2021-09-24interpreter/mesonmain: Add full set of typed_argument guardsDylan Baker1-99/+122
2021-09-24interpreter/mesonmain: fix type annotationsDylan Baker1-3/+3
Taht should have been converted to build/program module objects, not interpterter objects
2021-09-24interpreter: Add a few missing type annotationsDylan Baker1-3/+6
Just enough to make interpreter/mesonmain happy
2021-09-24scripts/meson_exe: narrow type annotationDylan Baker1-1/+1
Not just a `dict`, but a `dict[str, str]`
2021-09-24scripts/meson_exe: close fd if we open itDylan Baker1-0/+3
2021-09-24build: Add annotation to dist_Scripts and install_scriptsDylan Baker1-2/+2
2021-09-24build: add some missing type annotationsDylan Baker1-3/+3
So that we can get interpreter/mesonmain.py type safe.
2021-09-24mlog: fix annotationDylan Baker1-1/+1
2021-09-22Merge pull request #9274 from anarazel/fix-vs-static-generatedJussi Pakkanen7-0/+57
backends/vs: Set ObjectFileName for generated sources.
2021-09-21Use -Oz when optimization=s in ClangAndrea Pappacoda2-2/+2
-Oz is the appropriate flag to use when you want to produce the smallest possible binary, and is one would expect when setting optimization to s or using the minsize build type.
2021-09-21coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens3-27/+23
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-21Add platform agnostic testsXavier Claessens5-1/+44
This adds a new category of tests that does not need to run on all platforms during CI. For now only run them on Linux runners because they are not the bottleneck.
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-20Add test for https://github.com/mesonbuild/meson/issues/9235Jesse Natalie6-0/+54
2021-09-20editorconfig settings: attempt to guarantee the final end-of-line charEli Schwartz1-0/+1
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 Claessens5-15/+14
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-20tests: Fix fortran testsRohit Goswami18-8/+24
2021-09-20compilers: Use standards compliant testRohit Goswami1-1/+1
2021-09-20backend/ninja: add generated sources to depscan order depsDylan Baker3-5/+21
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-20tests/fortran/7 generated: don't try to find a configure_file by pathDylan Baker1-4/+2
Use the value returned by configure file instead. The issue that caused this to be required is no longer present.
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 Claessens4-1/+8
Fixes: #9263
2021-09-16C2000: Added depfile generation for incremental buildsmiebka1-0/+3
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz11-18/+15
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 Freund2-14/+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