aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-16coredata: Do not pickle it twiceXavier Claessens1-1/+1
Exclude coredata from build.dat because it gets pickled separately already.
2023-03-16Stop using replace_if_different() for coredata pickle fileDaan De Meyer1-4/+3
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-02-07mconf: Use auto_features value for auto optionsXavier Claessens1-0/+3
When project is configured with -Dauto_features=disabled, meson configure should not print "auto" value but "disabled" instead.
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-09-27mconf: Do not print None for empty choicesXavier Claessens1-12/+7
2022-09-27mconf: Use pager only when printing configurationXavier Claessens1-6/+7
Fixes: #10845
2022-09-22mconf: Add --no-pager optionXavier Claessens1-1/+4
2022-09-22mconf: Print options with colorsXavier Claessens1-16/+30
2022-09-22mconf: Substract the 3 space separators between columnsXavier Claessens1-1/+1
2022-09-22mconf: Do not wrap choices manuallyXavier Claessens1-19/+3
We already use textwrap.wrap() for that and it will correctly split on spaces.
2022-09-22mconf: There is always 4 columnsXavier Claessens1-21/+8
2022-09-22mlog: Add support for pagerXavier Claessens1-0/+4
It is useful to redirect some outputs, such as "meson configure" to a pager (e.h. less). This is similar to most git commands.
2022-09-22mconf: Use mlog.log() instead of print()Xavier Claessens1-13/+13
This will allow using colors and redirect print into a pager.
2022-07-31Only reconfigure if configure options actually changedDaan De Meyer1-1/+0
Currently, if we run "meson configure -Doption=value", meson will do a reconfigure when running "ninja build" afterwards, even if the new value is the same one that was already configured previously. To avoid this unnecessary reconfigure, let's use replace_if_different() instead of unconditionally replacing the conf file in coredata's save() function.
2022-06-24fix: handle the case where the last item of `four_column` results in being < ↵fxxf1-1/+2
1 (COLUMNS <= 60) by falling back to `_col`, relevant issue #10211
2022-06-10flake8: remove no longer used importsEli Schwartz1-1/+0
2022-04-13mconf: Fix printing <inherited from main project> for yielding optionsXavier Claessens1-13/+9
In print_options() k was a string instead of OptionKey, but self.yielding_options expects OptionKey. Not sure how this has not been catched by mypy. Fix by keeping k as OptionKey which makes self.yielding_options useless. Fixes: #9503
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-10-08Add support for module optionsXavier Claessens1-0/+10
2021-10-04remove f from f-string that has no formattingEli Schwartz1-1/+1
2021-06-11coredata: Invalidate deps cache when changing wrap_mode optionXavier Claessens1-2/+1
Fixes: #8858
2021-04-20mconf: line wrap columns nicelyDylan Baker1-6/+48
I've picked 160 characters as a default because anything less than that looks terrible and has awful wrapping going on. However, this respects the $COLUNNS environment variable if set, and otherwise will query the terminal to determine the size. This is all achieved through an application of shtuil.get_terminal_size, textwrap, print formatters, and iteration. Fixes #6965
2021-04-20mconf: cleanup up and sort importsDylan Baker1-2/+7
2021-04-20mconf: print core options for subprojectsDylan Baker1-2/+4
Looking in the right dictionary is pretty useful, actually.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-1/+1
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-02-17mconf: only print correct options in the correct sectionsDylan Baker1-2/+2
A predicate in two comprehensions was dropped, in what looks like a rebase error on my part. With the predicate added things work correctly. Fixes: #8344
2021-01-19Keep buildtype the same even if user changes debug and/or optimization.Jussi Pakkanen1-0/+11
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-14/+20
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-40/+20
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-04move OptionKey to mesonlibDylan Baker1-1/+2
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker1-7/+4
2021-01-04use OptionKey for backend_optionsDylan Baker1-2/+2
2021-01-04use OptionKey for coredata.user_optionsDylan Baker1-2/+15
2021-01-04movve insert_build_prefix to mconfDylan Baker1-2/+8
that's the only place it's used anyway.
2021-01-04use the OptionKey type for command line and machine filesDylan Baker1-1/+1
2020-10-16Refactor handling of machine file optionsXavier Claessens1-8/+2
It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
2020-09-08typing: more fixesDaniel Mensinger1-2/+6
2020-08-01mconf/mintro: use authoritative list of options from coredataDylan Baker1-13/+1
This splits the directory options and non-directory options into two dicts, and then merges them later to maintain API.
2020-06-18mconf: Fix regression when printing all optionsXavier Claessens1-8/+8
This is a regression introduced by #5489
2020-04-20Compiler options per langJohn Ericson1-6/+11
A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
2019-11-06Fix typos found by codespellWolfgang Stöggl1-1/+1
- Typos were found by codespell v1.16.0
2019-10-22mconf: Fix printing options when there is no compiler/project optionsXavier Claessens1-3/+3
Closes: #6087
2019-10-18mconf: Group all options per subproject and align all groupsXavier Claessens1-72/+115
Also hide value of yielding subproject options to make it clear the value must be set on the main project.
2019-09-13mconf: Fix meson configure crash (fixes #5909)Daniel Mensinger1-2/+2
2019-08-06Do not print build and host settings when compiling natively.Jussi Pakkanen1-8/+14
2019-06-05Per machine do 'build.' and '' option prefixesJohn Ericson1-5/+8
See the docs/ changes for details.
2019-05-20Use dependency cacheDylan Baker1-1/+2
2019-05-16mconf: Don't change the type of coredata.depsDylan Baker1-1/+1
Which is an OrderedDict, but mconf changes to a plain dict. This will work fine with Python 3.7+, but not with 3.5 and 3.6
2019-05-13ast: fix #5376Daniel Mensinger1-1/+2