ostree.git
2 years agowrite_content_object: Don't assume file info has standard::size
Simon McVittie [Fri, 17 Mar 2023 12:56:39 +0000 (12:56 +0000)]
write_content_object: Don't assume file info has standard::size

The file info object for symlinks might validly not have this attribute.
If not, behave as though it was 0, matching what happened with older
versions of GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years ago_ostree_zlib_file_header_new: Default size to 0
Simon McVittie [Fri, 17 Mar 2023 12:54:33 +0000 (12:54 +0000)]
_ostree_zlib_file_header_new: Default size to 0

Similar to the previous commit, but for
ostree_raw_file_to_archive_z2_stream() and similar public APIs.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoostree_raw_file_to_content_stream: Make size default to 0
Simon McVittie [Fri, 17 Mar 2023 12:53:42 +0000 (12:53 +0000)]
ostree_raw_file_to_content_stream: Make size default to 0

Some existing code calls into ostree_raw_file_to_content_stream() with
file objects that do not have the standard::size attribute. Since GLib
2.76.0, attempting to access the size of such an object raises a
critical warning. Handle this more gracefully by defaulting the size
to 0, like earlier versions of GLib did.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge pull request #2835 from cgwalters/more-gfileinfo
Colin Walters [Fri, 17 Mar 2023 00:27:20 +0000 (20:27 -0400)]
Merge pull request #2835 from cgwalters/more-gfileinfo

tests: Set size on fileinfo

2 years agotests: Set size on fileinfo
Colin Walters [Thu, 16 Mar 2023 22:31:03 +0000 (18:31 -0400)]
tests: Set size on fileinfo

Closes: https://github.com/ostreedev/ostree/issues/2827
2 years agoMerge pull request #2834 from evan-a-a/fix_glib
Colin Walters [Thu, 16 Mar 2023 11:56:56 +0000 (07:56 -0400)]
Merge pull request #2834 from evan-a-a/fix_glib

core: Ensure glib standard::size attribute is always set

2 years agocore: Ensure glib standard::size attribute is always set
Evan Anderson [Thu, 16 Mar 2023 02:33:21 +0000 (21:33 -0500)]
core: Ensure glib standard::size attribute is always set

* A recent change in glib [1] requires that the appropriate attribute
be available when calling getters. ostree core only sets this attribute
on regular files, and frequently triggers the critical warning. Solve
this by setting standard::size to zero for non-regular files.

Fixes https://github.com/ostreedev/ostree/issues/2827

[1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3261

2 years agoMerge pull request #2832 from cgwalters/fix-itest-pull-space
Colin Walters [Wed, 15 Mar 2023 14:12:23 +0000 (10:12 -0400)]
Merge pull request #2832 from cgwalters/fix-itest-pull-space

itest-pull-space: Use mkfs.ext4, align to at least 512b

2 years agoMerge pull request #2831 from nanonyme/larger-buffer
Colin Walters [Wed, 15 Mar 2023 12:32:55 +0000 (08:32 -0400)]
Merge pull request #2831 from nanonyme/larger-buffer

Increase buffer size for create_regular_tmpfile_linkable_with_content

2 years agoIncrease buffer size for create_regular_tmpfile_linkable_with_content
Seppo Yli-Olli [Tue, 14 Mar 2023 19:25:08 +0000 (21:25 +0200)]
Increase buffer size for create_regular_tmpfile_linkable_with_content

The small buffer size results in really bad performance under any
FUSE-based filesystems with round-trips.

2 years agoMerge pull request #2814 from tintou/tintou/ostree-coverage
Colin Walters [Tue, 14 Mar 2023 21:35:19 +0000 (17:35 -0400)]
Merge pull request #2814 from tintou/tintou/ostree-coverage

libostree: Enhance the annotation coverage

2 years agoitest-pull-space: Use mkfs.ext4, align to at least 512b
Colin Walters [Tue, 14 Mar 2023 20:51:49 +0000 (16:51 -0400)]
itest-pull-space: Use mkfs.ext4, align to at least 512b

XFS now seems to want filesystems larger than 300MB, so switch
to ext4.  Also use `20MiB` so we align to 512b sectors to squash
a `losetup` warning.
Also tweak some of the numbers to still work.

2 years agoMerge pull request #2821 from smcv/sbin-path
Colin Walters [Mon, 13 Mar 2023 21:29:21 +0000 (17:29 -0400)]
Merge pull request #2821 from smcv/sbin-path

tests: Ensure non-root users have access to libcap tools

2 years agoMerge pull request #2829 from pwithnall/fetcher-wakeup
Colin Walters [Fri, 10 Mar 2023 19:19:18 +0000 (14:19 -0500)]
Merge pull request #2829 from pwithnall/fetcher-wakeup

lib/fetcher-util: Wake up main context when a request is complete

2 years agoMerge pull request #2824 from cgwalters/regen-bindings
Colin Walters [Fri, 10 Mar 2023 19:17:09 +0000 (14:17 -0500)]
Merge pull request #2824 from cgwalters/regen-bindings

rust-bindings: Regenerate for 2023.1 && rust-bindings: `Sysroot` is `Send`

2 years agoMerge pull request #2828 from travier/docs-theme-update
Colin Walters [Fri, 10 Mar 2023 19:16:56 +0000 (14:16 -0500)]
Merge pull request #2828 from travier/docs-theme-update

docs: Use upstream theme & update to 0.4.1

2 years agolib/fetcher-util: Wake up main context when a request is complete
Philip Withnall [Fri, 10 Mar 2023 11:54:34 +0000 (11:54 +0000)]
lib/fetcher-util: Wake up main context when a request is complete

Since the value of `data->done` is not watched by the main context, the
context doesn’t know to wake up from `g_main_context_iteration()` when
that value is changed. The code currently relies on something else
happening to wake the main context up shortly after `data->done` is set.

That doesn’t seem very reliable, so wake the main context up explicitly.

Spotted this while reading the code while trying to debug a stall with
backtrace:
```
5  0x00007ffff68bbbfb in g_main_context_iteration (context=0x60f000136900, may_block=1) at ../../source/glib/glib/gmain.c:4343
6  0x00007fffdc0e50db in _ostree_fetcher_mirrored_request_to_membuf_once (fetcher=0x604001138c10, mirrorlist=0x603001df18b0, filename=0x7fffdc1049e7 "summary.sig", flags=OSTREE_FETCHER_REQUEST_OPTIONAL_CONTENT, if_none_match=0x602002f3b7f0 "\"640a49ff-250\"", if_modified_since=1678395903, out_contents=0x7fffdadd0e80, out_not_modified=0x7fffdadd0e38, out_etag=0x7fffdadd0e28, out_last_modified=0x7fffdadd0e00, max_size=10485760, cancellable=0x6060004bd720, error=0x7fffdadd0ca0) at src/libostree/ostree-fetcher-util.c:95
7  0x00007fffdc0e52e0 in _ostree_fetcher_mirrored_request_to_membuf (fetcher=0x604001138c10, mirrorlist=0x603001df18b0, filename=0x7fffdc1049e7 "summary.sig", flags=OSTREE_FETCHER_REQUEST_OPTIONAL_CONTENT, if_none_match=0x602002f3b7f0 "\"640a49ff-250\"", if_modified_since=1678395903, n_network_retries=5, out_contents=0x7fffdadd0e80, out_not_modified=0x7fffdadd0e38, out_etag=0x7fffdadd0e28, out_last_modified=0x7fffdadd0e00, max_size=10485760, cancellable=0x6060004bd720, error=0x7fffdadd10c0) at src/libostree/ostree-fetcher-util.c:155
8  0x00007fffdc08d937 in _ostree_preload_metadata_file (self=0x61600057bd80, fetcher=0x604001138c10, mirrorlist=0x603001df18b0, filename=0x7fffdc1049e7 "summary.sig", is_metalink=0, if_none_match=0x602002f3b7f0 "\"640a49ff-250\"", if_modified_since=1678395903, n_network_retries=5, out_bytes=0x7fffdadd0e80, out_not_modified=0x7fffdadd0e38, out_etag=0x7fffdadd0e28, out_last_modified=0x7fffdadd0e00, cancellable=0x6060004bd720, error=0x7fffdadd10c0) at src/libostree/ostree-repo-pull.c:3329
9  0x00007fffdc099712 in ostree_repo_remote_fetch_summary_with_options (self=0x61600057bd80, name=0x6020007f4fd0 "eos-apps", options=0x0, out_summary=0x7fffdadd0f88, out_signatures=0x7fffdadd0f80, cancellable=0x6060004bd720, error=0x7fffdadd10c0) at src/libostree/ostree-repo-pull.c:6675
10 0x00007fffdc06887f in ostree_repo_remote_fetch_summary (self=0x61600057bd80, name=0x6020007f4fd0 "eos-apps", out_summary=0x7fffdadd0f88, out_signatures=0x7fffdadd0f80, cancellable=0x6060004bd720, error=0x7fffdadd10c0) at src/libostree/ostree-repo.c:2706
11 0x00007fffdc18f5de in flatpak_dir_remote_fetch_summary (self=0x60c00577e640, name_or_uri=0x6020007f4fd0 "eos-apps", only_cached=0, out_summary=0x7fffdadd10f0, out_summary_sig=0x7fffdadd10e8, cancellable=0x6060004bd720, error=0x7fffdadd10c0) at /opt/gnome/source/flatpak/common/flatpak-dir.c:12235
12 0x00007fffdc1918cb in _flatpak_dir_get_remote_state (self=0x60c00577e640, remote_or_uri=0x6020007f4fd0 "eos-apps", optional=1, local_only=0, only_cached=0, opt_summary_is_index=0, opt_summary=0x0, opt_summary_sig=0x0, cancellable=0x6060004bd720, error=0x7fffdadd15a0) at /opt/gnome/source/flatpak/common/flatpak-dir.c:12789
13 0x00007fffdc19206d in flatpak_dir_get_remote_state_optional (self=0x60c00577e640, remote=0x6020007f4fd0 "eos-apps", only_cached=0, cancellable=0x6060004bd720, error=0x7fffdadd15a0) at /opt/gnome/source/flatpak/common/flatpak-dir.c:12953
14 0x00007fffdc1784f2 in flatpak_dir_update_appstream (self=0x60c00577e640, remote=0x6020007f4fd0 "eos-apps", arch=0x7fffdc239f30 "x86_64", out_changed=0x0, progress=0x6110007479c0, cancellable=0x6060004bd720, error=0x7fffdadd15a0) at /opt/gnome/source/flatpak/common/flatpak-dir.c:5182
```

I don’t think it’ll fix it (calling `g_main_context_wakeup()` on the
context in the debugger didn’t help), but it can’t hurt.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2 years agodocs: Use upstream theme & update to 0.4.1
Timothée Ravier [Fri, 10 Mar 2023 11:17:16 +0000 (12:17 +0100)]
docs: Use upstream theme & update to 0.4.1

Use a fixed tag for the theme so that we can directly pull it from
upstream and skip vendoring the theme in the coreos org.

2 years agorust-bindings: `Sysroot` is `Send`
Colin Walters [Sat, 4 Mar 2023 15:54:48 +0000 (10:54 -0500)]
rust-bindings: `Sysroot` is `Send`

I want to spawn tokio worker threads referencing sysroot objects
in bootc.

Just like the repo, there's nothing thread-local about it.

2 years agorust-bindings: Regenerate for 2023.1
Colin Walters [Sat, 4 Mar 2023 15:54:04 +0000 (10:54 -0500)]
rust-bindings: Regenerate for 2023.1

Still need to automate this...

2 years agotests: Ensure non-root users have access to libcap tools
Simon McVittie [Mon, 27 Feb 2023 12:40:05 +0000 (12:40 +0000)]
tests: Ensure non-root users have access to libcap tools

On Debian systems, by default only root has /{usr/,}sbin in PATH.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2 years agoMerge pull request #2818 from cgwalters/release-rust
Joseph Marrero Corchado [Mon, 20 Feb 2023 22:13:44 +0000 (17:13 -0500)]
Merge pull request #2818 from cgwalters/release-rust

Release rust/ bindings 0.17.1

2 years agoMerge pull request #2755 from cgwalters/use-new-selinux-arg
Jonathan Lebon [Fri, 17 Feb 2023 21:47:04 +0000 (16:47 -0500)]
Merge pull request #2755 from cgwalters/use-new-selinux-arg

2 years agoRelease rust/ bindings 0.17.1
Colin Walters [Fri, 17 Feb 2023 18:06:14 +0000 (13:06 -0500)]
Release rust/ bindings 0.17.1

2 years agoMerge pull request #2817 from cgwalters/release
Jonathan Lebon [Fri, 17 Feb 2023 17:33:12 +0000 (12:33 -0500)]
Merge pull request #2817 from cgwalters/release

2 years agoconfigure: post-release version bump
Colin Walters [Fri, 17 Feb 2023 13:27:26 +0000 (08:27 -0500)]
configure: post-release version bump

2 years agoRelease 2023.1
Colin Walters [Fri, 17 Feb 2023 13:25:40 +0000 (08:25 -0500)]
Release 2023.1

2 years agolibostree: Enhance the annotation coverage
Corentin Noël [Thu, 9 Feb 2023 15:28:53 +0000 (16:28 +0100)]
libostree: Enhance the annotation coverage

Increase the coverage of the GObject Introspection annotation and most notably
replace the use of "allow-none" with "out" parameters to "nullable" or "optional"
as the previous annotation is deprecated and ambiguous.

2 years agoMerge pull request #1946 from dbnicholson/ostree-metadata-api
Colin Walters [Thu, 9 Feb 2023 13:24:58 +0000 (08:24 -0500)]
Merge pull request #1946 from dbnicholson/ostree-metadata-api

ostree-metadata commit API

2 years agoMerge pull request #2811 from dbnicholson/cli-polish
Colin Walters [Thu, 9 Feb 2023 13:10:36 +0000 (08:10 -0500)]
Merge pull request #2811 from dbnicholson/cli-polish

Various CLI improvements

2 years agoMerge pull request #2792 from lucab/ups/annotation-nullable
Luca Bruno [Wed, 8 Feb 2023 17:27:45 +0000 (17:27 +0000)]
Merge pull request #2792 from lucab/ups/annotation-nullable

lib/sysroot-upgrader: add some 'nullable' annotations

2 years agolib/sysroot-upgrader: add some 'nullable' annotations
Luca BRUNO [Wed, 8 Feb 2023 16:28:09 +0000 (16:28 +0000)]
lib/sysroot-upgrader: add some 'nullable' annotations

2 years agobin/remote-summary: Add options to show metadata
Dan Nicholson [Mon, 30 Jan 2023 05:45:29 +0000 (22:45 -0700)]
bin/remote-summary: Add options to show metadata

2 years agobin/summary: Add options to show metadata
Dan Nicholson [Mon, 30 Jan 2023 05:45:29 +0000 (22:45 -0700)]
bin/summary: Add options to show metadata

2 years agoostree/dump: Add support for summary metadata keys
Dan Nicholson [Mon, 30 Jan 2023 05:41:52 +0000 (22:41 -0700)]
ostree/dump: Add support for summary metadata keys

Like with commit metadata, it's useful to list and print metadata keys
are in a summary file. This adds helpers to do that.

2 years agobin/show: Add options to list metadata keys
Dan Nicholson [Sun, 29 Jan 2023 21:13:05 +0000 (14:13 -0700)]
bin/show: Add options to list metadata keys

While `--print-metadata-key` is very useful, it's not that helpful if
you don't know what the keys are.

2 years agobin/remote-refs: Add option to print revisions
Dan Nicholson [Sun, 29 Jan 2023 16:37:03 +0000 (09:37 -0700)]
bin/remote-refs: Add option to print revisions

The only other way to get the remote ref revision from the CLI is to
scrape the output of `ostree remote summary` or pull the commit. The
revision is already there in the summary's ref map, so might as well add
an option to show it.

2 years agobin/refs: Add option to print revisions
Dan Nicholson [Sun, 29 Jan 2023 16:23:13 +0000 (09:23 -0700)]
bin/refs: Add option to print revisions

Allow printing the revision along with the ref. This is very convenient
for looping over the refs in a shell as well as for quickly seeing which
refs are pointed to the same commit.

2 years agobin/refs: Sort listing
Dan Nicholson [Sun, 29 Jan 2023 13:49:18 +0000 (06:49 -0700)]
bin/refs: Sort listing

The output is much more readable sorted. I can't think of any reason
you'd want it unsorted (which is essentially dentry order).

2 years agobin: Cleanup documentation of --cache-dir option
Dan Nicholson [Sun, 29 Jan 2023 16:28:31 +0000 (09:28 -0700)]
bin: Cleanup documentation of --cache-dir option

In all cases documentation was missing from the manual and the bash
completion was incorrectly assigning it as a boolean option.

2 years agorepo: Prevent publishing summary without matching signature
Dan Nicholson [Tue, 21 Jan 2020 19:43:35 +0000 (12:43 -0700)]
repo: Prevent publishing summary without matching signature

Use a temporary directory for the summary and signature file in
`ostree_repo_regenerate_metadata` so that the summary file isn't
published if signing fails. This prevents publishing a summary without a
signature file or leaving a mismatched signature file in place.

2 years agolib: Provide internal summary signing with separate directory
Dan Nicholson [Tue, 21 Jan 2020 18:56:09 +0000 (11:56 -0700)]
lib: Provide internal summary signing with separate directory

Refactor the summary signing APIs to use internal versions where the
directory fd containing the summary can be found. The existing signing
APIs still uses the repo directory fd, but this will allow using a
temporary directory for the summary and signature in the new metadata
generating API.

2 years agorepo: Create metadata commit in ostree_repo_regenerate_metadata
Dan Nicholson [Tue, 15 Oct 2019 22:46:59 +0000 (16:46 -0600)]
repo: Create metadata commit in ostree_repo_regenerate_metadata

Rather than creating the `ostree-metadata` commit in the summary
builtin, do it in the new `ostree_repo_regenerate_metadata` API. The
commit contents are unchanged and the commit is generated before the
summary as before. To keep from triggering an extra summary update,
automatic summary updating is disabled in the transaction.

Since the summary builtin was already using the new API, it will
continue to generate the `ostree-metadata` commit when the repo has a
collection ID. However, the `ostree_repo_regenerate_summary` API will
still only generate the summary file as before.

2 years agocommit: Allow skipping automatic summary generation
Dan Nicholson [Tue, 15 Oct 2019 22:31:23 +0000 (16:31 -0600)]
commit: Allow skipping automatic summary generation

If a commit is being made during summary generation, then it would
trigger the summary to be generated again. That's either unwanted busy
work or could result in an infinite loop. Add a boolean in
`OstreeRepoTxn` to disable automatic summary generation as seen fit.

2 years agobin/summary: Use ostree_repo_regenerate_metadata
Dan Nicholson [Tue, 15 Oct 2019 17:55:22 +0000 (11:55 -0600)]
bin/summary: Use ostree_repo_regenerate_metadata

Call `ostree_repo_regenerate_metadata` with the provided GPG and sign
keys to generate and sign the summary in one call. This changes the
handling when GPGME support is disabled but GPG keys are supplied.
Instead of silently ignoring the option, it will now error. IMO that's
better as callers would otherwise not know that the summary is not GPG
signed.

2 years agorepo: Add API to regenerate and sign repo metadata
Dan Nicholson [Tue, 15 Oct 2019 17:41:08 +0000 (11:41 -0600)]
repo: Add API to regenerate and sign repo metadata

Currently this is just a wrapper around regenerating and signing the
summary in one call, but later it will be used to also generate the
`ostree-metadata` commit if the repo has a collection ID.

2 years agoStrip trailing whitespace on all C files
Dan Nicholson [Tue, 7 Feb 2023 21:48:15 +0000 (14:48 -0700)]
Strip trailing whitespace on all C files

My editor started following the configuration in .editorconfig and is
applying this rule to many files I'm editing. Let's just get this over
with and strip everything. This was done like so:

  git ls-files | grep '\.[ch]$' | xargs sed -ri 's/\s+$//'

2 years agoMerge pull request #2810 from tmdh/fix-docs
Colin Walters [Sun, 5 Feb 2023 13:46:44 +0000 (08:46 -0500)]
Merge pull request #2810 from tmdh/fix-docs

docs: Fix link to ostree-rs

2 years agodocs: Fix link to ostree-rs
Tareque Md Hanif [Sun, 5 Feb 2023 05:49:41 +0000 (11:49 +0600)]
docs: Fix link to ostree-rs

2 years agoMerge pull request #2808 from jlebon/pr/lock-prune
Colin Walters [Wed, 1 Feb 2023 13:48:14 +0000 (08:48 -0500)]
Merge pull request #2808 from jlebon/pr/lock-prune

ostree/prune: Calculate reachability under exclusive lock

2 years agoostree/prune: Calculate reachability under exclusive lock
Jonathan Lebon [Mon, 30 Jan 2023 18:45:50 +0000 (13:45 -0500)]
ostree/prune: Calculate reachability under exclusive lock

When we calculate the reachability set in `ostree prune`, we do this
without any locking. This means that between the time we build the set
and when we call `ostree_repo_prune_from_reachable`, new content
might've been added. This then causes us to immediately prune that
content since it's not in the now outdated set.

Fix this by calculating the set under an exclusive lock.

I think this is what happened in
https://github.com/fedora-silverblue/issue-tracker/issues/405. While
the pruner was running, the `new-updates-sync` script[1] was importing
content into the repo. The newly imported commits were immediately
deleted by the many `ostree prune --commit-only` calls the pruner does,
breaking the refs.

[1] https://pagure.io/fedora-infra/ansible/blob/35b35127e444/f/roles/bodhi2/backend/files/new-updates-sync#_18

2 years agoMerge pull request #2795 from cgwalters/fix-docsrs-build
Colin Walters [Fri, 27 Jan 2023 13:18:06 +0000 (08:18 -0500)]
Merge pull request #2795 from cgwalters/fix-docsrs-build

bindings: Use default for uninitialized fields in checkout opts

2 years agobindings: Consistently check for `dox` feature
Colin Walters [Thu, 15 Dec 2022 01:09:37 +0000 (20:09 -0500)]
bindings: Consistently check for `dox` feature

This fixes the build on docs.rs:

https://docs.rs/crate/ostree-ext/0.10.2/builds/699039
```
[INFO] running `Command { std: "docker" "start" "-a" "7d90466f040d987cbcc393bc89f5f0688f052f49e2339c354dd731fdaf0f9667", kill_on_drop: false }`
[INFO] [stderr]     Checking ostree v0.17.0
[INFO] [stderr] error[E0063]: missing field `process_passthrough_whiteouts` in initializer of `repo_checkout_at_options::RepoCheckoutAtOptions`
[INFO] [stderr]   --> /opt/rustwide/cargo-home/registry/src/github.com-1ecc6299db9ec823/ostree-0.17.0/rust-bindings/src/repo_checkout_at_options/mod.rs:61:9
[INFO] [stderr]    |
[INFO] [stderr] 61 |         RepoCheckoutAtOptions {
[INFO] [stderr]    |         ^^^^^^^^^^^^^^^^^^^^^ missing `process_passthrough_whiteouts`
```

2 years agoMerge pull request #2807 from dbnicholson/hyper-staticfile-yanked
Colin Walters [Thu, 26 Jan 2023 00:46:34 +0000 (19:46 -0500)]
Merge pull request #2807 from dbnicholson/hyper-staticfile-yanked

tests/inst: Update hyper-staticfile to 0.9.4

2 years agotests/inst: Update hyper-staticfile to 0.9.4
Dan Nicholson [Tue, 24 Jan 2023 20:18:44 +0000 (13:18 -0700)]
tests/inst: Update hyper-staticfile to 0.9.4

Due to some vulnerabilities[1][2], all versions prior to 0.9.4 have been
yanked from crates.io. There have been some API changes since 0.6.0, but
none of them affect the simple `hyper_staticfile::Static` usage here.

1. https://rustsec.org/advisories/RUSTSEC-2022-0069.html
2. https://rustsec.org/advisories/RUSTSEC-2022-0072.html

2 years agoMerge pull request #2793 from ericcurtin/aboot-bootloader-support
Colin Walters [Thu, 5 Jan 2023 18:26:22 +0000 (13:26 -0500)]
Merge pull request #2793 from ericcurtin/aboot-bootloader-support

bootloader: Add an aboot (Android) bootloader backend

2 years agoMerge pull request #2799 from jeamland/replace-radix64
Colin Walters [Tue, 3 Jan 2023 15:46:25 +0000 (10:46 -0500)]
Merge pull request #2799 from jeamland/replace-radix64

Replace the radix64 crate with base64

2 years agoReplace the radix64 crate with base64
Benno Rice [Tue, 3 Jan 2023 00:54:56 +0000 (11:54 +1100)]
Replace the radix64 crate with base64

The radix64 crate was last updated over 3 years ago. On the other
hand the base64 crate appears to be far more actively maintained,
supports all the needed features and has a few orders of magnitude
more users.

2 years agoMerge pull request #2798 from akiernan/support-musl-erange
Colin Walters [Mon, 2 Jan 2023 17:23:59 +0000 (12:23 -0500)]
Merge pull request #2798 from akiernan/support-musl-erange

tests: Handle musl's ERANGE mapping

2 years agotests: Handle musl's ERANGE mapping
Alex Kiernan [Mon, 2 Jan 2023 10:37:49 +0000 (10:37 +0000)]
tests: Handle musl's ERANGE mapping

musl uses "Result not representable" for ERANGE, support this in
addition to glibc's "Numerical result out of range".

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2 years agoMerge pull request #2797 from akiernan/fix-musl-allperms
Colin Walters [Sat, 31 Dec 2022 18:13:26 +0000 (13:13 -0500)]
Merge pull request #2797 from akiernan/fix-musl-allperms

lib/repo-checkout: Add ALLPERMS for musl

2 years agolib/repo-checkout: Add ALLPERMS for musl
Alex Kiernan [Sat, 31 Dec 2022 11:11:14 +0000 (11:11 +0000)]
lib/repo-checkout: Add ALLPERMS for musl

ALLPERMS is glibc specific, add a definition for musl.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
3 years agobootloader: Add an aboot (Android) bootloader backend
Eric Curtin [Tue, 13 Dec 2022 14:12:25 +0000 (14:12 +0000)]
bootloader: Add an aboot (Android) bootloader backend

aboot is special in that it packages kernel, initrd, cmdline, dtb and
signature one combined image (similar to upcoming unified kernel
images). This is then loaded as an image into an aboot partition.

This image is signed by the OS vendor and covers everything in the
image. So locally on the deployed system it should not be possible to
boot an unsigned image (unless signature checking is turned off).

We call a shell script aboot-deploy when it is required to write a new
image to the aboot partition (a file typically starting with aboot and
ending in .img extension). This shell script may also read some
configurations from a .cfg file.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
3 years agoMerge pull request #2766 from cgwalters/avoid-endless-object-queueing
Jonathan Lebon [Thu, 1 Dec 2022 20:30:03 +0000 (15:30 -0500)]
Merge pull request #2766 from cgwalters/avoid-endless-object-queueing

Closes https://github.com/ostreedev/ostree/issues/2732

3 years agoMerge pull request #2789 from lucab/ups/autoconf-gpg-libs
Colin Walters [Tue, 29 Nov 2022 14:21:18 +0000 (09:21 -0500)]
Merge pull request #2789 from lucab/ups/autoconf-gpg-libs

configure: use pkg-config with newer gpgme and gpg-error

3 years agolib/repo: fix an 'unused-function' warning
Luca BRUNO [Mon, 28 Nov 2022 16:45:38 +0000 (16:45 +0000)]
lib/repo: fix an 'unused-function' warning

This silences a warning when building the project with `--with-gpme=no`.

3 years agoconfigure: use pkg-config with newer gpgme and gpg-error
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.

3 years agoMerge pull request #2788 from lucab/ups/lib-assertions
Colin Walters [Sat, 26 Nov 2022 15:19:30 +0000 (10:19 -0500)]
Merge pull request #2788 from lucab/ups/lib-assertions

lib: assert more invariants

3 years agoMerge pull request #2787 from cgwalters/release-rust-bindings
Colin Walters [Thu, 24 Nov 2022 16:15:17 +0000 (11:15 -0500)]
Merge pull request #2787 from cgwalters/release-rust-bindings

rust: Bump to 0.17

3 years agolib: assert more invariants
Luca BRUNO [Thu, 24 Nov 2022 08:13:13 +0000 (08:13 +0000)]
lib: assert more invariants

This converts a few more safety checks into either plain GErrors
or hard assertions.

3 years agorust: Bump to 0.17
Colin Walters [Wed, 23 Nov 2022 18:28:29 +0000 (13:28 -0500)]
rust: Bump to 0.17

We switched gio and cap-std versions, so we need to bump
our own semver.

3 years agoMerge pull request #2786 from cgwalters/release
Colin Walters [Wed, 23 Nov 2022 17:40:02 +0000 (12:40 -0500)]
Merge pull request #2786 from cgwalters/release

Release 2022.7

3 years agoconfigure: post-release version bump
Colin Walters [Wed, 23 Nov 2022 14:03:44 +0000 (09:03 -0500)]
configure: post-release version bump

3 years agoRelease 2022.7
Colin Walters [Wed, 23 Nov 2022 14:02:52 +0000 (09:02 -0500)]
Release 2022.7

3 years agoMerge pull request #2784 from cgwalters/ci-build-integration-tests
Joseph Marrero Corchado [Tue, 22 Nov 2022 20:21:38 +0000 (15:21 -0500)]
Merge pull request #2784 from cgwalters/ci-build-integration-tests

ci: Add a flow that combines C build and Rust integration tests

3 years agoMerge pull request #2781 from cgwalters/bump-bindings
Joseph Marrero Corchado [Tue, 22 Nov 2022 19:34:39 +0000 (14:34 -0500)]
Merge pull request #2781 from cgwalters/bump-bindings

3 years agoci: Add a flow that combines C build and Rust integration tests
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.

3 years agoMerge pull request #2782 from cgwalters/testinst-updates
Joseph Marrero Corchado [Tue, 22 Nov 2022 19:22:48 +0000 (14:22 -0500)]
Merge pull request #2782 from cgwalters/testinst-updates

3 years agoMerge pull request #2783 from cgwalters/test-sudo
Luca Bruno [Tue, 22 Nov 2022 16:30:50 +0000 (16:30 +0000)]
Merge pull request #2783 from cgwalters/test-sudo

tests: Require OSTREE_TEST_SUDO to be set to use `sudo`

3 years agotests: Require OSTREE_TEST_SUDO to be set to use `sudo`
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.

Closes: https://github.com/ostreedev/ostree/issues/2761
3 years agotests/inst: Update sh-inline
Colin Walters [Tue, 22 Nov 2022 15:14:17 +0000 (10:14 -0500)]
tests/inst: Update sh-inline

3 years agotests/inst: Update cap-std-ext to 1.0
Colin Walters [Tue, 22 Nov 2022 15:14:17 +0000 (10:14 -0500)]
tests/inst: Update cap-std-ext to 1.0

3 years agotests/inst: Drop nix dependency
Colin Walters [Tue, 22 Nov 2022 15:12:30 +0000 (10:12 -0500)]
tests/inst: Drop nix dependency

It has various semver bumps and we were literally just using
it to duplicate what's already in `libc`.

3 years agotests/inst: Update to latest ostree-ext
Colin Walters [Tue, 22 Nov 2022 15:09:02 +0000 (10:09 -0500)]
tests/inst: Update to latest ostree-ext

3 years agorust: Regenerate with latest gir and C sources
Colin Walters [Tue, 22 Nov 2022 14:53:59 +0000 (09:53 -0500)]
rust: Regenerate with latest gir and C sources

3 years agoMerge pull request #2768 from cgwalters/update-gio
Colin Walters [Tue, 22 Nov 2022 14:50:27 +0000 (09:50 -0500)]
Merge pull request #2768 from cgwalters/update-gio

rust: Update to gio 0.16

3 years agoMerge pull request #2779 from cgwalters/sysroot-mountns
Colin Walters [Tue, 22 Nov 2022 14:44:04 +0000 (09:44 -0500)]
Merge pull request #2779 from cgwalters/sysroot-mountns

sysroot: Add an API to initialize with mountns

3 years agosysroot: Add an API to initialize with mountns
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
3 years agoMerge pull request #2776 from cgwalters/fix-potential-double-unwind
Luca Bruno [Tue, 22 Nov 2022 11:18:14 +0000 (11:18 +0000)]
Merge pull request #2776 from cgwalters/fix-potential-double-unwind

repo: Avoid potential double unwind when writing panic value

3 years agoAllow missing docs on two `glib::wrapper` functions
Colin Walters [Mon, 21 Nov 2022 18:40:53 +0000 (13:40 -0500)]
Allow missing docs on two `glib::wrapper` functions

This is being triggered in gtk-rs generated code.

3 years agorepo: Avoid potential double unwind when writing panic value
Colin Walters [Fri, 18 Nov 2022 16:26:46 +0000 (11:26 -0500)]
repo: Avoid potential double unwind when writing panic value

Thanks to @shinmao for the report!

Closes: https://github.com/ostreedev/ostree/issues/2775
3 years agoostree: manually patch generated files
Luca BRUNO [Fri, 4 Mar 2022 14:28:35 +0000 (14:28 +0000)]
ostree: manually patch generated files

This manually adds a missing `ToGlibPtr` import, which seems to be result
of some bugs in `gir` code-generation.

3 years agorust: Update to gio 0.16
Colin Walters [Tue, 15 Nov 2022 13:09:52 +0000 (08:09 -0500)]
rust: Update to gio 0.16

This was quite seamless; the only thing I had to tweak was adding
`+ Send` bounds in the `Box<dyn Error>` manual checksum_async API.

3 years agoMerge pull request #2778 from pwithnall/small-leaks
Colin Walters [Mon, 21 Nov 2022 17:39:52 +0000 (12:39 -0500)]
Merge pull request #2778 from pwithnall/small-leaks

Fix a couple of small leaks

3 years agoot-builtin-pull: Fix a minor leak with progress reporting
Philip Withnall [Mon, 21 Nov 2022 16:35:02 +0000 (16:35 +0000)]
ot-builtin-pull: Fix a minor leak with progress reporting

`ostree_async_progress_get_status()` returns an allocated string.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
3 years agolib/pull: Fix a small leak when a variable is reused
Philip Withnall [Mon, 21 Nov 2022 16:34:00 +0000 (16:34 +0000)]
lib/pull: Fix a small leak when a variable is reused

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
3 years agoMerge pull request #2770 from lucab/ups/git-describe-tags
Colin Walters [Mon, 21 Nov 2022 16:33:10 +0000 (11:33 -0500)]
Merge pull request #2770 from lucab/ups/git-describe-tags

ci: adjust git tags filtering

3 years agoMerge pull request #2772 from lucab/ups/bump-msrv
Colin Walters [Mon, 21 Nov 2022 16:32:28 +0000 (11:32 -0500)]
Merge pull request #2772 from lucab/ups/bump-msrv

cargo: bump minimum Rust version to 1.63

3 years agocargo: bump minimum Rust version to 1.63
Luca BRUNO [Fri, 18 Nov 2022 09:13:12 +0000 (09:13 +0000)]
cargo: bump minimum Rust version to 1.63

This bumps MSRV to 1.63, in order to prepare for the next version
of gtk-rs stack.

Ref: https://gtk-rs.org/blog/2022/10/18/new-release.html

3 years agoci: adjust git tags filtering
Luca BRUNO [Wed, 16 Nov 2022 16:09:24 +0000 (16:09 +0000)]
ci: adjust git tags filtering

Another attempt at fixing logic for version detection in COPR.