Commit Graph

2854 Commits

Author SHA1 Message Date
Colin Walters
70462a9a05 compose: Add a "warn and sleep" if --unified-core is not provided
Start adding some pain if `--unified-core` isn't provided
to help flush out anyone relying on it.  (And I think today
pungi is not passing it, so e.g. Fedora IoT/Silverblue are impacted)

Prep for merging https://github.com/coreos/rpm-ostree/pull/1793

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
2020-05-20 17:17:28 +02:00
Colin Walters
4311f6ede7 compose: Remove --output-repodata-dir
This was apparently removed in: 2263bb35f6
It's done nothing for the last 5 years, I think it's safe to remove.

I was just looking at this code when thinking about extensions.
2020-05-20 00:09:12 +02:00
dependabot-preview[bot]
52280e319a build(deps): bump clap from 2.33.0 to 2.33.1 in /rust
Bumps [clap](https://github.com/clap-rs/clap) from 2.33.0 to 2.33.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v2.33.1/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v2.33.0...v2.33.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-19 17:52:52 +02:00
dependabot-preview[bot]
86bad78646 build(deps): bump libc from 0.2.69 to 0.2.70 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.69 to 0.2.70.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.69...0.2.70)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-19 17:20:37 +02:00
Doug Hellmann
d160ed181c docs/background: Fix benefits and drawbacks formatting
The lists of pros and cons for each approach in the background section
of the manual use markdown formatting that is rendered as nested
lists. Separate the lists of benefits and drawbacks so that readers of
https://rpm-ostree.readthedocs.io/en/latest/manual/background/ and the
rendered markdown on github can understand which items are pros and
which are cons.

Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
2020-05-15 12:58:17 -07:00
Jonathan Lebon
b7ff1612ea upgrader: Reset ref before fetching commit by override
This is a short-term hack until we can depend on the new
`timestamp-check-from-rev` from ostree:

https://github.com/ostreedev/ostree/pull/2099

That way, we still get downgrade protection, but wrt the checked out
deployment, not the local ref.

For more information, see
https://github.com/coreos/rpm-ostree/pull/2094
https://github.com/coreos/fedora-coreos-tracker/issues/481
2020-05-15 10:30:13 -07:00
Jonathan Lebon
1f5863a33f upgrader: Add more error-prefixing
Both libostree and the upgrader do timestamp checks, and the error
message is exactly the same. So it's hard to tell which path exactly
failed.

Add some error-prefixing to make debugging easier.
2020-05-15 10:30:13 -07:00
Colin Walters
0bfd20c900 build-sys: Disable zchunk for libdnf if we don't have it
Going to update rpm-ostree for RHEL 8.3, we did a huge bump
in libdnf which now defaults to enabling zchunk in its build
system.  We added the infrastructure before to detect things,
so propagate that to libdnf.
2020-05-14 17:52:43 -07:00
Colin Walters
ac5489b065 Release 2020.2
Mostly motivated by keeping the release train going:
https://bugzilla.redhat.com/show_bug.cgi?id=1827712#c18
2020-05-14 13:40:26 -07:00
Colin Walters
0de332bd84 build-sys: Remove --enable-new-name
We didn't ship this for a long time and...well, naming is hard, I guess
it's not going to happen soon.
2020-05-14 13:18:00 -07:00
Luke Blevins
2e58c19e33 Recognize other kernel packages with provides
Remove installonlypkg use and check if other kernel types are provided

Remove unneeded g_printerr statement

Update src/libpriv/rpmostree-core.c

Based on feedback

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
2020-05-14 08:14:19 -07:00
Colin Walters
1bd69619eb treefile: Add readonly-executables
Same motivation as
7392259332

I think we should encourage removing the writable bits from
executables.  This has happened to me:
https://thomask.sdf.org/blog/2019/11/09/take-care-editing-bash-scripts.html

And not having the writable bit may help prevent hardlink
corruption with OSTree in some cases.

We can't do this by default, but add a convenient treefile option
for it.

This starts out by just doing this for RPMs, but I'll add
a secondary pass which does it during postprocessing soon too.
2020-05-12 08:39:37 -07:00
Colin Walters
6df03da742 tests: Move more code to kola
Continuing the migration.
2020-05-12 00:34:26 +02:00
dependabot-preview[bot]
338365cf3f build(deps): bump serde_json from 1.0.51 to 1.0.53 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.51 to 1.0.53.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.51...v1.0.53)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 23:52:07 +02:00
dependabot-preview[bot]
81a8bca5f7 build(deps): bump serde_yaml from 0.8.11 to 0.8.12 in /rust
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.11 to 0.8.12.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.11...0.8.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 23:00:51 +02:00
dependabot-preview[bot]
498796020b build(deps): bump serde_derive from 1.0.106 to 1.0.110 in /rust
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.106 to 1.0.110.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.106...v1.0.110)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 22:01:48 +02:00
Jonathan Lebon
92a83ad722 Makefile.am: Link with --enable-new-dtags
When g-ir-scanner runs, it uses a stub binary to help introspect the
target rpm-ostree library. That binary needs to link to the library, and
of course, transitively, to our bundled libdnf. Since we run the scanner
uninstalled, we use `LD_LIBRARY_PATH` to point the stub at the libdnf
from the build directory.

When we compile rpm-ostree, we use `-rpath` to point it at our libdnf,
which emits a `DT_RPATH` attribute. However, during dynamic linking at
runtime, it turns out that `LD_LIBRARY_PATH` has *lower* precedence than
`DT_RPATH`. This means that if there is already a libdnf at
`/usr/lib64/rpm-ostree`, it takes precedence.

This subtlety is mostly fine to ignore usually, because the stub doesn't
actually run any rpm-ostree business logic, so it doesn't really matter
that it runs against the "technically wrong" `libdnf.so.2`.

Where it becomes obvious something is off however is if we've just
built a new libdnf, and we have new code which references symbols from
the new libdnf that aren't in the stale libdnf at `$libdir/rpm-ostree`.

And this is exactly what was happening in CI (though it's of course
possible to reproduce this locally as well): we were using a new symbol,
`hy_goal_favor`, and building inside the cosa buildroot image, which
already has rpm-ostree installed, and so `ld.so` chose the bundled
libdnf of the installed rpm-ostree when loading the `g-ir-scanner` stub.
Thus why it failed with:

```
./tmp-introspectzh0n2cga/.libs/lt-RpmOstree-1.0: symbol lookup error: .libs/librpmostree-1.so.1: undefined symbol: hy_goal_favor
```

And of course, the root cause here has nothing to do with the stub in
itself. It's actually trivially easy to see the behaviour difference wrt
`LD_LIBRARY_PATH` on installed binaries. Using a shared object
from `python3-libdnf` which links to libdnf without using rpath, we can
see that `LD_LIBRARY_PATH` has an effect:

```
$ ldd /usr/lib64/python3.7/site-packages/libdnf/_transaction.so | grep libdnf
        libdnf.so.2 => /lib64/libdnf.so.2 (0x00007fdde789e000)
$ LD_LIBRARY_PATH=./libdnf-build/libdnf ldd /usr/lib64/python3.7/site-packages/libdnf/_transaction.so | grep libdnf
        libdnf.so.2 => ./libdnf-build/libdnf/libdnf.so.2 (0x00007fa615048000)
```

Whereas with rpm-ostree:

```
$ ldd /usr/bin/rpm-ostree | grep libdnf
        libdnf.so.2 => /usr/lib64/rpm-ostree/libdnf.so.2 (0x00007f7da5271000)
$ LD_LIBRARY_PATH=./libdnf-build/libdnf ldd /usr/bin/rpm-ostree | grep libdnf
        libdnf.so.2 => /usr/lib64/rpm-ostree/libdnf.so.2 (0x00007fc905dbd000)
```

And going further down the rabbit hole, `DT_RPATH` is in fact considered
deprecated for this reason; it makes it harder to run with uninstalled
libraries or whatever reason one has to want to override a library (one
can still use `LD_PRELOAD`, though the semantics are different, and it's
less commonly used than `LD_LIBRARY_PATH`). Instead, we should use
`DT_RUNPATH`, which does have lower precedence than `LD_LIBRARY_PATH`,
matching the usual behaviour.

To make the linker emit `DT_RUNPATH` attributes, we have to use the
`--enable-new-dtags` flag. This also then fixes the g-ir-scanner issue
described above.
2020-05-11 21:42:05 +02:00
dependabot-preview[bot]
2b52b33e19 build(deps): bump libdnf from ee81887 to 65c7e43
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `ee81887` to `65c7e43`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](ee81887228...65c7e43fe9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 21:15:29 +02:00
dependabot-preview[bot]
ff2fbdb3bf build(deps): bump serde from 1.0.106 to 1.0.110 in /rust
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.106 to 1.0.110.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.106...v1.0.110)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 20:50:55 +02:00
Colin Walters
edeefcff23 tests: Trim out dead code from libtest.sh, rework SRCDIR
The main goal here is to get `assert_jq()` usable in
kola tests.

This was forked from ostree long ago but we aren't
using most of it.  I want to try to move this into kola where
we're just using `tests/common` but this code references
`tests/gpghome` which we weren't using.

Only a few things here reference `SRCDIR` - change those
to fail for now if it's not set, since we're not running
those tests in kola yet.  I will eventually try to
clean that up later.
2020-05-11 18:28:41 +02:00
Jonathan Lebon
fc5825a8f9 ci-commitmessage-submodules: Ignore empty merge commits
Jenkins does its own `git merge` when testing PRs. Doing a naive
`git diff ${merge_commit}^..${merge_commit}` won't work right because
it might perform a diff across multiple commits.

What we want to do here is to just skip trivial merge commits or
otherwise error out on them if they're non-trivial (since it likely
means that one did conflict resolution manually instead of rebasing,
which we should encourage).

The `origin/master..$HEAD` range will correctly still contain all the
parents of any merge commit which is not yet in `origin/master`.
2020-05-07 22:21:16 +02:00
Colin Walters
860e0f018a s/RPM-OSTree/rpm-ostree/
We are have been pretty inconsistent about this; I think while it's
true the project is called "OSTree", "RPM-OSTree" is just annoying
to type and looks weird.  `rpm-ostree` requires much less
"shift key gymnastics".

Also, the "proper name" style like RPM/OSTree is best when
something can be viewed more "abstractly" - there are multiple
RPM implementations (historically) and OSTree also is a *concept*
in addition to an implementation.

rpm-ostree though is much more of a "concrete" thing so it
makes more sense to use it as a "project name".
2020-05-07 21:55:50 +02:00
Jonathan Lebon
53cb441597 ci: Download the latest ostree even if from stable repos
Right now, rebuilding ostree into the continuous tag is manual, so we've
only been doing it when necessary to fast-track something e.g. for
rpm-ostree or cosa (see [1] for the long-term goal).

Which means when finding an ostree to use to override in our CI-built
FCOS, we should just let dnf find whatever the latest version is, even
if it's just from the regular Fedora repos.

[1] https://github.com/packit-service/packit/issues/264
2020-05-07 21:32:35 +02:00
dependabot-preview[bot]
23364a3448 build(deps): bump libdnf from 2750d81 to ee81887
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `2750d81` to `ee81887`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](2750d81ca8...ee81887228)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-04 19:09:37 +02:00
dependabot-preview[bot]
bbd9fe3565 build(deps): bump curl from 0.4.28 to 0.4.29 in /rust
Bumps [curl](https://github.com/alexcrichton/curl-rust) from 0.4.28 to 0.4.29.
- [Release notes](https://github.com/alexcrichton/curl-rust/releases)
- [Commits](https://github.com/alexcrichton/curl-rust/compare/curl-sys-0.4.28...curl-sys-0.4.29)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-04 18:47:51 +02:00
Colin Walters
0eb2ec7312 build-sys: Ignore cosa/kola artifacts
These currently end up in the toplevel.
2020-04-30 21:50:41 +02:00
Colin Walters
81f8931162 tests/runkola: New script
This may become `cosa kola-fast` or something.
2020-04-30 21:50:41 +02:00
Colin Walters
22bf449296 tests: Drain more readonly tests into nondestructive/misc
Part of migrating the test suite to kola.
2020-04-30 21:50:41 +02:00
Jonathan Lebon
11af9c41d3 composeutil: Return NULL instead of FALSE
Even though C happily accepts 0 for NULL, this is ambiguous with our
coding style. E.g. here we're actually returning a pointer, not a
gboolean. So let's be less misleading.
2020-04-29 23:40:49 +02:00
Jonathan Lebon
016ad6b424 compose: Allow specifying lockfile-repos only
For Fedora CoreOS production streams, we want to *only* source from
lockfile repos. But right now, rpm-ostree doesn't allow not specifying
`repos`. Relax this restriction and just check that at least one of the
two was provided.
2020-04-29 23:40:49 +02:00
dependabot-preview[bot]
2d65b86922 build(deps): bump structopt from 0.3.13 to 0.3.14 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.13 to 0.3.14.
- [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.13...v0.3.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 20:07:54 +02:00
Colin Walters
a238ca9c76 status: Don't output AutomaticUpdates: disabled by default
Pre-FCOS we made an effort for automatic updates but nowadays
with Fedora CoreOS we generally expect people to be using zincati.

Until we fix the "agent registration" problem:
https://github.com/coreos/rpm-ostree/issues/1747
Let's not confuse people by printing `AutomaticUpdates: disabled`.

Only print if it's set to a value in non-verbose mode.
2020-04-22 16:45:05 +02:00
dependabot-preview[bot]
a70da06b71 build(deps): bump libdnf from 5339635 to 2750d81
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `5339635` to `2750d81`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](533963525a...2750d81ca8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-22 08:30:54 -04:00
Colin Walters
c94639f546 ci: Explicitly fetch before build
See https://github.com/coreos/coreos-assembler/pull/1379
2020-04-21 14:02:16 -04:00
Jonathan Lebon
682aad249b app/compose: Fix help string for --ex-lockfile-strict
Minor follow-up to #1858. Make the help string here more helpful and
accurate.
2020-04-20 17:41:09 -04:00
dependabot-preview[bot]
dbb776f17d build(deps): bump libc from 0.2.68 to 0.2.69 in /rust/libdnf-sys
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.68 to 0.2.69.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.68...0.2.69)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 11:29:45 -04:00
dependabot-preview[bot]
53f8faa3b0 build(deps): bump libc from 0.2.68 to 0.2.69 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.68 to 0.2.69.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.68...0.2.69)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 10:37:15 -04:00
Jonathan Lebon
3ec5e2878d manifest: Add lockfile-repos field
In Fedora CoreOS, we have a "coreos-pool" repo from which all packages
in lockfiles are tagged for reproducible builds. This repo is shared
across all streams, including those on f31 and f32.

Thus, it makes no sense for composes to ever pick packages unconstrained
from the pool without being guided by a lockfile. Otherwise, one can
easily end up with e.g. f32 packages in an f31 compose.

Add a new `lockfile-repos` for this which is only used for fetching
lockfile packages and nothing else. For example, this will allow
`cosa fetch --update-lockfile` to Just Work as expected by only fetching
new packages from regular yum repos.
2020-04-19 09:17:17 -04:00
Colin Walters
0d57ab9117 ci: Actually run kola tests
Noticed in https://github.com/coreos/rpm-ostree/pull/2052#issuecomment-613694719
2020-04-18 13:52:34 -04:00
Jonathan Lebon
53456730bf compose: Add --ex-lockfile-strict
Today, lockfiles only restrict the NEVRA of specifc package names from
which libsolv can pick. But nothing stops libsolv from picking entirely
different packages which still satisfy the manifest requests.

This was mostly a theoretical issue in Fedora CoreOS, but became reality
with the addition of Fedora 32 packages in the pool. libsolv would
happily try to pick e.g. `libcurl-minimal` from f32 instead of sticking
with the f31 `libcurl` from the lockfiles:

https://github.com/coreos/fedora-coreos-streams/issues/75#issuecomment-610734584

(But more generally, see
https://github.com/coreos/fedora-coreos-tracker/issues/454).

Let's add a `--ex-lockfile-strict` mode, which in CI and production
pipeline build contexts will require that (1) *only* locked packages are
considered by libsolv, and (2) *all* locked packages were marked for
install.

One important thing to note here is that we don't short-circuit libsolv
and manually `hy_goal_install` lockfile packages. We want to make sure
the treefile is still canonical. Strict mode simply ensures that the
result agrees with the lockfile.

That said, even in developer contexts, we don't want the
`libcurl-minimal` issue that happened to be triggered. But we still want
to allow flexibility in adding and removing packages to make hacking
easier. I have some follow-up patches which will enable this.
2020-04-17 15:48:40 -04:00
Colin Walters
e41a8ab26f Add support for wrapping binaries (rpm, dracut, grubby)
We need to be friendlier to people who are transitioning from
"traditional" yum managed systems.  This patchset starts to lay
out the groundwork for supporting "intercepting" binaries that
are in the tree.

For backwards compatibility, this feature is disabled by default,
to enable it, one can add `cliwrap: true` to the manifest.

To start with for example, we wrap `/usr/bin/rpm` and cause it
to drop privileges.  This way it can't corrupt anything; we're
not just relying on the read-only bind mount.  For example nothing
will accidentally get written to `/var/lib/rpm`.

Now a tricky thing with this one is we *do* want it to write if
we're in an unlocked state.

There are various other examples of binaries we want to intercept,
among them:

 - `grubby` -> `rpm-ostree kargs`
 - `dracut` -> `rpm-ostree initramfs`
 - `yum` -> well...we'll talk about that later
2020-04-15 16:22:57 +02:00
Jonathan Lebon
357c527320 core: Use hy_query_run_set() for excludes
Instead of manually recreating the packageset ourselves.
2020-04-15 15:18:16 +02:00
Jonathan Lebon
af86fcd649 tests/compose: Go back to freezing FCOS commit
The garbage collection issue should be fixed now, and it's just nicer on
developers' cache to stay on the same commit. And again, it's a nice
sanity-check to know that we're always able to compose an older tree.
That said, we probably should still bump this from time to time.

While we're here, add some comments for making it easier to match `popd`
calls with the original `pushd`.
2020-04-15 15:18:16 +02:00
Jonathan Lebon
bca19d74e8 tests/compose: Don't use lockfiles by default
Otherwise, it muddles testing in `test-lockfile.sh` where we want to be
in full control of all the lockfiles fed to `rpm-ostree compose tree`.
2020-04-15 15:18:16 +02:00
Jonathan Lebon
e6986d85cd core: Factor out functions to enable/disable repos
Prep for future patch.
2020-04-15 15:18:16 +02:00
Jonathan Lebon
67662f10d0 app/compose: Rename lockfile variables
Minor cosmetic change; rename the variables so they match the name of
the options they represent.
2020-04-15 15:18:16 +02:00
dependabot-preview[bot]
d1a42777fe build(deps): bump structopt from 0.3.12 to 0.3.13 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.12 to 0.3.13.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 17:41:08 +02:00
dependabot-preview[bot]
9c9458aed1 build(deps): bump libdnf from a5e5f5a to 5339635
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `a5e5f5a` to `5339635`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](a5e5f5aad5...533963525a)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 17:13:59 +02:00
Colin Walters
770856d018 tests: Start converting some bits into kola ext framework
Start the ball rolling on converting some of our tests into
the coreos-assembler/kola framework:
d940420b78/mantle/kola/README-kola-ext.md

The nondestructive ones are easy.
2020-04-09 23:07:45 +02:00
dependabot-preview[bot]
6a0570baa9 build(deps): bump libdnf from 466752c to a5e5f5a
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `466752c` to `a5e5f5a`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](466752c71b...a5e5f5aad5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-09 16:16:14 +02:00