aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
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.
2021-09-01Clang should error for all implicit function checks (#9165)Dylan Baker2-3/+8
* compilers: improve docstring to `get_compiler_check_args()` There was an incomplete list, which wasn't useful as it now takes an enum anyway. Also add a new entry to the list of reasons to use this function. * clang: Add -Werror=implicit-function-declarations to check_args Unlike GCC, clang warns but doesn't error when an implicit function declaration happens. This means in checks like `compiler.has_header_symbol('string.h', 'strlcat')` (on Linux, at least) that GCC will fail, as there is no such function; clang will emit a warning, but since it exists with a 0 status Meson interprets that as success. To fix this, add `-Werror=implicit-function-declarations` to clang's check arguments. There seems to be something specific about functions that _may_ exist in a header on a given system, as `cc.has_header_symbol('string.h', 'foobar')` will return false with clang, but `strlcat` will return true, even though it's not defined. It is however, defined in some OSes, like Solaris and the BSDs. Fixes #9140
2021-09-01interpreter: Introduce BooleanHolder for the bool primitiveDaniel Mensinger8-68/+129
2021-09-01interpreter: Simplify Disabler logicDaniel Mensinger2-16/+8
2021-09-01interpreter: Remove the AND and OR operator enumsDaniel Mensinger1-2/+0
These operators don't make sens to use in ObjectHolders, since this mechanism wouldn't allow for lazy evaluation.
2021-09-01interpreter: Remove permissive from _unholderDaniel Mensinger4-13/+11
2021-09-01msvc: Assume UTF8 source by defaultXavier Claessens1-2/+11
Currently every project that uses UTF8 for its source files must add '/utf-8' argument otherwise they don't work non-English locale MSVC. Since meson.build itself is assumed to be UTF8 by default, seems better to assume it for source files by default too. For example: - https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62 - https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
2021-08-31i18n module: restore the <packagename>-gmo targetEli Schwartz1-0/+3
Removed in commit 487d45c1e5bfff0fbdb4747841db6a0b5b124af9 but perhaps it should not have -- people may have been depending on ensuring those are built somehow. Even though the internal implementation changed and it is now built by the all target, let's keep the old target around too. Now it just aliases the actual build rules, though.
2021-08-31i18n module: provide targets as return value for gettext()Eli Schwartz1-1/+3
Users may wish to make use of these files for their own purposes. For example, the -pot and -update-po pseudo targets could be reused in an alias_target(), and at least one person wanted to reuse the built .mo files as custom_target input. Fixes #6227
2021-08-31interpreter: use python dunders instead of lock for unpicklabilityDylan Baker2-9/+4
This simplifies things for us, as we don't have to have threading imported for no other reason, and we can remove the `an_unpicklable_object` from the Interpreter and mesonlib, since there was only one user of this.
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger10-64/+183
2021-08-31interpreter: Introduce operators support for InterpreterObjectsDaniel Mensinger5-5/+202
2021-08-31interpreter: Make comparisons of different types a hard errorDaniel Mensinger1-4/+8
2021-08-31pyllint: enable consider-user-enumerateDylan Baker3-10/+4
This caught a couple of cases of us doing: ```python for i in range(len(x)): v = x[i] ``` which are places to use enumerate instead. It also caught a couple of cases of: ```python assert len(x) == len(y) for i in range(len(x)): xv = x[i] yv = y[i] ``` Which should instead be using zip() ```python for xv, yv in zip(x, y): ... ```
2021-08-31pylint: turn on superflous-parensDylan Baker31-102/+102
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-31pylint: turn on superfluous parens warningDylan Baker2-8/+8
Which is really useful for catching parens used with keywords like assert. Don't use parens with assert, it's bad.
2021-08-31pylint: enable consider-iterating-dictionaryDylan Baker2-2/+2
This didn't actually catch what it's supposed to, which is cases of: ```python for x in dict.keys(): y = dict[x] ``` But it did catch one unnecessary use of keys(), and one case where we were doing something in an inefficient way. I've rewritten: ```python if name.value in [x.value for x in self.kwargs.keys() if isinstance(x, IdNode)]: ``` as ``python if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs): ``` Which avoids doing two iterations, one to build the list, and a second to do a search for name.value in said list, which does a single short circuiting walk, as any returns as soon as one check returns True.
2021-08-31pylint: enable unnecessary-not checkDylan Baker1-1/+1
This finds things like ```python if not x == 1: ``` which should be ```python if x != 1: ```
2021-08-31Merge pull request #9185 from dcbaker/submit/env-object-as-holderJussi Pakkanen6-90/+125
Make EnvironmentVariablesObject a holder
2021-08-31Merge pull request #9193 from dcbaker/submit/aarch64-beJussi Pakkanen1-7/+15
Handle aarch64_be as a cpu family
2021-08-31python module: fix error message mentioning setuptoolsEli Schwartz1-1/+1
We use distutils, not setuptools, for probing information.
2021-08-30interpreter: rename EnvironmentVariablesObject -> EnvironmentVariablesHolderDylan Baker2-4/+4
This is more consistent with other Holder classes
2021-08-30interpreterobjects: Use typed_kwargs for EnvironmentVariablesObjectDylan Baker1-24/+19
2021-08-30make EnvironmentVariablesObject a proper holderDylan Baker4-63/+42
Currently, EnvironmentVariablesObject is a strange holder-that's-not-a-holder. This has implicaitons for things that expect to get an EnvironmentVariables object, as we can't automatically unholder it, and instead have to to manually do so. Now we can automatically unholder it, which makes everything much nicer.
2021-08-30Allow EnvironmentVariablesObject to be passed an EnvironmentVariables instanceDylan Baker1-1/+3
2021-08-30interperter/kwargs: narrow type checkingDylan Baker1-1/+1
Since the convertor has been added env, we are now only going to be an EnvironmentVariables object, nothing else.
2021-08-30interpreter/type_checking: Add convertor to env keyword argumentDylan Baker1-3/+16
This does the conversion to an EnvironmentVariables, so that the receiver always gets a EnvironmentVariables object and not a list, dict, or string
2021-08-30interpreter/type_checking: add a validator to envDylan Baker1-2/+34
Let's start moving the validation out of the interpreter object
2021-08-30interpreter: move 'env' to type_checkingDylan Baker2-1/+8
2021-08-30build: add ability to set initial value of EnvironmentVariablesDylan Baker1-1/+5
Which is useful as we move the validation out of the the EnvironmentVariablesObject
2021-08-30build: Fully annotate EnvironmentVariablesDylan Baker1-6/+9
2021-08-30wraptool: Fix version comparisonXavier Claessens1-4/+4
2021-08-30decorators: Make unknown kwarg fatalXavier Claessens1-10/+6
2021-08-30Add missing "disabler" kwarg to python.dependency()Xavier Claessens1-0/+1
There is a unit test using it and now fails because the warning about unknown kwarg became fatal.
2021-08-30Simplify get_callee_argsXavier Claessens4-87/+34
2021-08-30Simplify condition in can_run_host_binaries()Xavier Claessens1-7/+6
2021-08-30environment: correctly handle cpu value aarch64_beDylan Baker1-1/+7
Fixes #9191
2021-08-30environment: add ppc -> ppc64 for aix to detect_cpuDylan Baker1-0/+4
This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
2021-08-30environment: Add a few type annotationsDylan Baker1-6/+4
These are just annotations in code that I'm working for this series
2021-08-29mcompile: treat load-average as a floatMike Gilbert1-1/+1
`ninja -l` accepts a double. We should do the same. Bug: https://bugs.gentoo.org/810655
2021-08-29gnome: Prepend devenv, not appendTing-Wei Lan1-4/+4
Otherwise, if these environment variables already exist, they will override values we set for the developer environment.
2021-08-28Merge pull request #9183 from dcbaker/submit/validate-defaultDylan Baker8-27/+43
Validate default values for KwargInfo