Commit Graph

3110 Commits

Author SHA1 Message Date
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
Colin Walters
da78b51e94 bindgen: Bump to 0.15
We've been neglecting this for a long time and it's been omitted
from dependabot.  Everything still seems to work.

Prep for converting to a workspace so we only have a single
`Cargo.lock`.
2020-12-04 04:03:54 -05:00
Colin Walters
a0a5db7b73 compose: Use static enablement for ostree systemd services
I was looking at the output of `ostree admin config-diff`
on a base FCOS boot.  It'd be really nice to trim that down
as much as possible, so we can cleanly capture the difference
between user config and system config.

Let's use static enablement rather than presets.
2020-12-02 22:40:31 +01:00
Colin Walters
bee9c0f605 Remove ex-container
I still think we should do this at some point, but
the experiment with using `GKeyfile` for configuration
is IMO a failure and the variety of data formats
(treefile JSON vs YAML vs origin keyfiles vs container keyfiles)
causes a lot of confusion.

Prep for https://github.com/coreos/rpm-ostree/issues/2326
2020-12-01 23:51:45 +01:00
Colin Walters
887d362906 Convert some code to compile in C++ mode
This is part of investigating using https://cxx.rs/
In order to make this really work, we need to convert some of our C
code to C++ so we can include cxx.rs-generated code.

This starts by converting just two files as a starting point.
I did the minimal porting; I didn't try to actually rewrite them
to resemble modern C++, just "C in C++ mode".
2020-12-01 22:07:49 +01:00
dependabot[bot]
ecbc805d6f build(deps): bump libdnf from 7b7df67 to 35f2062
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `7b7df67` to `35f2062`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](7b7df67e1f...35f2062c85)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 18:38:08 +01:00
dependabot[bot]
be41946737 build(deps): bump nix from 0.19.0 to 0.19.1 in /rust
Bumps [nix](https://github.com/nix-rust/nix) from 0.19.0 to 0.19.1.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.19.0...v0.19.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 18:10:22 +01:00