Luca BRUNO [Thu, 24 Nov 2022 16:39:35 +0000 (16:39 +0000)]
configure: use pkg-config with newer gpgme and gpg-error
This tweaks autoconf logic in order to use pkg-config for gpgme
and gpg-error when available.
Recent versions of gpgme directly provide threaded support, and
gpg-error started shipping a .pc file. Thus on recent distributions
it is possible to directly use pkg-config for both. On older
environments, the legacy logic is kept in place.
Colin Walters [Tue, 22 Nov 2022 18:43:06 +0000 (13:43 -0500)]
ci: Add a flow that combines C build and Rust integration tests
Today it's just the Jenkins flow which builds our Rust
integration tests. Let's add a flow to the GH actions which
does this, and also runs inside a (privileged) container.
Prep for doing more testing of the ostree-container path here.
Colin Walters [Tue, 22 Nov 2022 15:26:44 +0000 (10:26 -0500)]
tests: Require OSTREE_TEST_SUDO to be set to use `sudo`
IMO, tools invoking `sudo` automatically is a huge anti-pattern.
Require this to be opt-in.
In practice also...these tests really want to be *integration*
and not unit tests because involving `sudo` alongside uninstalled
binaries just creates a giant mess.
Colin Walters [Mon, 21 Nov 2022 20:16:04 +0000 (15:16 -0500)]
sysroot: Add an API to initialize with mountns
This lowers down into the C library some logic we
have in the binary/app logic, in prep for having more Rust-native
CLI code in https://github.com/ostreedev/ostree-rs-ext/pull/412
Basically we want to *ensure* a mount namespace by invoking
`unshare()` if necessary, instead of requiring our callers
to do this dance.
This also helps fix e.g. Closes: https://github.com/ostreedev/ostree/issues/2769
Check if an argument is present in OstreeKernelArgs. This is a way to
make easier idempotent append and delete operations.
ostree_kernel_args_append_if_missing uses it to avoid inserting a
duplicate key.
Closes #2329
Signed-off-by: Rafael Garcia Ruiz <rafael.garcia@collabora.com>
Colin Walters [Mon, 14 Nov 2022 19:06:05 +0000 (14:06 -0500)]
fetcher: Avoid too large queues for metadata processing
We added backoff/queueing for fetching via HTTP, but we have
another queue in the metadata scanning which can also grow
up to the number of outstanding objects, which can be large.
Capping the scanning operation when we have hit our operation
limit will avoid potentially large amounts of allocations in the
case of e.g. a slow network.
Simon McVittie [Fri, 28 Oct 2022 11:19:29 +0000 (12:19 +0100)]
Replace calls to g_memdup() with g_memdup2()
g_memdup() is subject to an integer overflow on 64-bit machines if the
object being copied is larger than UINT_MAX bytes. I suspect none of
these objects can actually be that large in practice, but it's easier
to replace all the calls than it is to assess whether we need to
replace them.
A backport in libglnx is used on systems where GLib is older than 2.68.x.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Colin Walters [Fri, 11 Nov 2022 20:03:30 +0000 (15:03 -0500)]
ci: Bump memory for ISO testing flow
It seems likely that we're allocating more RAM here. What we really
need to do is for cosa to express the necessary RAM
requirements declaratively, then we compute pod requirements
from that.
Luca BRUNO [Fri, 11 Nov 2022 14:05:56 +0000 (14:05 +0000)]
copr: only use libostree tags
This adds a tag filter to the logic which emits version labels for
COPR build, so that it avoids mistakenly picking up tags belonging
to the Rust bindings.
Colin Walters [Mon, 31 Oct 2022 13:00:28 +0000 (09:00 -0400)]
Remove readdir-rand
This was only there to reproduce a bug we hit long ago
with bootloader file ordering. We're extremely unlikely
to reintroduce such a bug, and it's not worth carrying around
this code.
Simon McVittie [Fri, 28 Oct 2022 11:21:29 +0000 (12:21 +0100)]
readdir-rand: Copy full size of struct dirent
As noted in readdir(3), in the presence of long filenames it is
possible for a directory entry to be larger than `sizeof (struct dirent)`.
Copy the full length instead.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Luca BRUNO [Fri, 21 Oct 2022 08:43:22 +0000 (08:43 +0000)]
lib/sign-ed25519: convert invariant checks to assertions
This converts several invariant checks to asserts. Most of the
functions in this file were already using assertions, so this aligns
the remaining few outliers to the rest.
Jonathan Lebon [Tue, 25 Oct 2022 13:58:01 +0000 (09:58 -0400)]
ci: bump cosaPod memory requirement to 5Gi
We're hitting memory limits when running the reprovisioning tests. We
should investigate why we need 1Gi of overhead, but for now to get
unblocked let's just bump it.
Luca BRUNO [Tue, 11 Oct 2022 08:50:10 +0000 (08:50 +0000)]
lib/static-delta: document and check parameters format
This enhances the logic handling GVariant parameters within
`ostree_repo_static_delta_generate()`.
Several of those entries are expected to be zero-terminated values,
and this implicit assumption has been observed to be an hidden trap
in languages where strings and arrays may not carry a terminator value
(e.g. Rust).
In order to improve the situation, this makes the documentation more
explicit and actively tries to catch invalid input parameters.