Commit Graph

486 Commits

Author SHA1 Message Date
Colin Walters
64af3bc059 rust-bindings: Fix readthedocs.io link
It should now point at GH pages.

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

Signed-off-by: Colin Walters <walters@verbum.org>
2024-09-23 10:19:53 +00:00
Colin Walters
d3190dbf56 sysroot: Add a method to borrow sysroot fd
For the same reason we have this method on `Repo`.
2023-12-01 14:35:41 -05:00
Colin Walters
3535b58f7a rust: Add a stateroot() alias in the Rust bindings
Easy to do here, super annoying in C.
2023-11-09 15:02:27 -05:00
Colin Walters
e3291ccce9 tests: Rework detection of trivial-httpd
Because it's now at the toplevel.
2023-09-19 16:52:13 -04:00
Colin Walters
e52530b5e0 rust/sys: Also bump semver for this
Since we bumped the glib major.
2023-09-07 14:54:56 -04:00
Colin Walters
cccc0f1a5b rust: Port to glib 0.18
- Also rolls up a few other changes in the C API
- Drop `&mut` from `OstreeKernelArgs`; it now confuses type inference.
  More generally while using `&mut` here was well intentioned, it
  goes against the glib standard of mapping everything to `&` and
  accepting interior mutability.
2023-09-01 08:44:25 -04:00
Colin Walters
eec67ec109 Drop cap-std from our public APIs
Since it bumped semver (when I didn't expect it to; xref
963eebf3ab (r121651362)

It's not load-bearing enough here to matter versus just passing
an untyped file descriptor.

This mainly means that it will be the `glib` ecosystem which
forces transitive semver bumps for us, not both.
2023-08-31 15:34:26 -04:00
Colin Walters
453aed97f6 tree-wide: Run clang-format
This is a one-time tree wide reformatting to ensure consistency
going forward.
2023-05-02 08:42:19 -04:00
Colin Walters
17b6f4cdc2 rust-bindings: Regenerate
This picks up more of tintou's recent changes.
2023-03-17 11:54:14 -04:00
Colin Walters
61a4a83f19 rust: Renerate bindings
To pick up the latest introspection changes.
2023-03-17 08:26:09 -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
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
Colin Walters
f913e53c2e 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`
```
2023-01-26 14:34:32 -05:00
Colin Walters
15a7ed50c5
Merge pull request #2793 from ericcurtin/aboot-bootloader-support
bootloader: Add an aboot (Android) bootloader backend
2023-01-05 13:26:22 -05:00
Benno Rice
b4667c1b31 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.
2023-01-03 12:02:57 +11:00
Eric Curtin
97117753e3 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>
2022-12-15 16:09:08 +00:00
Colin Walters
3807b84ef9 rust: Bump to 0.17
We switched gio and cap-std versions, so we need to bump
our own semver.
2022-11-23 13:28:29 -05:00
Colin Walters
cceb04de15 rust: Regenerate with latest gir and C sources 2022-11-22 09:53:59 -05:00
Colin Walters
8c831311be
Merge pull request #2768 from cgwalters/update-gio
rust: Update to gio 0.16
2022-11-22 09:50:27 -05:00
Colin Walters
71e3bb8b80 Allow missing docs on two glib::wrapper functions
This is being triggered in gtk-rs generated code.
2022-11-21 13:40:53 -05:00
Colin Walters
a4f5645926 repo: Avoid potential double unwind when writing panic value
Thanks to @shinmao for the report!

Closes: https://github.com/ostreedev/ostree/issues/2775
2022-11-21 13:21:09 -05:00
Luca BRUNO
61daa277a1 ostree: manually patch generated files
This manually adds a missing `ToGlibPtr` import, which seems to be result
of some bugs in `gir` code-generation.
2022-11-21 13:18:51 -05:00
Colin Walters
1a76f45fd7 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.
2022-11-21 13:18:51 -05:00
Rafael Garcia Ruiz
f6d308f130 Idempotent delete operation for OstreeKernelArgs
ostree_kernel_args_delete_if_present checks if an argument is present
in OstreeKernelArgs and delete it.

Signed-off-by: Rafael Garcia Ruiz <rafael.garcia@collabora.com>
2022-11-18 20:26:28 +01:00
Rafael Garcia Ruiz
c4db171dae ostree_kernel_args_contains for OstreeKernelArgs
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>
2022-11-18 13:52:08 +01:00
Colin Walters
8d08e563b4 rust: Drop openat dependency
We can use cap-std in our tests.
2022-11-13 09:47:53 -05:00
Luca BRUNO
33cf347117
cargo: prepare ostree 0.16.0 and ostree-sys 0.11.0
This prepares for a new release of both crates, now using the
gtk-rs 0.15 stack.
2022-10-27 14:21:23 +00:00
Luca BRUNO
dbb6daf101
rust/ostree: regenerate for gtk-rs 0.15 2022-10-26 13:49:35 +00:00
Luca BRUNO
0b3833bf55
rust/ostree-sys: regenerate for gtk-rs 0.15 2022-10-26 13:49:34 +00:00
Luca BRUNO
1e0e814f38
rust: update pinned gir tool to 0.15 2022-10-26 13:49:33 +00:00
Colin Walters
1258c371d6
Merge pull request #2742 from lucab/ups/rust-regenerate-2022.6
rust: regenerate bindings after latest release (2022.6)
2022-10-26 09:15:14 -04:00
Luca BRUNO
9163665a29
ci/rust: bump linting toolchain to latest stable (1.64)
This bumps the Rust toolchain for clippy/rustfmt to 1.64.
2022-10-26 09:27:50 +00:00
Luca BRUNO
10cecd73f0
rust: update manual helpers 2022-10-26 09:26:56 +00:00
Luca BRUNO
6aa7d6e9f7
ostree: manually patch generated files
This manually adds a missing `ToGlibPtr` import, which seems to be result
of some bugs in `gir` code-generation.
2022-10-26 09:26:55 +00:00
Luca BRUNO
f689ca098f
rust: regenerate bindings after latest release (2022.6) 2022-10-26 09:26:54 +00:00
Luca BRUNO
ed6678ce5f
rust/tests: fix static delta generation testcase 2022-10-13 16:30:00 +00:00
Manuel Stühn
14f513cf02
Add test for generating static delta to file 2022-10-13 16:29:58 +00:00
Colin Walters
b55054ec24 rust: Bind ostree_repo_list_commits_starting_with
I wanted to use this as a fallback for
30dee81c22
2022-08-24 09:44:34 -04:00
Colin Walters
629d2f5d7e rust: Update to latest git
In the future I may try to add CI that requires this to be
sync'd...
2022-08-22 15:11:51 -04:00
Colin Walters
55292e4007 rust-bindings: Fix cargo fmt 2022-07-22 15:20:05 -04:00
Colin Walters
e0417957ea rust: Add a test case for ed25519
Specifically, I verified that *before* the previous patch to the
ed25519 C code, the last bit of code would fail with a SIGSEGV when
trying to read the empty signature.
2022-07-14 17:13:51 -04:00
Colin Walters
be2075eef0 repo: Metadata return values from load_file are not nullable
The pattern this API uses in C is to allow the input parameters
pointer targets to be `NULL`, and it doesn't return values in that
case.

A further complexity here is that the API will still return `NULL`
for symbolic links.

But Rust can't express this pattern as is, so we were always
returning values but in `Option<T>` wrappers that the caller needed
to unwrap for the metadata.

(We really want an even more efficient API here that avoids the glib
 objects entirely, e.g. no reason not to pass directly back a type
 that lets Rust directly read from the fd for bare repos, but
 that can come later)
2022-06-23 17:43:42 -04:00
Colin Walters
63499747b9 Bump to cap-std 0.25 and io-lifetimes 0.7
Prep for bumping ostree-rs-ext, which will help bump rpm-ostree,
which will get it out of having two copies of rustix.
2022-06-23 14:59:03 -04:00
Colin Walters
37d0ca41b6 Fix clippy lint in cap-std bits 2022-06-23 14:58:00 -04:00
Colin Walters
e65c8e72c8
Merge pull request #2643 from cgwalters/rust-2021
rust: Switch to 2021 edition, bump MSRV, a few `format!` updates
2022-06-13 09:10:36 -04:00
Colin Walters
eee0eea58b rust-bindings: Wire up tests/
Because the source is in a subdirectory, we lose out on cargo target
autodiscovery.

I noticed this when I edited one of the tests in a way that
should have failed, but didn't...
2022-06-12 14:34:02 -04:00
Colin Walters
93e3784b66 rust: Use inline format! variables in a few places
Since our MSRV now supports it.
2022-06-09 17:51:07 -04:00