Commit Graph

3617 Commits

Author SHA1 Message Date
Colin Walters
15842529dd rust: Use indoc crate
I came across this crate the other day randomly - yet *another*
dtolnay dependency.  We have a bunch of these inline multi-line
strings that are just much nicer to read this way.

I only converted this one use, if this merges I'll do more
over time.
2021-03-27 19:51:59 +00:00
Colin Walters
335415d601 tests: Add infinite loop package to kolainst-build
This way it's easy to get outside of the vmcheck tests.
2021-03-26 16:59:30 +00:00
Jonathan Lebon
b2c68b3309
Merge pull request #2694 from cgwalters/in-systemd-api
Add a helper API to detect running in systemd
2021-03-26 11:28:43 -04:00
Colin Walters
a7edfb6293 Add a helper API to detect running in systemd
Use it instead of detecting the journal; we *could* do that
by checking the `JOURNAL_STREAM` variable:
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#%24JOURNAL_STREAM

But, really none of our code cares about this today;
anyone running `rpm-ostree compose tree` under e.g.
`systemd-run` can keep both pieces.
2021-03-26 14:29:53 +00:00
Colin Walters
ffd9e8fc9f ci: Update to use new buildroot pod
Matching https://github.com/coreos/ignition/pull/1182
and discussion in https://github.com/coreos/fedora-coreos-tracker/issues/764
2021-03-26 10:16:05 -04:00
Alexander Wellbrock
a1197d8d93 Fix ambigous compose postprocess man entry
The resulting man-page entry was
'compose postprocess [OPTION…] postprocess ROOTFS [TREEFILE]'
2021-03-25 08:32:10 -04:00
Alexander Wellbrock
dd6beaa67d docs/compose: apply review; unify repo paths
In the sections "Granular.." and "Running rpm..." the usage of repo
paths was inconsistent.
2021-03-24 17:05:58 -04:00
Alexander Wellbrock
892097ee84 docs/compose: add section on the granular approach
This section goes into more detail how compose tree can be split up
using the other available commands.
2021-03-24 17:05:58 -04:00
Alexander Wellbrock
5ed0834144 docs/compose: add a introductory section
This section is meant to give a broad overview of this doc.

First introducing the tool in general. Then showing the distinction
between 'compose tree' and the granular approach. Finally transitioning
over to the next section.
2021-03-24 17:05:58 -04:00
Alexander Wellbrock
bf14072087 docs/compose: move container section to bottom
The container docs are nice to know but not the most important thing.
2021-03-24 17:05:58 -04:00
Jonathan Lebon
3dda1a33b4
Merge pull request #2689 from cgwalters/bwrap-rs-prep2
bwrap,scripts: Add and use cleaner APIs for standard descriptors
2021-03-23 11:54:09 -04:00
Jonathan Lebon
0fd82990c7
Merge pull request #2691 from cgwalters/strip-remote-error
clientlib: Strip GDBus remote error before throwing exception
2021-03-23 10:49:45 -04:00
Colin Walters
7ec7e3eb28 clientlib: Strip GDBus remote error before throwing exception
In general our error handling philosophy is "errors are strings".
Previously (before C++) we were relying on calling this API
to strip out the GDBus remote error message.

In the recent refactoring of clientlib to expose the txn APIs
to Rust via C++, we implicitly lost that because the C++
wrapper API throws an exception.

Add a copy of the remote error stripping here.  Eventually
it will likely make sense for it to *only* be here instead
of also in `main.cxx`, but one thing at a time.
2021-03-22 19:30:49 +00:00
dependabot[bot]
c566e51c4a build(deps): bump cxx from 1.0.32 to 1.0.33
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.32...1.0.33)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 15:12:01 -04:00
Colin Walters
df6c916808 bwrap,scripts: Add and use cleaner APIs for standard descriptors
Port away from a generic child setup function towards more standard
APIs for setting up fd streams.  Prep for oxidizing rpmostree-bwrap.cxx
because cxx-rs doesn't support passing callbacks from C++ to Rust.
2021-03-22 19:11:54 +00:00
Timothée Ravier
f186840309 docs: Update instructions to disable countme
Focus on the timer disabling and add a note for the existing libdnf
issue until it is resolved:
https://github.com/rpm-software-management/libdnf/issues/1174
2021-03-22 14:08:23 -04:00
dependabot[bot]
03ab3712ff build(deps): bump system-deps from 3.0.0 to 3.1.0
Bumps [system-deps](https://github.com/gdesmott/system-deps) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/gdesmott/system-deps/releases)
- [Commits](https://github.com/gdesmott/system-deps/compare/v3.0.0...v3.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 14:06:13 -04:00
dependabot[bot]
e15dba0fd8 build(deps): bump cxx-build from 1.0.32 to 1.0.33
Bumps [cxx-build](https://github.com/dtolnay/cxx) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.32...1.0.33)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 12:58:12 -04:00
Jonathan Lebon
5d5f1d498d lockfile: Make packages optional
Now that `source-packages` is supported, we should allow a lockfile to
not specify a `packages` field at all. So make it optional.

We still require at least one of the two fields to be specified.
2021-03-22 12:57:49 -04:00
Jonathan Lebon
7979e250ee lockfile: Allow locking by source RPM EVR
Right now if we want to lock e.g. systemd, we need to specify every
subpackage of systemd that we use. This is a lot of duplication because
in the majority of cases, what we really mean is "lock at this build of
systemd".

Since RPMs bake in the source RPM they were built from, we can use this
to lock packages more succinctly. See the testcase and #2676 for
examples of how this looks.

Closes: https://github.com/coreos/rpm-ostree/issues/2676
2021-03-22 12:57:49 -04:00
Jonathan Lebon
c55037c3fd
Merge pull request #2683 from coreos/dependabot/cargo/libc-0.2.90
build(deps): bump libc from 0.2.88 to 0.2.90
2021-03-22 12:55:42 -04:00
Jonathan Lebon
4a9dc21d0e
Merge pull request #2679 from cgwalters/more-ostree-sys 2021-03-22 12:18:01 -04:00
Jonathan Lebon
9dee0962a1
Merge pull request #2685 from cgwalters/bwrap-rs-prep
kernel: Avoid using bwrap child setup
2021-03-22 12:15:31 -04:00
Jonathan Lebon
515ef9acf8
Merge pull request #2686 from cgwalters/more-postprocess-rs-4
postprocess: Migrate `mutate-os-release` to Rust
2021-03-22 12:09:32 -04:00
dependabot[bot]
d17893187c
build(deps): bump libc from 0.2.88 to 0.2.90
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.88 to 0.2.90.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.88...0.2.90)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 15:42:04 +00:00
Jonathan Lebon
3f0cde9f65
Merge pull request #2687 from cgwalters/bump-openat
Cargo.lock: Bump openat
2021-03-22 11:40:50 -04:00
Colin Walters
25159e1658 Cargo.lock: Bump openat
To pull in https://github.com/tailhook/openat/pull/36
so we can update libc.
2021-03-22 13:44:27 +00:00
Colin Walters
61e7d6a37f postprocess: Migrate mutate-os-release to Rust
Required binding a bit more of the bwrap bits.
2021-03-22 13:06:46 +00:00
Luca BRUNO
6905254344 passwd: optimize validation logic
This improves users/groups validation logic by avoiding spurious
allocations, and by optimizing lookups through an hashset.
2021-03-22 09:02:01 -04:00
Luca BRUNO
42d86d6895 libpriv/passwd: move pre-commit validation hooks to Rust
This moves the users/groups validation logic to Rust, taking care of
all the treefile check-passwd/check-groups knobs.
As all the passwd-handling logic has been ported to Rust, it also
drops the stale C source/headers/imports.
2021-03-22 09:02:01 -04:00
Colin Walters
ae881b991b kernel: Avoid using bwrap child setup
Prep for porting rpmostree-bwrap.cxx to Rust; cxx-rs doesn't
expose passing a function pointer from C++ to Rust.  There's
a simpler API for this anyways.
2021-03-22 13:00:27 +00:00
Colin Walters
8d30a82e0c rust/ostree-host: Add README.md and license files
In preparation for splitting to a new repo.
2021-03-19 18:13:35 +00:00
Colin Walters
41357a730a rust/ostree-host: Add SysrootExt trait
This currently just adds a reimplementation of a new API that's
already in C upstream, but the plan is to add more Rust-only APIs in
the future here.
2021-03-19 18:13:11 +00:00
Colin Walters
da9b64cd44 rust: Factor out an ostree-host crate
In preparation for publishing this to crates.io and moving
into e.g. github.com/ostreedev/ostree-host-rs

So that ostree upstream can move forward with more Rust on the
"top level".
2021-03-19 13:44:01 -04:00
Jonathan Lebon
6844adff23
Merge pull request #2674 from cgwalters/more-postprocess-rs-3 2021-03-18 14:58:59 -04:00
Colin Walters
ae3c1bc9a7 compose: Move remove-files code to Rust
More oxidation.
2021-03-18 18:05:34 +00:00
Colin Walters
7f9129d67d compose: Move mutate-os-release string code to Rust
More classic C string manipulation which is much nicer in Rust
2021-03-18 18:05:34 +00:00
Colin Walters
5dafd7f75d treefile: Add an allow(dead_code)
I assume this will be used soon.
2021-03-17 21:21:09 +00:00
dependabot[bot]
4a19f03eba build(deps): bump libdnf from 4f321ce to 5d45a79
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `4f321ce` to `5d45a79`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](4f321cedb9...5d45a795b3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-17 16:54:48 -04:00
Colin Walters
02f15aac82 ci: Add a Github Action for Rust lints
I'd like to move `cargo fmt` checking out of Jenkins; among
other things, GH actions are *much* faster and nicer for this.
This leaves Jenkins to be more heavyweight testing.
2021-03-17 16:42:28 -04:00
Colin Walters
27aa81beaf rust: Fix minor clippy warnings 2021-03-17 16:42:28 -04:00
Luca Bruno
0827b41ebf
Merge pull request #2673 from lucab/ups/treefile-ids
treefile: tweak check-passwd/check-groups data
2021-03-17 19:33:36 +00:00
Luca BRUNO
c5f2c58f58
rust/treefile: tweak check-passwd/check-groups data
This tweaks the data and types parsed from `check-passwd` and
`check-groups`, so that it can be more easily iterated and
consumed by passwd-handling logic.
2021-03-17 18:25:46 +00:00
Jonathan Lebon
d24f7bbe55
Merge pull request #2670 from cgwalters/release
Release 2021.3
2021-03-17 10:09:09 -04:00
Colin Walters
4b2aa02e50 Release 2021.3 2021-03-17 13:16:06 +00:00
Luca Bruno
b5d6b8266c
Merge pull request #2669 from cgwalters/more-postprocess-rs-2
More postprocess rs 2
2021-03-17 09:01:29 +00:00
Colin Walters
4c5bb4f216 Move units and default-target processing to Rust
More oxidation.
2021-03-16 23:44:55 +00:00
Colin Walters
ef931e20b0 rust/composepost: Cleanup Treefile import
This reads much more cleanly.
2021-03-16 23:28:27 +00:00
Colin Walters
1c5c8fa9c5 postprocess: Remove redundant renames of etc -> usr/etc
Now that we've shrunk this code, two bits that
require renaming `etc` are adjacent and we don't need to rename
it twice.
2021-03-16 23:24:22 +00:00
Colin Walters
9ee27a61ca postprocess: Move rpmdb symlink to Rust
More oxidation.
2021-03-16 23:20:02 +00:00