Age | Commit message (Collapse) | Author | Files | Lines |
|
Those classes are used by wrapper scripts and we should not have to
import the rest of mesonlib, build.py, and all their dependencies for
that.
This renames mesonlib/ directory to utils/ and add a mesonlib.py module
that imports everything from utils/ to not have to change `import
mesonlib` everywhere. It allows to import utils.core without importing
the rest of mesonlib.
|
|
Type annotation, documentation string, and implementation were doing 3
different things. Change implementation to match type annotation which
makes the most sense because it match what get_target_sources() does.
All callers only use keys from the returned dictionary any way, but
that's going to change in next commits.
|
|
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.
|
|
The `global` statement is only needed to assign to global variables, not
read or mutate them. So calling `global.mutate()` is fine, but not
`var = foo`, which would otherwise shadow `var`.
|
|
matches a predicate
|
|
Because clang now defaults to a dwarf version that valgrind does not yet
support. There's support in valgrind git master, though.
|
|
Environment line may not contain '=' and thus fail to decompose into a
key/value pair.
|
|
|
|
- Remove duplicated code in mdevenv.py
- Change the limit to 1024 instead of 2048 which is what has been
tested.
- Skip shortening if it is already short enough.
- Skip shortening with wine >= 6.4 which does not seems to have that
limitation any more.
- Downgrade exception to warning in the case WINEPATH cannot be
shortened under 1024 chars, it is possible that it will still work.
|
|
When need to catch exceptions just like we do in coredata.load() to
print proper error message instead of backtrace when user mix meson
versions.
This happens frequently when user has a newer version of meson installed
in their HOME and then "sudo meson install" uses the system version of
meson.
|
|
|
|
Any iterable is acceptable, not just Set | OrderedSet
|
|
By default, meson will try to look for shared libraries first before
static ones. In the meson.build itself, one can use the static keyword
to control if a static library will be tried first but there's no simple
way for an end user performing a build to switch back and forth at will.
Let's cover this usecase by adding an option that allows a user to
specify if they want dependency lookups to try static or shared
libraries first. The writer of the meson.build can manually specify the
static keyword where appropriate which will override the value of this
option.
|
|
|
|
|
|
|
|
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.
|
|
Structured Sources
|
|
Using future annotations, type annotations become strings at runtime and
don't impact performance. This is not possible to do with T.cast though,
because it is a function argument instead of an annotation.
Quote the type argument everywhere in order to have the same effect as
future annotations. This also allows linters to better detect in some
cases that a given import is typing-only.
|
|
This is useful when creating an exception with a node option, with less
typing.
|
|
Now that we have strong type checking in the interpreter, we can tighten
the type checking in the mesonlib side by using the same Literals.
|
|
There's no reason it needs a concrete list, any iterable is fine. This
does mean that we need to explicitly check for `str | bytes` in the
listify pass, as `str` and `bytes` are both iterable.
|
|
|
|
It may be None. This was encountered with radare's build system on
Windows, where symbolextractor.py crashes without any output displayed.
|
|
|
|
Do not require users to convert it to a string first. This is a waste of
time and effort for exactly the same results.
|
|
The tests and the unittests both unconditionally call setup_vsenv()
because all tests are run using the backend commands directly: ninja,
msbuild, etc.
There's no way to undo this vs env setup, so the only way to test that
--vsenv works is by:
1. Removing all paths in PATH that provide ninja
2. Changing setup_vsenv(force=True) to forcibly set-up a new vsenv
when MESON_FORCE_VSENV_FOR_UNITTEST is set
3. Mock-patching build_command, test_command, install_command to use
`meson` instead of `ninja`
4. Asserting that 'Activating VS' is in the output for all commands
5. Ensure that compilation works because ninja is picked up from the
vs env.
I manually checked that this test actually does fail when the previous
commit is reverted.
|
|
Visual Studio Express does not come with the
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' workload.
This adds a check for the 'Microsoft.VisualStudio.Workload.WDExpress'
workload. Non-express versions take precedence over express versions
when activating.
|
|
|
|
It should accept whatever str.endswith accepts, which means optionally a
tuple of options.
|
|
Removed errant "type: ignore".
Fixed issue with "fetch" call. This issue was the following:
Dict::get() and Dict::pop() have the following signature:
T.Callable[[_T, _U], _U | None] OR T.Callable[[_T], _U | None]
Note how the return type is _U here. When the fetch() function was
actually being called, it had the following signature:
T.Callable[[_T, T.List[_U]], T.Union[T.List[_U], _U]]
This is incompatible with the previous definitions. The solution is
simply to move where the default value is introduced if fetch() produces
None.
|
|
Since we scan all dependencies for build-only RPATHs now (which are
removed on install), we must take care not to add build-only RPATHs
pointing to directories that dependencies explicitly add -Wl,-rpath
link args for, otherwise the paths will get wiped on install.
Caught by LinuxlikeTests::test_usage_pkgconfig_prefixes
|
|
|
|
We really don't want to be mutating global state, so let mypy yell at us
when we try.
|
|
|
|
Which is missing several values
|
|
When installing with 'meson install --quiet' I'd get the following output:
This file does not have an rpath.
This file does not have a runpath.
(It turns out that of the couple hundred of binaries that are installed,
this message was generated for /usr/lib/systemd/boot/efi/linuxx64.elf.stub.)
There doesn't seem to be any good reason for this output by default. But those
functions can still be used for debugging. Under a debugger, returning the
string is just as useful as printing it, but more flexible. So let's suppress
printing of anything by default, but keep the extractor functions.
The code was somewhat inconsistent wrt. to when .decode() was done. But it
seems that we'll get can expect a decodable text string in all cases, so
just call .decode() everywhere, because it's nicer to print decoded strings.
|
|
|
|
setup_vsenv() was not propagating the return value, so build.need_vsenv
was always False.
|
|
We could have an OptionOverrideProxy of an OptionOverrideProxy,
recursively. This fix is a minimal subset of the refactoring I did in
https://github.com/mesonbuild/meson/pull/9394. Instead of faking
UserOption we can just do a shallow copy of one and set a new value on
it.
Fixes: #9448
|
|
|
|
|
|
For Windows on Arm win-arm64 platform, the corresponding vcvars
is called now.
|
|
NamedTemporaryFile can't be opened by name on Windows.
For Windows the created temporary bat file is now closed before
passing to a subprocess, prevented from removal automatically upon
close and deleted explicitly upon finish.
|
|
The `except` line was missing its `as e` clause.
As a result, when erroring out, after not finding a compiler, Meson
gives an error ending:
```
File "C:\Users\Matthew\AppData\Roaming\Python\Python39\site-packages\mesonbuild\mesonlib\vsenv.py",
line 100, in setup_vsenv
mlog.warning('Failed to activate VS environment:', str(e))
```
|
|
|
|
|
|
|
|
|
|
|