aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
AgeCommit message (Collapse)AuthorFilesLines
2024-06-01mintro: write humman-readable JSONFilipe Laíns1-1/+1
Signed-off-by: Filipe Laíns <lains@riseup.net>
2024-05-23Refactor option classes to their own file.Jussi Pakkanen1-10/+10
2024-04-08parser: revert to single StringNode typeCharles Brunet1-2/+2
this will allow transforming string types in the formater
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker1-11/+1
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-11-01Add comments suggesting to keep shell completion scripts up-to-date near cmd ↵Luke Elliott1-0/+2
line argument code
2023-10-04Remove unused parameter in IntroCommand::get_meson_introspection_types()Tristan Partin1-3/+2
2023-09-11parser: use IdNode for function name and assignment nameCharles Brunet1-1/+1
2023-09-11parser: preserve escape chars in stringsCharles Brunet1-2/+2
use separate Node for multiline strings
2023-08-28include_directories: Always add both source and build dirsXavier Claessens1-1/+1
Compiler checks were not adding build dir side, which prevents using headers generated with configure_file().
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-13/+13
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-08-11rewrite a couple comment-style type annotations for oddly indented dictsEli Schwartz1-6/+10
Make them into real type annotations. These are the only ones that if automatically rewritten, would cause flake8 to error out with the message: "E128 continuation line under-indented for visual indent".
2023-07-24fix a few miscellaneous implicit-optional typing issuesEli Schwartz1-1/+1
2023-07-19move various bits of type-checking only code to TYPE_CHECKING blocksEli Schwartz1-1/+1
Mostly detected with flake8-type-checking. Also quote T.cast() first arguments, since those are not affected by future annotations.
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz1-1/+1
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-06-26mintro: record subproject in install_planDaniele Nicolodi1-0/+2
2023-05-22intro: add more details to generated files(part 2)Charles Brunet1-1/+5
- add `extra_paths` to intro-tests.json to know paths needed to run a test on Windows; - add `depends` to alias targets in intro-targets.json to know what targets does an alias point to; - add `depends` to intro-dependencies.json to know libraries linked with an internal dependency; - renamed `deps` to `dependencies` in `intro-dependencies.json` for more uniformity.
2023-04-20intro: add more details to generated json filesCharles Brunet1-10/+84
This will help with the writing of tools to generate VisualStudio project and solution files, and possibly for other IDEs as well. - Used compilers a about `host`, `build` and `target` machines arere listed in `intro-compilers.json` - Informations lister in `intro-machines.json` - `intro-dependencies.json` now includes internal dependencies, and relations between dependencies. - `intro-targets.json` now includes dependencies, `vs_module_defs`, `win_subsystem`, and linker parameters.
2023-03-28Add support for meson.options as a replacement for meson_options.txtDylan Baker1-4/+4
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-02mintro: redirect stdout to stderrCharles Brunet1-8/+9
2023-02-27mintro: Add exclude_{files, dirs} to install_subdir install_planDaniele Nicolodi1-2/+10
These are necessary for projects outside Meson itself that want to extend the 'meson install' functionality as meson-python does to assemble Python package wheels from Meson projects. Fixes #11426.
2022-09-22pylint: enable global-statementDylan Baker1-3/+1
This does force a number of uses of `# pylint: disable` comments, but it also finds a couple of useless global uses and one place (in the previous commit) that an easy refactor removes the use of global. Global is a code smell, so forcing adding a comment to disable helps force developers to really consider if what they're doing is a good idea.
2022-09-19pylint: enable consider-using-inDylan Baker1-1/+1
2022-09-19pylint: enable consider-using-dict-itemsDylan Baker1-4/+4
Which found a couple of places where we could write better code.
2022-09-06Fix install_subdirs not showing up in intro-install_plan.jsonThomas Li1-1/+3
2022-08-22introspection: untangle install_plan implemetation, fix a bunch of wrong onesEli Schwartz1-2/+0
Generally plumb through the values of get_option() passed to install_dir, and use this to establish the install plan name. Fixes several odd cases, such as: - {datadir} being prepended to "share" or "include" - dissociating custom install directories and writing them out as {prefix}/share/foo or {prefix}/lib/python3.10/site-packages This is the second half of #9478 Fixes #10601
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz1-3/+8
2022-07-03sort imports for neatnessEli Schwartz1-9/+7
2022-06-01ast: rename module constant to match PEP8 styleDylan Baker1-2/+2
2022-03-22OptionOverrideProxy: Make it immutable to avoid copiesXavier Claessens1-3/+3
It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-07Merge pull request #10043 from dcbaker/submit/type-checking-for-subprojectJussi Pakkanen1-1/+1
Add typing for subproject()
2022-03-07Fix default install tag for shared lib symlinksXavier Claessens1-6/+14
Versioned shared libraries should have .so file in devel, .so.1 and .so.1.2.3 in runtime. Fixes: #9811
2022-03-03interpreter: replace build_def_files with OrderedSetDylan Baker1-1/+1
We do a bunch of backbending to make sure we don't have duplicates, let's just use the right datastructure to begin with.
2021-10-14introspect: include choices for array optionsPaolo Bonzini1-0/+2
There was even a test covering this, but it did not fail due to a typo.
2021-10-04remove printf debuggingEli Schwartz1-1/+0
Why did this dumb thing of mine ever get committed???
2021-10-04use list unpacking to simplify for loop referencesEli Schwartz1-4/+5
2021-09-06mintro: add installed_planFilipe Laíns1-0/+31
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-3/+3
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-2/+2
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-1/+1
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-04mintro: include the correct target filenames for flat layoutPaolo Bonzini1-2/+10
Fixes: #8408
2021-03-04mintro: fix flake8 issuesPaolo Bonzini1-1/+1
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens1-8/+8
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-01-04mintro: fix mypy warningDylan Baker1-4/+4
The output of list_targets is a pretty horrific jumble of things. We really need a TypeDict to make this not so terrible we can't deal with it, so for now just use Any.
2021-01-04fix LGTM warningsDylan Baker1-1/+1
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-19/+23
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-26/+12
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04use OptionKey for compiler_optionsDylan Baker1-3/+4
2021-01-04use OptionKey for backend_optionsDylan Baker1-3/+2
2021-01-04use OptionKey for coredata.user_optionsDylan Baker1-1/+1
2020-12-14mintro: export functions to load the meson-info filesPaolo Bonzini1-17/+30
With the next patch, "meson test" will be using the targets introspection information. Provide helper functions to share bits of code between mintro.py and mtest.py.