| Age | Commit message (Collapse) | Author |
|
That's how it is done in the other two places and without that one
argument too many is passed to the filter function:
```
[...]
File "/usr/lib/python3.14/site-packages/mesonbuild/wrap/wrap.py", line 607, in _get_file
shutil.unpack_archive(path, extract_dir)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/shutil.py", line 1432, in unpack_archive
func(filename, extract_dir, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/shutil.py", line 1349, in _unpack_tarfile
tarobj.extractall(extract_dir, filter=filter)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/tarfile.py", line 2409, in extractall
tarinfo, unfiltered = self._get_extract_tarinfo(
~~~~~~~~~~~~~~~~~~~~~~~~~^
member, filter_function, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/tarfile.py", line 2496, in _get_extract_tarinfo
filtered = filter_function(unfiltered, path)
TypeError: fully_trusted_filter() takes 2 positional arguments but 3 were given
```
|
|
https://truststore.readthedocs.io/
This library allows patching the stdlib ssl module to respect system
certificates, which is a common source of "broken internet" for Windows
users especially.
Fixes: https://github.com/mesonbuild/meson/issues/15121
|
|
Python added a "feature" to assume tarfile extraction is meant solely
for "data", i.e. it ignores many useful features of tar such as
symlinks, ownership, or permission modes that are uncommon on Windows.
Revert this entirely, as Meson is a "fully trusted" application. It can
already execute arbitrary programs, tar files are not vulnerabilities.
In theory "tar" mode exists and is not "data", but we are fully trusted
so why split hairs?
Fixes: https://github.com/mesonbuild/meson/issues/15142
|
|
|
|
Changes from Dylan:
- Don't use Path
- merge the lint fixes
- Fix some typing issues
- Handle non-meson projects
- Remove some code duplication by putting `get_subproject_dir` in
utils
|
|
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.
|
|
.wraplock is nice to have, but prevents Meson from operating on a
read-only source directory.
If the source directory is read-only, there is no possible conflict
so in that case it is acceptable to return without any actual locking.
Fixes: #14948
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
If main project finds a directory subprojects/foo with no corresponding
foo.wrap, it creates a dummy PackageDefinition for it. If we later find
a subproject that has foo.wrap, replace the dummy wrap with it.
This happens for example when wrap-redirect have been deleted. It also
happens for subprojects downloaded from some Cargo.lock which does not
create a wrap-redirect.
Avoid loading the same location twice, which can happen when preparing
cargo subprojects.
|
|
This requires any credentials to be supplied in the url, or some other
means of authentication (such as an identity file configured for the
user) to be used. Supplying a password in the URL is not supported.
|
|
|
|
|
|
It is too old and barfs on patches from git-format-patch:
```
Applying diff file "orc-0.4.38\0001-meson-fix-symbols-leaking-from-static-library-on-Win.patch"
patching file meson.build
Assertation failed!
Program: C:\Strawberry\c\bin\patch.EXE
File: .\src\patch\2.5.9\patch-2.5.9-src\patch.c, Line 354
Expression: hunk
```
2.6.1 is the oldest known version that works correctly.
|
|
|
|
To avoid raceconditions, where one instance of meson currently downloads
a subproject defined in a wrapfile, while another either
a. starts the download itself too
b. attemts to evaluate the partially downloaded subproject
wraplock introduces a lockfile, which should prevent simultaneous access
of subprojects by wrap between different instances of meson.
|
|
When fetching wrap files and releases.json, ask for gzipped data and
decompress it if the server obliges. Wrap files come from GitHub releases,
thus from Azure blob storage, and Azure currently doesn't compress these
responses. releases.json comes from Git master, and GitHub does support
compression there, reducing the response body from ~64 KiB to ~10 KiB.
That's a small change in absolute terms, but straightforward to support.
|
|
|
|
In the case the main project has a .wrap file for a cargo subproject,
that subproject's Cargo.lock must be loaded before we can recursively
fetch all its dependencies.
|
|
This makes wrap requests look more like browser requests, which is
helpful in rare cases to prevent the request from being rejected
|
|
URLError is a subclass of OSError and intermittent server errors can
manifest as OSError while reading instead of a URLError while
establishing a connection, which will cause the fallback url to be
ignored:
```
Looking for a fallback subproject for the dependency gudev-1.0
Downloading libgudev source from https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2
HTTP Error 404: Not Found
WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay...
HTTP Error 404: Not Found
WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay...
HTTP Error 404: Not Found
WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay...
WARNING: failed to download with error: The read operation timed out. Trying after a delay...
WARNING: failed to download with error: The read operation timed out. Trying after a delay...
ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.
```
|
|
Cargo.lock is essentially identical to subprojects/*.wrap files. When a
(sub)project has a Cargo.lock file this allows automatic fallback for
its cargo dependencies.
|
|
This will simplify creating PackageDefinition objects from Cargo.lock
file. It contains basically the same information.
|
|
From python 3.11 [1]:
> The entry in the netrc file no longer needs to contain all tokens. The missing
> tokens' value default to an empty string. All the tokens and their values now
> can contain arbitrary characters, like whitespace and non-ASCII characters.
> If the login name is anonymous, it won't trigger the security check.
[1] https://github.com/python/cpython/commit/15409c720be0503131713e3d3abc1acd0da07378
|
|
Instead of being instance state, it's passed around. This isn't a big
deal internally since most of the users are protected, and the only time
an external change is required is a couple of places in msubprojects,
which is fine because the information is available.
Fixes: #12869
|
|
It's overwritten before it's ever read
|
|
It returns `None | PackageDefinition`, not `PackageDefinition`
|
|
These aren't meant to be called externally. Additionally, they expect
some statefulness from the `resolve()` method, and by making them
protected we can more easily remove this statefulness.
|
|
|
|
Fixes https://github.com/mesonbuild/meson/issues/12092
|
|
This reverts commit 718c86a7d577e6474ff325957248724d9b786174.
We can't always use git to apply patches because they might actually
apply to a git submodule inside a git subproject, and git will not be
able to apply the patch in that case.
|
|
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.
This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.
SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
|
|
"meson wrap status" was calling it for each .wrap file. Better use
lru_cache to ensure we don't make the same mistake elsewhere.
|
|
Update command is implemented in msubprojects.py, because it can update
all wraps in parallel.
|
|
line argument code
|
|
|
|
This most likely happens when the source archive has files which take
advantage of case sensitivity, and someone is unfortunate enough to have
to work with broken operating systems that do not have the capacity to
use modern technology, like the 1970s invention of case sensitive
filesystems.
For example, Windows and macOS both have retrocomputing environments,
where case sensitive abilities were carefully removed from modern
filesystems in order to share the delights of classical computing with
the masses.
On such systems, innocent tarballs fail to extract with:
```
OSError: [Errno 22] Invalid argument: 'C:\path\to\file'
```
thereby demonstrating Microsoft's unbounded and enthusiastic love for
users (who are, universally, retrocomputing fans).
n.b. there is, begrudgingly, a secret option for crazy people who hate
retrocomputing to enable modern 1970s computing on Windows systems.
Naturally, no one with any sense would ever use this, and it is rightly
left in its sensible default in for example Github Actions.
Fixes #12344
|
|
The method can be overridden by setting the `method` key in the wrap
file and always defaults to 'meson'. cmake.subproject() is still needed
in case specific cmake options need to be passed.
This also makes it easier to extend to other methods in the future e.g.
cargo.
|
|
This solves problems with Strawberry Perl providing patch.exe on Windows
with an unconsistent line ending support.
Fixes: #12092
|
|
Allow packagecache to contain already extracted directory to match what
some distro does with Cargo source packages in /usr/share/cargo/registry.
Note that there is no need to lock the cache directory because we
download into a temporary name and atomically rename afterward. It means
we could be downloading the same file twice, but at least integrity is
guaranteed.
Fixes: #12211
|
|
|
|
Performed using https://github.com/ilevkivskyi/com2ann
This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.
So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.
Repeat with:
```
com2ann mesonbuild/
```
|
|
When downloading wrap content, we need to know at some point if the
server is going to respond with "hello, yes, I'm here and I have data
for you". The alternative is to sometimes infinitely hang.
In commit 8f7781f1d6bf36c064b39e7d0794c686f1b78665 we added such a
timeout, but using an extremely generously high number -- ten minutes.
We don't need to wait this long just to find out if the other end
exists, so decrease that time to 30 seconds, whch is still ludicrously
generous but not quite as much so.
|
|
- Do not hardcode terminal width of 100 chars, that breaks rendering on
smaller terminal. It already uses current console width by default.
- Disable progress bar when downloading from msubprojects because it
fetches multiple wraps in parallel.
- Scale unit when downloading e.g. MB/s.
- Do not display rate when it's not a download.
- Do not display time elapsed to simplify the rendering.
|
|
It is a common mistake that is hard to find because Meson silently
ignore unknown sections. Better have an explicit error message.
|
|
patch on Windows is provided by MSYS, which only understands POSIX
paths, with `/`. Using Windows paths with `\` results in a "file not
found" error.
We got a little lucky here because the path is relative, so the drive
letter difference doesn't affect us.
|
|
|
|
This is generally a good idea, and the tempfile is already instructed to
not auto-delete on close. It also fixes a bug on PyPy, where the file
isn't valid because it's not explicitly closed. This is probably due to
the garbage collection modes -- in CPython, the object goes out of scope
and gets automatically closed before we actually attempt to unpack it.
Fixes #11246
|
|
|
|
|
|
Fixes #10931
|