Commit Graph

6514 Commits

Author SHA1 Message Date
Colin Walters
233cc8ce85
Merge pull request #2836 from smcv/file-info-size
Cope with GLib 2.76 being more strict about GFileInfo standard::size
2023-03-17 11:28:18 -04:00
Colin Walters
7b258b2499
Merge pull request #2837 from smcv/g-steal-fd
Use g_steal_fd() in preference to glnx_steal_fd()
2023-03-17 11:27:03 -04:00
Joseph Marrero Corchado
4f0c13fb8b
Merge pull request #2705 from cgwalters/always-boot
Add `sysroot.bootprefix` option
2023-03-17 11:09:19 -04:00
Jonathan Lebon
7e93837e67
Merge pull request #2791 from cgwalters/enable-trust-return-nullability 2023-03-17 09:37:40 -04:00
Simon McVittie
7b02fdfdf8 Use g_steal_fd() in preference to glnx_steal_fd()
g_steal_fd() exists in GLib since 2.70, and libglnx has a backport for
older GLib versions, equivalent to the libglnx-specific glnx_steal_fd().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-03-17 13:32:26 +00:00
Simon McVittie
1b29ab7d90 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>
2023-03-17 12:56:39 +00:00
Simon McVittie
9e116c0f79 _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>
2023-03-17 12:54:33 +00:00
Simon McVittie
722a4179f3 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>
2023-03-17 12:53:42 +00:00
Colin Walters
61a4a83f19 rust: Renerate bindings
To pick up the latest introspection changes.
2023-03-17 08:26:09 -04:00
Colin Walters
c4d03d2850 repo: Fix nullability for remote options
Unfortunately, the nullability of the output value here is
dependent on whether the `default_value` parameter is provided.  There's
no way to express this in introspection or Rust.
2023-03-17 08:25:23 -04:00
Colin Walters
cbec85f2d0 lib: Fix two nullable annotations
- commit parents are optional
- remote URLs are optional
2023-03-17 08:25:23 -04:00
Colin Walters
3f27cff6cb rust: Bump semver
Since we did a bunch of API changes due to nullability and
other introspection cleanups.
2023-03-17 08:13:13 -04:00
Colin Walters
e962c2f352 Add docs and fix annotations for ostree-repo-file.c
The code here is not great, embarassing we've gone this
long without docs for some of these public API functions too.

I think this is right though.
2023-03-17 08:13:13 -04:00
Colin Walters
351d9ffbdc Enable trust_return_value_nullability
Several commonly used APIs currently unnecessarily return
`Option<T>`, like `ostree_deployment_get_csum()`.

Flip the gir flag for this to on; I think our annotations are
correct.
2023-03-17 08:13:13 -04:00
Colin Walters
4238ef4c68
Merge pull request #2835 from cgwalters/more-gfileinfo
tests: Set size on fileinfo
2023-03-16 20:27:20 -04:00
Colin Walters
813c439352 tests: Set size on fileinfo
Closes: https://github.com/ostreedev/ostree/issues/2827
2023-03-16 18:31:03 -04:00
Colin Walters
12fac1ed99
Merge pull request #2834 from evan-a-a/fix_glib
core: Ensure glib standard::size attribute is always set
2023-03-16 07:56:56 -04:00
Evan Anderson
376c9d7eff
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
2023-03-15 22:15:55 -05:00
Colin Walters
c5bfd677ed
Merge pull request #2832 from cgwalters/fix-itest-pull-space
itest-pull-space: Use mkfs.ext4, align to at least 512b
2023-03-15 10:12:23 -04:00
Colin Walters
42aad34e0b
Merge pull request #2831 from nanonyme/larger-buffer
Increase buffer size for create_regular_tmpfile_linkable_with_content
2023-03-15 08:32:55 -04:00
Seppo Yli-Olli
931a85d3f1 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.
2023-03-15 12:04:02 +02:00
Colin Walters
c0427ec1ea
Merge pull request #2814 from tintou/tintou/ostree-coverage
libostree: Enhance the annotation coverage
2023-03-14 17:35:19 -04:00
Colin Walters
e8fbc756cb 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.
2023-03-14 17:07:01 -04:00
Colin Walters
e7c414cbff
Merge pull request #2821 from smcv/sbin-path
tests: Ensure non-root users have access to libcap tools
2023-03-13 17:29:21 -04:00
Colin Walters
751cca707a
Merge pull request #2829 from pwithnall/fetcher-wakeup
lib/fetcher-util: Wake up main context when a request is complete
2023-03-10 14:19:18 -05:00
Colin Walters
e0961b750b
Merge pull request #2824 from cgwalters/regen-bindings
rust-bindings: Regenerate for 2023.1 && rust-bindings: `Sysroot` is `Send`
2023-03-10 14:17:09 -05:00
Colin Walters
1d71602361
Merge pull request #2828 from travier/docs-theme-update
docs: Use upstream theme & update to 0.4.1
2023-03-10 14:16:56 -05:00
Philip Withnall
2600d5c06d 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>
2023-03-10 11:54:34 +00:00
Timothée Ravier
375bef3a4d 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.
2023-03-10 12:17:16 +01:00
Colin Walters
b00f27d476 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.
2023-03-04 10:54:48 -05:00
Colin Walters
be0dbf02d7 rust-bindings: Regenerate for 2023.1
Still need to automate this...
2023-03-04 10:54:04 -05:00
dependabot[bot]
aecdf62828
build(deps): bump libglnx from 4e44fd9 to 07e3e49
Bumps libglnx from `4e44fd9` to `07e3e49`.

---
updated-dependencies:
- dependency-name: libglnx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 13:06:39 +00:00
Simon McVittie
3500ad0443 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>
2023-02-27 12:40:05 +00:00
Joseph Marrero Corchado
a43b143811
Merge pull request #2818 from cgwalters/release-rust
Release rust/ bindings 0.17.1
2023-02-20 17:13:44 -05:00
Jonathan Lebon
4f87e8b6ef
Merge pull request #2755 from cgwalters/use-new-selinux-arg 2023-02-17 16:47:04 -05:00
Colin Walters
31d5f9e13e Release rust/ bindings 0.17.1 2023-02-17 13:06:14 -05:00
Jonathan Lebon
c2974d0b35
Merge pull request #2817 from cgwalters/release 2023-02-17 12:33:12 -05:00
Colin Walters
15b2c4f45c configure: post-release version bump 2023-02-17 11:31:27 -05:00
Colin Walters
cd100df413 Release 2023.1 2023-02-17 11:31:27 -05:00
Corentin Noël
fa750fba80 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.
2023-02-09 16:28:53 +01:00
Colin Walters
8025a83b6d
Merge pull request #1946 from dbnicholson/ostree-metadata-api
ostree-metadata commit API
2023-02-09 08:24:58 -05:00
Colin Walters
cff0a1730a
Merge pull request #2811 from dbnicholson/cli-polish
Various CLI improvements
2023-02-09 08:10:36 -05:00
Corentin Noël
4ba91ec11e libostree: Ignore new_and_connect in the introspection
This function can't be correctly introspected and it is easy enough to connect
to the signal afterwards.
2023-02-09 11:52:11 +01:00
Corentin Noël
518c5977e9 build: Do not include private headers in the introspection
This leads to private symbols being exported.

Also specify the single C header, this relies on the gir_C_INCLUDES make variable,
which was introduced in gobject-introspection 1.51.5.
2023-02-09 11:41:43 +01:00
Luca Bruno
51f3d03d9b
Merge pull request #2792 from lucab/ups/annotation-nullable
lib/sysroot-upgrader: add some 'nullable' annotations
2023-02-08 17:27:45 +00:00
Luca BRUNO
23fe6ada31
lib/sysroot-upgrader: add some 'nullable' annotations 2023-02-08 16:28:09 +00:00
Dan Nicholson
70ec92e1cd bin/remote-summary: Add options to show metadata 2023-02-07 22:59:30 -07:00
Dan Nicholson
b49f93aa95 bin/summary: Add options to show metadata 2023-02-07 22:59:30 -07:00
Dan Nicholson
d0f2c5d361 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.
2023-02-07 22:59:30 -07:00
Dan Nicholson
86701f0f84 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.
2023-02-07 22:59:30 -07:00