Commit Graph

3129 Commits

Author SHA1 Message Date
Colin Walters
022ff333a3 Port rpmostree-libarchive-input-stream to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
8bdbc81442 Port rpmostree-refts to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
1ec8a341f8 Port rpmostreed-transaction-livefs to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
aeb3dc2c07 Port rpmostree-libbuiltin to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
ec4c1b5530 Port rpmostree-util to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
9ad21b205a Port compose-builtin-rojig to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
b62b9850c2 Port rojig2commit to C++
Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
29dbeee72f More C++ porting, round 6
Port rojig-build and rpm-util to C++.

Prep for using https://cxx.rs/
2020-12-21 08:58:14 +00:00
Colin Walters
a3e2853942 lib: Make varsubst_basearch propagate errors
Shouldn't happen, but it's better than aborting.
2020-12-20 15:23:53 +00:00
Colin Walters
f35afb197d buildsys: Unify build of binary and internal shared library
This completes the task of unifying the build of all of our C/C++
into a single unit, which avoids code duplication and will allow
us to more easily use LTO in the future.
2020-12-20 15:23:53 +00:00
Colin Walters
e05ed11d50 tests: Disable C unit tests
These link to librpmostreepriv.la which will be going away.
I think we should basically focus on moving code into Rust which
has a solid solution for this in `#[test]` and debug vs release
builds etc.
2020-12-20 15:23:53 +00:00
Colin Walters
ec5bdca9e5 buildsys: Compile daemon code directly with binary
A long time ago we de-duplicated the daemon and binary
into a single executable, but left the daemon code
building as an internal static library.

Let's take the next step and compile the sources directly as part
of the executable build.  For example, we can then de-duplicate
the `CFLAGS/CXXFLAGS`.  And in the future this will help us
turn on LTO.
2020-12-20 15:23:53 +00:00
Colin Walters
3e025d9b92 lib: Drop dependencies on internal librpmostree-priv
A long time ago now we started injecting the package list
into the ostree commit.
We were carrying backwards compatibility code to do a checkout
of an ostree commit and extract it, but if we delete that
and have it return an error, it removes the last bits
that end up calling into our internal librpmostreepriv.la.

Now the internal shared library only links to our private `libdnf.so.2`,
`libglnx.la` statically, and libglib.so and libostree.so.

In the future it'd be nice to even drop the linkage to `libdnf.so.2`
because that drags in a lot of stuff, and I suspect e.g. gnome-software
may hit incompatibilities if it also links in the "system" libdnf.
2020-12-20 15:23:53 +00:00
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