aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
AgeCommit message (Collapse)AuthorFilesLines
2023-12-20Bump versions to 1.3.1 for stable release1.3.1Nirbheek Chauhan1-1/+1
2023-11-19Bump version number for release.Jussi Pakkanen1-1/+1
2023-11-14Bump version number for rc3.1.3.0rc3Jussi Pakkanen1-1/+1
2023-11-06Increment version number for rc2.1.3.0rc2Jussi Pakkanen1-1/+1
2023-11-01Add comments suggesting to keep shell completion scripts up-to-date near cmd ↵Luke Elliott1-0/+1
line argument code
2023-10-27Bump version number for RC1.1.3.0rc1Jussi Pakkanen1-1/+1
2023-09-11parser: preserve escape chars in stringsCharles Brunet1-1/+1
use separate Node for multiline strings
2023-09-07Rename OptionOverrideProxy to OptionsView and move to coredataXavier Claessens1-4/+42
Coredata is where all option handling is done so it makes sense there. It is a view on a list of options for a given subproject and with optional overrides. This change prepare for using that view in a more generic way in the future.
2023-08-30Merge pull request #10332 from xclaesse/std-optJussi Pakkanen1-13/+63
c_std, cpp_std: Change to a list of desired versions in preference order
2023-08-24Suggest using --reconfigure only when not already using itXavier Claessens1-5/+5
2023-08-23machine file: Add @GLOBAL_SOURCE_ROOT@ and @DIRNAME@Xavier Claessens1-7/+12
2023-08-18Suggest fix in MesonVersionMismatchExceptionM Henning1-1/+2
Every time I update meson, I spend about 20 minutes on frustrated googling to figure out how to update my build directory to work with the new version. I'm forgetful, okay? Ease this pain point by suggesting a potential fix in the error message.
2023-08-14Python: Add 'limited_api' kwarg to extension_moduleAndrew McNulty1-0/+2
This commit adds a new keyword arg to extension_module() that enables a user to target the Python Limited API, declaring the version of the limited API that they wish to target. Two new unittests have been added to test this functionality.
2023-08-07machine file: Fix crash on empty valueXavier Claessens1-2/+4
Fixes: #12025
2023-08-07c_std, cpp_std: Change to a list of desired versions in preference orderXavier Claessens1-0/+53
Projects that prefer GNU C but can fallback to ISO C can now set for example `default_options: 'c_std=gnu11,c11'` and it will use gnu11 when available, fallback to c11 otherwise. It is an error only if none of the values are supported by the current compiler. This allows to deprecate gnuXX values from MSVC compiler, that means that `default_options: 'c_std=gnu11'` will now print warning with MSVC but still fallback to 'c11' value. No warning is printed if at least one of the values is valid, i.e. `default_options: 'c_std=gnu11,c11'`. In the future that deprecation warning will become an hard error because `c_std=gnu11` should mean GNU is required, for projects that cannot be built with MSVC for example.
2023-08-06UserArrayOption: Make listify_value() a static methodXavier Claessens1-2/+6
2023-08-06UserArrayOption: Remove user_input argumentXavier Claessens1-12/+5
The only place it can be set to False is from optinterpreter. Better check value there and deprecate string usage.
2023-07-31fix lint errors revealed by pycodestyle 2.11Eli Schwartz1-1/+1
When performing isinstance checks, an identity comparison is automatically done, but we don't use isinstance here because we need strict identity equality *without allowing subtypes*. Comparing type() == type() is a value comparison, but could produce effectively the same results as an identity comparison, usually, despite being semantically off. pycodestyle learned to detect this and warn you to do strict identity comparison.
2023-07-17Merge pull request #11976 from tristan957/cleanupsJussi Pakkanen1-24/+25
Some various type related cleanups
2023-07-17Bump version number for new development.Jussi Pakkanen1-1/+1
2023-07-17Bump version number for release.1.2.0Jussi Pakkanen1-1/+1
2023-07-12Add typing to portions of machine file parsingTristan Partin1-7/+8
2023-07-12Add type annotations where they previously didn't existTristan Partin1-2/+2
2023-07-12Use more specific typesTristan Partin1-2/+2
Added type arguments where needed.
2023-07-12Match the method signatures of parent classesTristan Partin1-3/+3
Names and types of some methods did not match their parent methods.
2023-07-12Annotate naked fundamental Python typesTristan Partin1-3/+3
Although mypy wasn't complaining, pyright was.
2023-07-12Replace some type comments with annotationsTristan Partin1-5/+5
2023-07-12Use CompileCheckMode enumTristan Partin1-2/+2
There were a ton of naked strings with TODOs telling us to use the enum.
2023-07-11Bump version number for rc3.1.2.0rc3Jussi Pakkanen1-1/+1
2023-07-05Bump version number for rc2.1.2.0rc2Jussi Pakkanen1-1/+1
2023-07-02genvslite: fix badly overflowing line lengthsEli Schwartz1-1/+3
Function comments that overflow the screen width by coming after code, instead of on their own line, are hard to read. Same applies to message strings that are all on one line. Fix by reflowing them. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-07-02genvslite: improve readability of the mconf help textEli Schwartz1-3/+2
The option description has a lot of data packed into it, which is squeezed into a small, hard to read column. Give a bit less information, focusing on essentials, to make it fit better. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-06-28Bump version number for rc1.1.2.0rc1Jussi Pakkanen1-2/+2
2023-06-28Experimental 'genvslite' WIP. (#11049)GertyP1-1/+16
* Capture all compile args from the first round of ninja backend generation for all languages used in building the targets so that these args, defines, and include paths can be applied to the .vcxproj's intellisense fields for all buildtypes/configurations. Solution generation is now set up for mutiple build configurations (buildtypes) when using '--genvslite'. All generated vcxprojs invoke the same high-level meson compile to build all targets; there's no selective target building (could add this later). Related to this, we skip pointlessly generating vcxprojs for targets that aren't buildable (BuildTarget-derived), which aren't of interest to the user anyway. When using --genvslite, no longer inject '<ProjectReference ...>' dependencies on which a generated .vcxproj depends because that imposes a forced visual studio build dependency, which we don't want, since we're essentially bypassing VS's build in favour of running 'meson compile ...'. When populating the vcxproj's shared intellisense defines, include paths, and compiler options fields, we choose the most frequent src file language, since this means more project src files can simply reference the project shared fields and fewer files of non-primary language types need to populate their full set of intellisense fields. This makes for smaller .vcxproj files. Paths for generated source/header/etc files, left alone, would be added to solution projects relative to the '..._vs' build directory, where they're never generated; they're generated under the respective '..._[debug/opt/release]' ninja build directories that correspond to the solution build configuration. Although VS doesn't allow conditional src/header listings in vcxprojs (at least not in a simple way that I'm aware of), we can ensure these generated sources get adjusted to at least reference locations under one of the concrete build directories (I've chosen '..._debug') under which they will be generated. Testing with --genvslite has revealed that, in some cases, the presence of 'c:\windows\system32;c:\windows' on the 'Path' environment variable (via the make-style project's ExecutablePath element) is critical to getting the 'meson compile ...' build to succeed. Not sure whether this is some 'find and guess' implicit defaults behaviour within meson or within the MSVC compiler that some projects may rely on. Feels weird but not sure of a better solution than forcibly adding these to the Path environment variable (the Executable Path property of the project). Added a new windows-only test to windowstests.py ('test_genvslite') to exercise the --genvslite option along with checking that the 'msbuild' command invokes the 'meson compile ...' of the build-type-appropriate-suffixed temporary build dir and checks expected program output. Check and report error if user specifies a non-ninja backend with a 'genvslite' setup, since that conflicts with the stated behaviour of genvslite. Also added this test case to 'WindowsTests.test_genvslite' I had problems tracking down some problematic environment variable behaviour, which appears to need a work-around. See further notes on VSINSTALLDIR, in windowstests.py, test_genvslite. 'meson setup --help' clearly states that positional arguments are ... [builddir] [sourcedir]. However, BasePlatformTests.init(...) was passing these in the order [sourcedir] [builddir]. This was producing failures, saying, "ERROR: Neither directory contains a build file meson.build." but when using the correct ordering, setup now succeeds. Changed regen, run_tests, and run_install utility projects to be simpler makefile projects instead, with commands to invoke the appropriate '...meson.py --internal regencheck ...' (or install/test) on the '[builddir]_[buildtype]' as appropriate for the curent VS configuration. Also, since the 'regen.vcxproj' utility didn't work correctly with '--genvslite' setup build dirs, and getting it to fully work would require more non-trivial intrusion into new parts of meson (i.e. '--internal regencheck', '--internal regenerate', and perhaps also 'setup --reconfigure'), for now, the REGEN project is replaced with a simpler, lighter-weight RECONFIGURE utility proj, which is unlinked from any solution build dependencies and which simply runs 'meson setup --reconfigure [builddir]_[buildtype] [srcdir]' on each of the ninja-backend build dirs for each buildtype. Yes, although this will enable the building/compiling to be correctly configured, it can leave the solution/vcxprojs stale and out-of-date, it's simple for the user to 'meson setup --genvslite ...' to fully regenerate an updated, correct solution again. However, I've noted this down as a 'fixme' to consider implementing the full regen behaviour for the genvslite case. * Review feedback changes - - Avoid use of 'captured_compile_args_per_buildtype_and_target' as an 'out' param. - Factored a little msetup.py, 'run(...)' macro/looping setup steps, for genvslite, out into a 'run_genvslite_setup' func. * Review feedback: Fixed missing spaces between multi-line strings. * 'backend_name' assignment gets immediately overwritten in 'genvslite' case so moved it into else/non-genvslite block. * Had to bump up 'test cases/unit/113 genvslites/...' up to 114; it collided with a newly added test dir again. * Changed validation of 'capture' and 'captured_compile_args_...' to use MesonBugException instead of MesonException. * Changed some function param and closing brace indentation.
2023-06-26tree-wide: reduce unneeded imports on specific Dependency implsEli Schwartz1-3/+2
We can check something's subtype using properties, without importing the module up front and doing isinstance checks on specific subclasses of the interface -- or worse, solving cyclic imports by doing the import inside the function. ;)
2023-06-25fully type mconf.pyEli Schwartz1-2/+2
2023-06-23coredata: Also clear compiler and run cachesXavier Claessens1-1/+3
2023-06-23coredata: Malformed machine file is not a Meson bugXavier Claessens1-1/+4
Fixes: #11899
2023-06-13coredata: Fix wrong stable_version valueXavier Claessens1-1/+1
2023-06-13Allow targetting Meson 1.2.0 when version is 1.1.99Xavier Claessens1-0/+10
When a project targets a dev version of Meson (e.g. 1.1.99) for experimenting, this allows to use: project(..., meson_version: '>=1.2.0') It avoids getting warnings when using FeatureNew for features introduced in 1.2.0.
2023-05-29avoid clearing the dependency cache unnecessarily based on wrap-modeEli Schwartz1-6/+0
We actually do not and should not care about wrap-mode at all for this. We want to cache dependency lookups whenever humanly possible, but only use them in cases where we would anyways be using them -- which in particular means if we said to force a subproject fallback for this dep, we want to bypass the cache. Currently, we handle this by always looking up the cache for all dependencies, but clearing the cache at startup if a reconfigure means we are changing our resolution strategy. This is bad -- we might have many dependencies that are worth caching, and only one dependency that should stop being cached and use a subproject instead. The simple solution is to handle the forcefallback case when doing a cache lookup, and not do a cache lookup at all. Now we don't have to nuke the entire cache. In fact, if a future reconfigure changes the forcefallback state back to not being forced, we can reuse the original cached dependency, which is still there. Closes #11828
2023-05-24Remove pointless install_umask validation check for NoneEli Schwartz1-1/+1
This option can never have a value of None. There are only two sources of values at all: - the class instance initializer when defining BUILTIN_CORE_OPTIONS - user-provided command-line or machine file values etc. which can only be meson types We know we don't construct the Option instance with None, and users cannot pass a None anywhere since that's not a meson type. The only reason this was ever checked for was as an artifact during the initial implementation of the option in commit 8651d55c6a317de37dcaa9965157151095a88292. At the time, a review comment was made that `-Dinstall_umask=none` was a bad UX and "preserve" should be used instead. Before that, this option type accepted `None` (in the BUILTIN_CORE_OPTIONS initializer) and `'none'` (provided by users) which is odd and should have consistently been the latter. Then inside set_value, it checked for the magic initializer value and converted it to the real value. After review comments and a force-push, the patch ended up using `None` in the initializer, and `'preserve'` everywhere else, and still handling both in set_value and converting both to a proper string. In the very next commit in the patch series, the initializer was migrated to use an actual umask of 022, and now `None` was entirely impossible to get anywhere at all. But the wart of checking for it was never removed. Remove it at long last.
2023-05-13During reconfigure, show that no compiler was found, if compiler fails ↵Volker Weißmann1-1/+0
sanity check.
2023-05-02python module: add an automatic byte-compilation stepEli Schwartz1-0/+2
For all source `*.py` files installed via either py.install_sources() or an `install_dir: py.get_install_dir()`, produce `*.pyc` files at install time. Controllable via a module option.
2023-04-11fix various spelling issuesJosh Soref1-7/+7
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
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-02Bump version number for rc2.1.1.0rc2Jussi Pakkanen1-1/+1
2023-03-30coredata: Fix changing prefix optionXavier Claessens1-2/+2
This is a regression from #11537.
2023-03-29Make --vsenv a readonly builtin optionXavier Claessens1-0/+1
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