| Age | Commit message (Collapse) | Author |
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This simplifies a bunch of cases, and likely fixes some annoying bugs
in cross compile situations where should have been passing this and
weren't.
|
|
It's allowed in the `DependencyKeywordArguments` TypeDict already, so we
now have two sources of truth. Additionally, it's often populated by
reading from that dict, so we're just doing useless work.
|
|
It should be added even if unexpected_cfgs is not part of Cargo.toml.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
I missed this in 9104bb616766bd9a05f0b2f280359463d32e227d as we were only
testing whitelisted languages for source file discovery.
Tests now handle all of these by using the map we have in compilers, as
we need to know the suffix to use for the invalid source files we inject.
Note that for tests, we mix explicit --lang in some cases and not others,
which we could probably do better with. For these 'must fail' tests, I've
stuck with explicit `--lang` to make sure we're testing what we want,
but the others are perhaps up for debate.
Bug: https://github.com/mesonbuild/meson/issues/15286
|
|
|
|
* In 1.7.1, the behaviour of --executable was to just ignore it.
* After my recent 9104bb616766bd9a05f0b2f280359463d32e227d, the behaviour
was that we'd require, for --executable xyz, xyz.c to exist or we'd
fail to generate.
Neither are good! Instead, create the sample source file w/ the project
name, but call the executable whatever the user passed with `--executable`.
Bug: https://github.com/mesonbuild/meson/issues/15286
|
|
Use `itertools.product()` to reduce an indentation level or two, though
we lose one again by changing to a function for fresh vs dirty.
I plan on adding more to these tests and it makes it a bit more manageable.
Best-viewed-with: --ignore-all-space
|
|
|
|
Respect collected sources for `meson init` as well as --executable. This
regressed in 9f0ac314ba0c54cc18c2499845324efc14c1849e (part of
https://github.com/mesonbuild/meson/pull/14086, it's easier to see how with
the whole PR).
Also, add subtests (distinguishing between empty directories and those with some
file(s) within). We already had some of these but they weren't marked
as such.
Test `meson init` with a broken source file in the source directory as
we should fail with that, not ignore the file.
It's easier to test with a broken file than a working one as we can assert
the build should fail, it'll pass with just the 1 example file we generate.
Closes: https://github.com/mesonbuild/meson/issues/15286
|
|
Global objects are treated as UnknownValue(), but unlike other variables
their object is created on every call to get_cur_value_if_defined()
instead of coming from a dictionary. This causes the dataflow DAG
to have multiple objects from the same object. Fix this by building
the UnknownValues at interpreter construction time.
Fixes: #15261
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Compiler.symbols_have_underscore_prefix
|
|
|
|
|
|
|
|
For the same reason that the StaticLinker needs this, we need it in the
DynamicLinker as well.
|
|
This is calculated by `Environment().is_cross_build(for_machine)`. Since
we have that in the Compiler class, just calculate it in the Compiler
initializer
|
|
We end up needing it everywhere, so just store it. This patch is huge
already, so it's just the conversion to passing Environment, more
cleanups to come.
|
|
If the first line already conained a match, the former regex didn't
catch it correctly, because it was looking for a newline character to
detect the start of a line.
The new regex is using the proper `^` to match the beginning of a line.
For this to work as expected the `re.MULTILINE` flag has to be set.
|
|
Fixes: #15258
|
|
We can't modify dict-valued kwargs (#14739) but this lets us at least read
them.
|
|
|
|
This info is also available from the "result" entry, but requires
mapping result types to "would cause a failure, but isn't literally
FAIL". It comes in handy for the meson testsuite, too.
|
|
Fixes: #15222
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Clang supports prelinking using the same `-r` flag as GCC. There has been prior
art in [1], which stalled at the time due to Clang inappropriately trying (and
failing) to link libgcc_s. This issue does not occur any more with versions 14
and higher.
[1] https://github.com/mesonbuild/meson/pull/8883
|
|
If a CustomTargetIndex is passed as an argument to a test, running meson
test (with no test glob) does not automatically build the custom_target
before running the test, because CustomTargetIndex outputs are not added
as prerequisites to the meson-test-prereq and meson-benchmark-prereq
targets.
Fixes: #14743
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
We don't always check if a library is actually linkable because of concerns
that a library may not be standalone, so linking against it may still have
unresolved references. We can workaround that by building a shared library
as a test rather than an executable, and in fact we already do that in a
bunch of cases since bb5f2ca3da821d7a8e865cd55a8d5d638e0aab22.
This comes up in particular with Fedora and dependency('atomic') because
on x86_64, they provide a libatomic.so linker script (so our file existence
check passes), but trying to use it later on will fail if the backing package
isn't installed.
_get_file_from_list has not been deleted because the Ninja backend's
guess_library_absolute_path uses it. We might be able to change it to
also use a link test but I've left that alone.
Test notes:
* The _test_all_naming unittest has been tweaked because we were using a
blank file rather than an actual shared library, which (as expected),
now fails.
* I've also added a test for dependency('atomic') providing a result that
can actually be linked against. I've not made it check generally whether
dependency('atomic') finds something when we expect to (at least for now)
as it'll involve some CI whack-a-mole.
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2352531
Bug: https://github.com/mesonbuild/meson/issues/14946
Closes: https://github.com/mesonbuild/meson/issues/10936
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The default value is not passed further through the converter,
therefore it must take proc-macro into account.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The lints table in Cargo.toml has a very human-targeted syntax. When
building manifest.from_raw, flatten everything into a single list,
prefixing the tool name to every warning option and sorting by priority.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This makes easier to run a single test after running them all. For
example the test "test_accsadubl" in the suite "default" of project
"orc" used to be displayed "orc:default / test_accsadubl". To run that
test specifically the command line is `meson test -C builddir
orc:test_accsadubl --suite default`. To make this more consistent
the test is now displayed as "default - orc:test_accsadubl".
|
|
Omitting test()'s `suite` kwarg used to default to `test.suite==['']`
because of how stringlistify() works. That had inconsistent behavior
with `suite: []` which makes `test.suite==[]`. That changed when porting
to typed_kwarg (#8855), which made the default `test.suite==[]`.
Change `suite: []`, and missing kwarg, back to `test.suite==['']` which
was the original intention. It has impact on `meson test --suite`
selection, an empty `test.suite` list means that test is never going to
be selected when `--suite` is used, even when we want all tests from a
given subproject.
It was also unclear what `--suite foo` means. Is `foo` a suite or a
project name? It can now be either, it selects all tests from project
`foo` as well as all tests from any project in suite `foo`.
|
|
Do not look anymore at proc_macro after init, keeping crate_type as the
sole source of truth about the desired crate types.
|
|
This allows keeping the manifest unmodified which is better practice for
a parser. Previously some places had e.g. raw.setdefault().
It also fix some values:
- BuildTarget.doc_scrape_examples is removed. It seems to be some
experimental cargo feature, but I haven't found documentation that
says it should be part of the manifest. It was also missing from raw
manifest.
- BuildTarget.edition does not default to 2015, it default to package's
edition, which itself default to 2015.
- bench value defaults to False for tests.
- Dependency.path must be relative to its Cargo.toml location. If the
value comes from the package it can be used as-is, but if it comes
from workspace it must be made relative.
- Library.name default to its package name with dash replaced with
underscores.
|
|
|
|
Static must be optional, because although the default is static=false,
we special case that static : false is different than static being not
set in a number of cases.
|
|
|
|
|
|
This allows us a bunch of nice things:
1. We can use the DependencyMethods enum everywhere
2. The deprecated methods can be checked in the Interpreter, so we can
now emit deprecation warnings for stuff that was deperecated in
0.44!
3. We can share this more strongly typed method everywhere
|
|
raw.Manifest represents any Cargo.toml file, a package, a workspace, or
both.
However, the Manifest dataclass can only be a package, and the Workspace
dataclass is a workspace with an optional root package.
|
|
Take the key/value separator `=` into account when comparing long and
short option names to avoid invalid matches.
|
|
When processing cargo subprojects, each Resolver was independently
loading Cargo.lock files, leading to duplicate wraps and errors like
'Multiple wrap files provide dependency'.
Instead, build the cargo.Interpreter as soon as a Cargo.lock file is
found, and merge that Cargo.lock into the wrap resolver. There is no
need anymore to build a separate resolver for the dependent packages,
because their indirect dependencies are all listed in the parent lockfile.
|
|
This avoids cloning the same repo multiple times, instead a single wrap
can provide multiple cargo dependencies.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
optstore is able to set buildtype correctly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|