| Age | Commit message (Collapse) | Author |
|
Among other things it will say "expects X but only has Y", even if Y >
X.
|
|
Comparing the implementation of build_subdir with
https://github.com/mesonbuild/meson/pull/12258, both of them introduced
a similar separation between srcdir and builddir. There were some
differences in the choices of srcdir vs builddir; this commit tries to
identify which are bugs in which implementation, and get the best of
both worlds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This really isn't a list because it's not homogenous data, it's really
`tuple[str, str | None] | None`, but we're using list length to decide
what to do with it, and that makes for strict null issues, as an
accurate annotation would be `list[str | None]`, which would require a
lot of `is not None` checking. By using a tuple we don't need to keep
checking length, which is more expensive than null checking.
To ensure correctness I annotated some things in the VS backend
|
|
If the dependency version contains a space:
dependency('glib-2.0', version: '>= 2.40.0')
Then the --target-glib version has a space:
--target-glib ' 2.40.0'
The quotes and space have no effect on valac. Tidy the output.
|
|
Place the build products in a directory of the specified name
somewhere within the build directory. This allows use of the target
that includes a specific directory name:
#include <subdir/configure.h>
This also allows creating targets with the same basename by using
different subdirectory names.
v2:
Move build_subdir to Target class.
Error if path separator in build_dir
v3:
Rename to 'build_subdir' to make it clear that the name is
appended to a meson-specific build directory, and does not
provide the user with a way to define the overall meson build
hierarchy.
Allow build_subdir to include path separators.
Support 'build_subdir' for configure_file.
build_subdir must not exist in the source directory and
must not contain '..'
Add documentation and tests
v4:
Rebase and prepare for version 1.9.1
Add failing test case when build_subdir is present in the
project.
Add release note snippet
v5:
Clarify wording on restrictions on the value of build_subdir. Use
the same wording in each place this restriction is described.
v6:
Move path validation to shared function, validate_build_subdir,
instead of duplicating the tests in two places.
v7:
Update version numbers to 1.10.0
Add TypedDict updates.
Remove spurious build_subdir instance variable
v8:
Oops, missed one version number update.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
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>
|
|
They are duplicates of what is already in compilers and have no state. Just
use compilers.
Fixes: #15082
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
No one is accessing backend.interpreter anymore, get rid of it
to avoid future temptations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The interpreter's build_def_files are the only remaining piece
of interpreter state used by the backend. Compute it once
and store it in build, using a property to ensure that it's initialized
and accessed correctly.
This also removes one of the cases in which introspection uses the
interpreter object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
All that is needed is the subdir, pass it explicitly (and make it
an optional argument so that the backend does not have to pass it).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Objects like targets already store the environment in which they
were created, do the same for Generator: pass it to the constructor
and use it in process_files.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts https://github.com/mesonbuild/meson/pull/15107
Explicit objections regarding the design were raised and not answered,
so it shouldn't have been merged. It needs to be discussed and
revisited.
|
|
|
|
There are a lot of spelled out unions for these types, lets reduce that
number
|
|
Which should be `Target | CustomTargetIndex`, not just `Target`
|
|
backends.py has an interesting idiom for keeping the unique
elements of a list. This is much faster than OrderedSet:
* dict.fromkeys() vs. OrderedSet.__init__(): 35% faster on Python
3.13, 50-60% faster on Python 3.10
* list(d) (d is a dict) vs. list(os) (os is an OrderedSet): up to
25% faster on Python 3.13, up to 15% faster on Python 3.10
though it tapers out after a few hundred elements.
Add a function to mesonlib to encapsulate this idiom.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
According to https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-flto,
the -object_path_lto flag is needed to preserve the intermediate object
files.
|
|
This reverts commit 12563f74a9f3dda70dcd4778aa958de355d1fae7.
|
|
Currently there's an undocumented behavior where using
`install_symlink()` to point to a file that does not exist results in
failure `ERROR: Tried to install symlink to missing file`.
Such behavior makes little sense because there's no reason the
destination file should exist. The "destination file" may belong to
another package, in particular to a package inside the same repo the
Meson is controlling, in both cases there's no reason the other
package should be present in the system, because installation does not
typically happen into the system but rather to DESTDIR. And the file
may not be present in DESTDIR either because it may belong to a
different installation target (and different DESTDIR) even if it's in
the same repo.
Best backward-compatible decision here would be to just remove the
check, which is done by this commit.
Fixes: https://github.com/mesonbuild/meson/issues/12253
|
|
It is more logical, since those functions depend on a build target,
and do not require anything specific to the backend.
Furthermore, it will allow us to call determine_rpath_dirs from the
linker in a following commit, without the need to depend on the backend.
|
|
|
|
coredata.get_external_link_args always returns a list
|
|
Make generate_rust_target essentially a replacement from generate_link,
plus the actual generation of rustc compiler arguments. Remove
the parts (especially flatten_object_list and get_fortran_order_deps)
that generate_target already does, and add any objects files that
were produced by compiling non-Rust sources.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3,
ensuring that only POSIX style paths are passed to the compiler
line, and thus fixing UNIX-style tools that treat single
backward slashes as Unicode escaped characters.
Fixes #12191
Completes #12534
Completes #12564
|
|
Previously, meson would only check if glib was part of
target.external_dependencies and add --target-glib appropriately. This
however had the downside of meson not adding --target-glib if glib was
included as a subproject, potentially breaking otherwise builds.
Instead of checking external_dependencies, check target.added_deps for
an occurrence of 'glib-2.0' and then pick the appropriate codepath
(either from the external dependency based on version_reqs or for the
internal dependency based on the actual version, potentially downgraded
to the latest release version)
Related-to: #14694
|
|
Pointed out by Charles Brunet
|
|
Fixes https://github.com/mesonbuild/meson/issues/4668
|
|
It's needed on Darwin for the same reason it's needed on
generic UNIX. Darwin supports both LD_LIBRARY_PATH and
DYLD_LIBRARY_PATH, but the two are not quite equivalent [1],
so we set both.
[1] https://github.com/ffi/ffi/blob/29ad900a/lib/ffi/dynamic_library.rb#L40
|
|
script without interpreter
This is an indirect regression of e8c715786d85dcdbc367f3e379acae25a899c235; the code never accounted for ExternalPrograms that needed a harness.
|
|
only the real arguments to response file
|
|
Fixes #6710
|
|
Fixes #12330
|
|
Allow CUDA to completely override the -std arguments but not the rest.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This will be used by rustdoc tests because the Test objects takes a
single string for the command and everything else goes in the args.
But apart from this, the need to split the executable from the
arguments is common so create new methods to do it.
While at it, fix brokenness in the handling of the zig compiler, which
is checking against "zig" but failing to detect e.g. "/usr/bin/zig".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
We should simply remap these to elide the ../ as it's pretty obviously
the natural expectation of using ../ to fetch files from outside the
project and then drop them *into* the project.
Monorepos will likely have a single license file (or set) under which
the monorepo is licensed. But there will be many components, each of
which may use a different build system, which are "standalone" for the
most part. We already support this case as long as you build from the
monorepo, but the resulting license file gets installed to
```
{licensedir}/../
```
which is silly and unhelpful.
Bug: https://github.com/apache/arrow/issues/36411
|
|
This is an old method, that is now just a wrapper around the OptionStore
method, that doesn't add any value. It's also an option related method
attached to the CoreData instead of the OptionStore, so useless and a
layering violation.
|
|
Using str.split is faster than Path.parts
|
|
Introduce an alternative to os.path.commonpath(name, path) == path,
which is a common idiom throughout Meson. Call it is_parent_path
just like the existing static method in Generator.
It is a bit faster and handles drives on Windows without the need
for an exception handler.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
In large repositories, transitive link dependency resolution using the current
recursive algorithm can result in enough duplicate calls to cause the full
system memory space to be used up.
This commit simplifies link dep resolution by converting the currently used
recursive algorithm to an iterative one that avoids performing work more than
once. If a target's direct dependencies have already been processed, that
target will not be processed again.
These changes result in multiple orders of magnitude of improvements to dep
resolution time and memory usage in the worst case.
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
|
|
|
|
SharedModule (like Python extension modules) are loaded dynamically.
Therefore, they cannot be detected from executable dependencies, and
we must call `determine_windows_extra_paths` on them as well.
Also, those extra paths need to be computed even if the module or the
executable is not installed in the default location.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is a very hot function, improve the memoization of the results by removing
an argument (that is almost always empty, in fact).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|