Commit Graph

3516 Commits

Author SHA1 Message Date
Colin Walters
1de524f668 shlib: Make basearch APIs call /usr/bin/rpm-ostree shlib-backend
This is a potential path to fix
https://github.com/coreos/rpm-ostree/issues/2391

Basically our shared library and executable duplicate too much
code (particularly Rust).  Since most of the shlib APIs aren't
performance sensitive, let's have them fork off the binary
via a hidden CLI entrypoint and parse the output.
2020-12-20 15:23:53 +00:00
Colin Walters
15836d988a Port rpmostree-passwd-util to C++
Prep for using https://cxx.rs/
2020-12-19 12:40:43 +00:00
Colin Walters
b78de32d21 Port rpmostree-composeutil to C++
Prep for using https://cxx.rs
2020-12-19 12:40:43 +00:00
Colin Walters
0571917254 Port rpmostree-output to C++
Prep for using https://cxx.rs/
2020-12-19 12:40:43 +00:00
Colin Walters
baf395e9ed spec: Propagate Fedora default rustflags
We got annobin (hardening) warnings in a downstream RPM analysis,
I think this will help ensure that the Rust code is built with
things like `-znow` etc.
2020-12-17 01:35:27 +00:00
Colin Walters
9d927e9850 daemon: Record the agent ID in the journal
Related to https://github.com/coreos/rpm-ostree/issues/1747

Basically after this we can have `rpm-ostree status` output
e.g. `Agent: zincati` at least *after* an upgrade has happened.
2020-12-16 13:55:11 +00:00
Colin Walters
b3b4dd3d22 msrv: Bump to Rust 1.48.0
We need this for https://cxx.rs

While we're here:

 - Add some more comments/links
 - Since the Rust bits are now at the toplevel, we can explicitly
   invoke `cargo`
 - And since we can do that, use the `+` syntax to specify the
   toolchain explicitly
2020-12-15 16:17:44 +00:00
Colin Walters
3065554ba1 transaction: Also log to journal when processes connect to txn
We have logging when a "client" connects to us over the main bus,
but none when a "process" connects to the transaction-private
DBus socket.

It's going to help us debug problems to log the latter.  In
the future we can try to correlate them, but for now simple
logging in a similar way should help.
2020-12-15 05:07:25 -05:00
Colin Walters
0c5820fd69 service: Explicitly RequiresMountsFor=/boot
See 82679ce834

I've seen at least one user report a bunch of failing
services on CoreOS that might be due to `/boot` not mounting.
Let's make it explicitly clear this is required.

The error would then be systemd saying a dependency failed, rather
than ostree confusingly saying it can't invoke `readlinkat()`.
2020-12-14 14:43:06 -05:00
Colin Walters
63717138ab apply-live: Print a success message
Silence is a bit too eerie for this.  But what we really
need to do is switch to using cxx-rs so we can pass down the
`Transaction` object into Rust so that we can emit messages
from that side (including things like package diffs).
2020-12-14 11:55:09 -05:00
Colin Walters
d9e9e5cf9b Rename ex livefs to ex apply-live
(Keeping the old name for muscle memory compatibility for now)

I think `apply-live` is a clearer name; it's more imperative
and it may not be obvious (particularly to non-native English speakers)
to parse "livefs" as "live fs".
2020-12-14 11:55:09 -05:00
Colin Walters
901649cf2c Port rpmostreed-transaction-types to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
c75ca8a5c4 Port rpmostreed-os to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
007a50c51e Port rpmostree-deployment-utils to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
7d96b598f6 Port rpmostree-sysroot-core to C++
Prep for using https://cxx.rs
2020-12-14 11:02:56 -05:00
Colin Walters
2409228d76 Port rpmostree-sysroot-upgrader to C++
Prep for usage of cxx.rs
2020-12-14 11:02:56 -05:00
dependabot[bot]
f62ec35c41 build(deps): bump libdnf from 028bc35 to 0aa50cc
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `028bc35` to `0aa50cc`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](028bc355b9...0aa50cca61)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 04:15:43 -05:00
Colin Walters
2ec303b244 main: Convert to C++
Also here, catch C++ exceptions and convert to GError.
2020-12-11 15:17:00 -05:00
Colin Walters
171e80fe41 Release 2020.10 2020-12-11 13:56:19 -05:00
Colin Walters
c718f34d43 Fix and improve support for rpmostree-rust.h being pre-generated
First, we now need the `vendor/` directory at the toplevel because
that's where `Cargo.toml` is.

Now this triggers another bug introduced in the build system
with how we're handling the `rpmostree-rust.h` header.
We ended up vendoring a pre-generated one in the tarball
mainly because RHEL doesn't include cbindgen.
Now probably in the future I'd like to fix that.

But let's clean this up - the tarball generation process copies
the file into `rpmostree-rust-prebuilt.h`, and build machinery
detects that and entirely skips looking for or trying to build
our internal cbindgen.
2020-12-11 11:54:34 -05:00
Colin Walters
0c7de65f8e Port rpmostree-kernel to C++
Prep for reworking `core.rs` to use cxx-rs

(Notable in this is the dropping of `goto out` by writing
 a small struct with a destructor to handle the cleanup `unlinkat()` for us)
2020-12-11 06:58:53 -05:00
Colin Walters
9c9188ceae rust: Add deny(unused_must_use)
We're maintaining the operating system, let's hard require
that errors are checked.
2020-12-11 06:58:45 -05:00
Colin Walters
4ce1cd2342 Release 2020.9
A lot of stuff here; new livefs is a big one.  Plus a lot
of internal cleanups, the introduction of C++ and
the 32 bit package script fix etc.
2020-12-10 22:12:39 -05:00
Colin Walters
a93dc55afd Remove unused build cruft (Vagrantfile, old Dockerfile etc)
None of this stuff is maintained or used.
2020-12-10 21:29:19 -05:00
Timothée Ravier
b7fa99e408 rust: Fix various clippy warnings 2020-12-10 15:07:11 -05:00
Colin Walters
db40f27724 livefs: Fix GVariant refcounting
The return value is floating, we need to sink.  Fixes
a critical warning.
2020-12-10 06:01:52 -05:00
Colin Walters
0c29f51026 upgrader: Inject --no-hostonly again if no initramfs-args
Fixes: e9011530e5

Fedora Silverblue doesn't specify any `initramfs-args` in the
treefile.   The above commit then caused us to omit `--no-hostonly`
which completely fails today because we sandbox dracut off
from seeing the real hardware and the host filesystems, so
it omits a lot of modules.

It wasn't noticed because Fedora CoreOS does always specify
arguments in the treefile.

Closes: https://github.com/coreos/rpm-ostree/issues/2343
2020-12-10 04:40:08 -05:00
Jonathan Lebon
36614aeab2 libpriv/scripts: Fix uint64 printing
Yet more print format issues uncovered by users running on armv7.

Also add a space between the specifier and the "ms" because it makes one
doubtful whether printf interprets this correctly.

I think this will resolve
https://bugzilla.redhat.com/show_bug.cgi?id=1906184.
2020-12-09 18:12:48 -05:00
Colin Walters
f1488e52f0 Move the main Rust infra (i.e. Cargo.toml) to the toplevel
I think we should have done this as soon as it was clear that
Rust was sticking and not just an optional thing.

Reasons to make this change now:
 - More clear that Rust is going to be the majority of code in the future
 - `cargo build` and `cargo test` in a fresh git clone Just Work
 - Paves the way for using `cargo` to build C/C++ instead of Automake
2020-12-09 17:42:35 -05:00
dependabot[bot]
264b07eb82 build(deps): bump serde_derive from 1.0.117 to 1.0.118 in /rust
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.117...v1.0.118)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-09 05:37:49 -05:00
dependabot[bot]
87024019da build(deps): bump structopt from 0.3.20 to 0.3.21 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.20 to 0.3.21.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.20...v0.3.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 18:47:31 -05:00
dependabot[bot]
c62c393c1e build(deps): bump serde from 1.0.117 to 1.0.118 in /rust
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.117...v1.0.118)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 17:57:00 -05:00
Colin Walters
90f4427bbf Move bindgen into tooling/, add dependabot
Prep for adding cxxbridge-cmd which we need to vendor too.
2020-12-08 16:32:24 -05:00
Colin Walters
d1fe505d02 Port rpmostreed-transaction to C++
And add a try/catch-convert-to-GError here too.  This will
allow us to throw exceptions from transaction implementations.
2020-12-08 16:01:52 -05:00
Colin Walters
ca8c54e21c Port rpmostree-core to C++
More prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
Colin Walters
d79e0e5c77 Port rpmostree-postprocess to C++
Prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
Colin Walters
6722496bb1 app: Port dbus-helpers to C++
Prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
dependabot[bot]
b275c30bcd build(deps): bump libdnf from 35f2062 to 028bc35
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `35f2062` to `028bc35`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](35f2062c85...028bc355b9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 04:48:21 -05:00
dependabot[bot]
215ed95e47 build(deps): bump serde_json from 1.0.59 to 1.0.60 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.59 to 1.0.60.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.59...v1.0.60)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 03:53:49 -05:00
dependabot[bot]
03fcca6f38 build(deps): bump libc from 0.2.80 to 0.2.81 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.80 to 0.2.81.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.80...0.2.81)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 18:03:12 -05:00
Colin Walters
eeb97e724e Add a helper move_nullify
This avoids the casts required for `g_steal_pointer()`.
2020-12-07 17:38:13 -05:00
Colin Walters
cd2307ccc2 tests: Add case for running rpm -q in a %post
On traditional rpm systems this can hang because the outer
process may have an rpmdb lock, and the inner one wants
to acquire a lock.  Here we're sandboxing the `%post` script
and it's targeting a separate temporary filesystem compared to
the booted one (so there's no double locking).  Plus we don't
create the rpmdb in the target until all scripts have run.

Inspired by https://twitter.com/_msw_/status/1335981558717587473
2020-12-07 15:09:44 -05:00
Jonathan Lebon
73fe78140d history: Use shorthand struct initialization
This lit up in my editor.
2020-12-07 12:58:33 -05:00
Jonathan Lebon
063fa9c7eb app/history: Limit entries to print to 3
I've been meaning to hook up `ex history` to a pager a-la-journalctl,
though it's not high-priority, and it'd be nice to do it in Rust instead
(I think this command would be a good candidate for more oxidation if we
move the CLI entrypoint to Rust.)

For now at least, let's not spam the full history by default. Instead,
limit it to 3, and add `--limit` and `--all` options to tweak that if
wanted (I thought about making `--limit -1` just mean all entries,
though I think I'd still want an explicit `--all` anyway.)
2020-12-07 12:58:33 -05:00
dependabot[bot]
e6bcb855d6 build(deps): bump anyhow from 1.0.34 to 1.0.35 in /rust
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.34 to 1.0.35.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.34...1.0.35)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 11:40:00 -05:00
dependabot[bot]
3bc356cc16 build(deps): bump libglnx from a8b4418 to 900caea
Bumps libglnx from `a8b4418` to `900caea`.

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 10:06:37 -05:00
Luca BRUNO
57f7e1fa8e core: add a guard for temporary-etc context and move to Rust
This adds a guard around the postprocessing logic dealing with
creating/destroying a temporary-etc context, and moves it to Rust.
2020-12-07 08:23:49 -05:00
Luca BRUNO
1b00f13d34 tests/override-kernel: support f33 2020-12-07 07:58:18 -05:00
Luca BRUNO
1c954a01cb Revert "ci: Freeze FCOS commit to f32"
This reverts commit eaf8ab8cf3.
2020-12-07 07:58:18 -05:00
Luca BRUNO
c3b37a0c3b tests/jsonutil: update invalid specifier
This fixes the invalid datetime testcase, picking a new specifier
as `%f` recently became a valid one in glib.

Ref: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1605
2020-12-07 07:58:18 -05:00