Age | Commit message (Collapse) | Author | Files | Lines |
|
Make the AstInterpreter create a directed acyclic graph (called
`dataflow_dag`) that stores the how the data flowes from one node in
the AST to another.
Add `AstInterpreter.node_to_runtime_value` which uses `dataflow_dag`
to find what value a variable at runtime will have.
We don't use dataflow_dag or node_to_runtime_value anywhere yet, but
it will prove useful in future commits.
|
|
The order in which the rewriter outputs the listed sources is more or
less arbitrary anyways, so we ignore it to prevent the tests from
breaking after small irrelevant changes.
|
|
Restore the behavior from before commit d37d649b0 ("Make all Meson level
options overridable per subproject.", 2025-02-13). The old code was:
options: T.MutableMapping[OptionKey, T.Any] = OrderedDict()
# process project default options
for k, v in default_options.items():
if not subproject or k.subproject == subproject:
options[k] = v
# override them with machine default and command line options
options.update(env.options)
env.options = options
Fixes: #14608
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
configure"
Follow the same logic that is used at the end of the first invocation.
This fixes
meson setup --reconfigure -Db_ndebug=true
on a project that has no language that defines b_ndebug.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The check for unknown options is duplicated in OptionStore and MesonApp. Place the
better version of the two as a new method of OptionStore, and use it in
OptionStore.validate_cmd_line_options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
On Windows, os.execv spawn the process in background and returns 0.
Therefore, it prevents devenv to return proper exit code from the
called process. (see https://github.com/python/cpython/issues/63323
for reference.)
The solution is to call subprocess.run instead, on Windows, at the
price of keeping the meson python process alive while the devenv
subprocess runs.
|
|
Since opt.deprecated is a dictionary with string keys, the lookup must use
str() around the user-provided value; with some care because booleans
will be the meson-ic 'true' and 'false' instead of Python's 'True' and
'False'.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The unit tests for the `meson test --slice=` option check that the
option is working by extracting all tests that have been run from the
command output. This is done with a rather loose regular expression
"test-[0-9]*", which can easily match other parts of the output, as
well.
One user for example reported that the test broke because they were
executing tests in a directory called "meson-test-1.8.0-build", and
given that the "test-1" part of that directory matches the regular
expression we have too many matches.
Fix the issue by tightening the regex so that is way less likely to
match anything from the host's build environment.
Reported-by: Dominique Leuenberger <dleuenberger@suse.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
Path.is_dir() can raise a PermissionError if a parent does not have
the executable permission set; plus the "in p.parents" tests are
very expensive. Do not use Path at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Because system options apply to all subprojects, they need to be
present globally whenever a subproject needs them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
validate_original_args only checks whether an option is prefixed with the name of a
built-in option that was also set. It does not check whether the prefix is the full
name of the option specified with -D. Adding an "=" at the end fixes the test.
Fixes: #14487
Reported-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
This was only being used by the introspection interpreter, which meant
the two interpreters had different behavior. They still do, which is
really bad because the IntrospectionInterpreter doesn't have the command
line options or project_default_options. I have a plan to fix that
later, and I don't want to spend time on it here, as it's not a
regression of this patch, it's just the status quo.
This also fixes an issue caused by dead code being left, and hit, due to
the option refactor branch.
Fixes: #14382
|
|
"prefix" has a lot of special handling that has to go on because so many
other options depend on prefix. It was also regressed by the option
refactor changes, so having a test feels appropriate.
This was verified against the 1.7 release, so it has the same behavior
as pre-option refactor Meson.
|
|
Machine files provide a `Mapping[OptionKey, ElementaryOptionValues]`,
but the expectation listed was that they provided options in the raw DSL
format.
|
|
Otherwise they won't be able to find their module outputs.
This requires a new method to look at dependencies, as the existing ones
wont find static libraries that were linked statically into previous
targets (this links with A which link_whole's B). We still need to have
B in that case because we need it's BMI outputs.
|
|
Because we don't set the appropriate dependencies
|
|
|
|
|
|
Another rust tool, another rough copy of the code to run clippy.
Apart from the slightly different command lines, the output is in a
directory and test targets are skipped.
Knowing the output directory can be useful, so print that on successful
execution of rustdoc.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Put cygwin filemode tests back under the sourcedir
Remove inheritable permissions from the sourcedir
For :reasons:, the unit tests which check file mode were built in the
tempdir.
Instead, remove inheritable permissions from the working directory
(which the GitHub VM image has set for some reaons), since they can
interfere with getting exactly the file mode you asked for.
Partially reverts 04ae1cfb7999e25f476f84572ff0ad853629346c
|
|
|
|
subproject_dir, environment, and coredata
|
|
Which are basically the same, except for handling of deprecated options,
and various bugs that only existed in one implementation or the other.
|
|
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.
Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.
A couple of notes regarding backwards compatibility:
- All previous values of `b_sanitize` will remain valid as the syntax
for free-form array values and valid combo choices is the same. We
also treat 'none' specially so that we know to convert it into an
empty array.
- Even though the option has been converted into a free-form array,
callers of `get_option('b_sanitize')` continue to get a string as
value. We may eventually want to introduce a kwarg to alter this
behaviour, but for now it is expected to be good enough for most use
cases.
Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
|
|
|
|
|
|
It basically served two purposes, to allow us to initialize UserOptions,
and to convert those options into Argparse values. The latter has been
transformed into a standalone function, the former can be easily
achieved without this class. This reduces LOC, simplifies setup, and
helps with our type safety.
|
|
|
|
|
|
This is just a bad warning, while it *could* give the user useful
information, it often doesn't since it can get values to warn about
from:
- environment variables
- the command line
- machine files
- `project(default_options : ...)`
- `subproject(default_options : ...)`
- `dependency(default_options : ...)`
The problem of course is that user may have no control over these
values. 3 of them are hardcoded into the meson.build files, so the user
can't do anything about them. And there are legitimate reasons to have
unused values in those, like setting defaults for a language only used
on specific platforms.
Environment variables may be set by the distro (NixOS sets them for any
enabled language, so just having a D compiler causes `DFLAGS` to be set,
for example). They likely don't want to special case "only set the
environment variables if the project is going to use them".
For machine files it limits the utility of the files, since the user
needs to be sure that they don't include any options that wont be used.
Finally, the command line could be altered by wrapper scripts, or simply
programmed to insert options that *may* be used but aren't required.
like setting `objc_args` regardless of whether ObjectivC bindings are
generated.
However, passing completely unknown builtin options should be an error,
as it was before the optionrefactor
|
|
We have the OptionKey in the one caller that exists already, and this
allows us to do a hash lookup instead of a linear walk.
|
|
|
|
It's only used for unittests, so define it as a helper in the unit test
module instead
|
|
Closes: #14255.
|
|
When running tests with `--interactive` we don't redirect stdin, stdout
or stderr and instead pass them on to the user's console. This redirect
causes us to hang in case the test in question needs parsing, like it is
the case for TAP output, because we cannot read the process's stdout.
Fix this hang by not parsing output when running in interactive mode.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
Executing tests can take a very long time. As an example, the Git test
suite on Windows takes around 4 hours to execute. The Git project has
been working around the issue by splitting up CI jobs into multiple
slices: one job creates the build artifacts, and then we spawn N test
jobs with those artifacts, where each test job executes 1/Nth of the
tests.
This can be scripted rather easily by using `meson test --list`,
selecting every Nth line, but there may be other projects that have a
similar need. Wire up a new option "--slice i/n" to `meson test` that
does implements this logic.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
Closes #14281.
|
|
Closes #14254.
|
|
Closes #14279.
|
|
|
|
|
|
|
|
Apple sets sys.pycache_prefix to an user-wide cache folder, so it needs
to be prepended to the root for the glob to work correctly.
|