Commit Graph

2792 Commits

Author SHA1 Message Date
Jonathan Lebon
e2a4327477 build: Bump minimum glib2 version to 2.56
That's the latest available in (f28, el8). Prep for using some new APIs
without tripping compiler warnings.

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:04 +00:00
Jonathan Lebon
247214c27e libpriv/kargs: Copy libostree patch to support KEYWORD kargs
This is essentially a copy of
https://github.com/ostreedev/ostree/pull/1785 to our private copy of the
kargs API. Should really dedupe those...

The really confusing part though was that that patch was intended to fix
the `rpm-ostree kargs --append EMPTYKEY=` case (#1706), yet the
`rpmostree kargs --append KEYWORD` case (#1779) wasn't also fixed, even
though that same ostree patch clearly fixes and tests for that too.

To make a long story short, we were passing buggy kargs to ostree, which
before that patch, had itself buggy kargs parsing which conveniently
fixed back the kargs we passed for the `KEYWORD` case.

Closes: #1779

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:04 +00:00
Jonathan Lebon
28c3a4cd07 core: Don't exclude modular packages
For now, we don't natively support modules. But we still want to be able
to install modular packages if the repos are enabled, but libdnf
automatically filters them out. So for now, let's tell libdnf that we do
want to be able to see them.

Related: #1435

Closes: #1797
Approved by: cgwalters
2019-03-22 23:50:44 +00:00
Kalev Lember
891f5b75be daemon: Add new ModifyYumRepo DBus API
This allows clients such as gnome-software to enable and disable
yum repositories.

The API is generic, but for now we only allow changing the 'enabled'
key. If needed, it's easy to allow changing other settings in the
future. See the discussion in the PR for the reasoning.

Closes: #1771

Closes: #1780
Approved by: cgwalters
2019-03-21 12:45:51 +00:00
Jonathan Lebon
b324ee4807 app/status: Always print pending deployment diff
Right now we only print a diff of the pending deployment if we have a
cached update (which only happens if user just did an `upgrade`
operation). But really, we can just always print this for the pending
deployment regardless of whether there's a cached update calculated.

This is prep for changing chained operations to only show the diff
between the previous pending deployment to the new pending deployment.
With this patch, the full diff from booted to pending will always be
available through `status` (and `db diff` too though it's not as nice).

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
6ca9926a6a libpriv: Teach diff printer different formats
I want to reuse the same function to print the same thing in three
slightly different ways. Let's teach it to take a `format` enum and
plumb that through.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
85bfe18701 app/libbuiltin: Tweak print_treepkg_diff logic
We can check for the trivial path and return early to avoid an
indentation. Also use `ostree_deployment_equal()` rather than directly
comparing pointers for good practice.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
36fabb5cc7 app: Drop rpmostree_print_treepkg_diff()
It's only used in one place right next to the function definition. Let's
just inline it.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
6c56bfd11c app: Factor out function to generate diff summary
Will be used in an upcoming patch.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Colin Walters
31569c55bc compose: Add treefile as arg to postprocess
Prep for sysusers.

Closes: #1790
Approved by: jlebon
2019-03-19 17:47:06 +00:00
Colin Walters
19e462821f postprocess: Handle etc vs usr/etc
Future work on sysusers wants to execute code in a situation
where we've already done the symlink, so be compatible here.

Closes: #1790
Approved by: jlebon
2019-03-19 17:47:06 +00:00
Jonathan Lebon
ad1451fac2 Rebase to latest libdnf
This brings us back in sync with the latest libdnf git master. This
required a bunch of work both on the libdnf and rpm-ostree side to get
working. See e.g.
https://github.com/rpm-software-management/libdnf/issues/645.

A few things to adapt to:

- soname bump to `libdnf.so.2`
- `DnfAdvisory` is no longer a `GObject` (annoyingly it's not replaced
  by something we can keep a ref on, so this requires some hacks to
  steal from the `GPtrArray` -- could enhance libdnf for this later)
- disable SWDB history writing
- use new reldep public API
- update for latest `hy_subject_get_best_selector()` API

This now unlocks the possibility to add support for modules. (One can
see hints of this in the diff by the fact that `libdnf` links to
`libmodulemd1`.)

Update submodule: libdnf

Closes: #1404
Approved by: cgwalters
2019-03-19 14:29:15 +00:00
Jonathan Lebon
44110377c6 vmcheck/test-rojig-client.sh: Don't check full rojig NEVRA
Let's make this test work across major version rebases of the FAHC
treecompose job by not hardcoding a specific `%{dist}` here. It's strong
enough to check that the `deploy` operation has the expected previous
version.

I did bump the FAHC buildroot so that next version of the rojig RPM will
be f29, but I don't want to wait until the job has composed at least two
of them.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
86c811af8d importer: Filter out /var/lib/rpm from rpm
Otherwise we can get a repeat of #290 in the unprivileged container
assembly path.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
6cdcd474b6 Makefile-libs.am: Work around g-ir-scanner issues with clang
Right now there's an issue in Fedora with `g-ir-scanner` picking up
`-fstack-clash-protection` from the `sysconfig` Python module and
passing it to `clang`, which doesn't understand this flag yet.

Just work around this by (1) not even building GIR bindings for our
bundled libdnf since there's no need, and (2) overridding the compiler
used by `g-ir-scanner` so it's always `gcc`.

See: https://github.com/projectatomic/rpm-ostree/pull/1787#issuecomment-473971585

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
078268d4d3 libpriv: Add more error-prefixing in sanity checks
Currently tracing through an error around that area, and this would've
helped.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
da3b33ee7b ci: Fix ex-container LOGDIR
Let's output to `ex-container-logs`, which matches the directory we
currently have specified in `artifacts:` so that we actually get test
logs uploaded.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
a4678eb67e app: Drop unused variables
Looks like `clang` got smarter in f29. It's now finding more unused
variables than before. \o/

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
95d1c6ea29 ci: Bump minimum Rust version to v1.31.0
Now that we no longer support el7, let's peg our minimum `rustc` version
to the latest Rust module available in el8 instead. That's 1.31.0 right
now.

And drop use of deprecated `trim_left_matches()` (it was deprecated in
1.33.0, which is currently used in the other testsuites that pull
`rustc` from the Fedora repos; we might want to eventually just use the
`RUST_MIN_VERSION` in all the testsuites to not get caught in the middle
like this again).

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
45b6186be0 tests/check: Tweak /usr/bin/sh path
Looks like the auto-requires got updated in f29 or something.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
d34f24581a ci: Fix repo editing in installdeps.sh
- Use `IFS=` so that we don't drop leading whitespace when reading in,
  which can be used to specify multiple baseurls on multiple lines.
- Use `-r` as good practice so we don't try to interpret anything.
- Use `echo "$line"` so that we don't drop leading whitespace when
  writing out.

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
d0fdd9ac1d ci: Drop c7 support for installdeps.sh
Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
4ae3b174f5 ci: Bump to f29
Better late than never!

Closes: #1787
Approved by: cgwalters
2019-03-19 12:19:38 +00:00
Jonathan Lebon
e90d0ed98e build: Move completions to /usr/share
rdgo is choking on this right now because, even though we added
`/usr/share/bash-completion` to the list of dirs to check in the spec
file[1], we don't have `bash-completion` installed in the buildroot, so
the `completionsdir` pkgconfig var isn't defined and we end up
defaulting to `/etc/bash_completion.d`.

el7's bash (not that it matters much now after #1785) is indeed new
enough to know that location. See also
https://github.com/ostreedev/ostree/pull/1083.

[1] https://src.fedoraproject.org/rpms/rpm-ostree/pull-request/30

Closes: #1786
Approved by: rfairley
2019-03-14 21:24:30 +00:00
Jonathan Lebon
bdf12cced6 ci: Stop testing on CentOS 7
Let's stop actively testing on CentOS 7 from this point on. The latest
stable version v2019.2 will be the last fully supported release on this
platform. We may backport patches there if needed.

This will allow us to shed a lot of legacy and dual-paths code that
rendered the code more complex. It'll also reduce friction on new
initiatives like unified core by default and sysusers.

Closes: #1785
Approved by: cgwalters
2019-03-13 21:16:00 +00:00
Jonathan Lebon
6e054517d3 app: Alias remove -> uninstall
For better finger compatibility with `dnf`.

Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Jonathan Lebon
57fa460837 core: Add all packages to the sack upfront
Don't go back and forth between adding packages to the sack and marking
them for install. Do the former upfront, and then do the latter.

This allows us to work around:
https://github.com/rpm-software-management/libdnf/issues/700

Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Jonathan Lebon
e2ed1036f1 core: Fix leak of a DnfPackage
We weren't freeing the `DnfPackage` that `dnf_sack_add_cmdline_package`
returned. But really, once it's marked for install, we don't need it.

Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Jonathan Lebon
3a616bd318 daemon/deployment-utils: Specify array element type
Otherwise, glib will complain if the array is empty since it can't infer
the type of the item.

While we're here, just `git grep` all instances of
`G_VARIANT_TYPE_ARRAY` and make sure they use a fully-specified format.
I added a test to sanity check that glib is happy to synthesize empty
`GVariant` arrays from `g_variant_builder()` if the format string is
specified.

Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Jonathan Lebon
cc1ac0eabe upgrader: Add missing check for error
Not that it matters much since that function can't fail right now
(though it does have a precondition check). But this just matches what
we do elsewhere and prepares us in the event the function becomes
fallible.

Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Jonathan Lebon
ed3294fa98 app/status: Fix spacing in function call
Closes: #1783
Approved by: cgwalters
2019-03-13 02:46:09 +00:00
Colin Walters
adff1e98b6 compose: Add boot-location: modules
And this (for now at least) completes the epic journey of the
"where's the kernel"?  With this it's found solely in
`/usr/lib/modules/$kver`.

There are a few reasons to do this; most prominent is that
it avoids duplicating the content as the locations may have
different SELinux labels.

Closes: #1773
Approved by: jlebon
2019-03-08 22:49:40 +00:00
Colin Walters
f37426f1ad compose: Remove support for boot-location: both
I'd like to add a new `boot-location: modules`.  In prep
for that, let's remove the legacy `both` which drops into
`/boot`.

The libostree support for handling `/usr/lib/ostree-boot` has
existed for over 4 years:

```
commit 37a059925f6b96d30190b65bee6bdde0ae1c6915
Commit:     Colin Walters <walters@verbum.org>
CommitDate: Sun Nov 30 23:14:05 2014 -0500

    deploy: Ensure that we can deploy using only /usr/lib/ostree-boot

```

I think we assume now that no one is now making *new* treecomposes and needs
a newer rpm-ostree and that they expect people to be able to use as an
upgrade target from a libostree that predates that.

Closes: #1773
Approved by: jlebon
2019-03-08 22:49:40 +00:00
Jonathan Lebon
6b928e8f0e ci: Build the whole tree, not just rust bits
Otherwise, we're not testing everything. E.g. the cbindgen bits.

Closes: #1778
Approved by: cgwalters
2019-03-07 21:57:08 +00:00
Jonathan Lebon
e49f625b61 rust: Freeze rand crate to v0.6.1
The recent dep bump caused rand to jump to v0.6.5, which pulled in
`fuchsia-cprng`. Sadly, the cargo version we're frozen on chokes on it
because its manifest makes use of the `edition` keyword, which wasn't
stabilized yet.

Let's just freeze the problematic crate for now. We should be able to
bump our Rust toolchain soon-ish.

(Note this commit also does some other minor crate bumps as a result of
regenerating the lockfile to prune away `fuchsia-cprng`.)

Closes: #1777

Closes: #1778
Approved by: cgwalters
2019-03-07 21:57:08 +00:00
Colin Walters
b63f3720b8 ci: Add a f29 FCOS build
Let's start doing testing using coreos-assembler + Fedora CoreOS.

Closes: #1774
Approved by: jlebon
2019-03-07 19:16:12 +00:00
Jonathan Lebon
b851d9dad2 build: Hook up bash completions
Follow-up to #1499. This is mostly based on
https://github.com/ostreedev/ostree/pull/1077.

Closes: #1772
Approved by: rfairley
2019-03-07 00:47:39 +00:00
Jonathan Lebon
8b1bc9894e rust: Pass through rustfmt
Closes: #1749
Approved by: cgwalters
2019-03-02 19:20:21 +00:00
Jonathan Lebon
1fe66e91d0 rust/treefile: Support dash convention for all options
Now that we support YAML, it's a gotcha/eyesore that some of our options
use underscores rather than dashes. Let's be nice and switch those few
options over, while of course still supporting the previous name.

Co-authored-by: Colin Walters <walters@verbum.org>

Closes: #1749
Approved by: cgwalters
2019-03-02 19:20:21 +00:00
Jonathan Lebon
0ebfb6e4ff rust/treefile: Don't hardcode list of architectures
Just try to match the current architecture against any
`packages-${arch}` keys in the treefile.

Closes: #1749
Approved by: cgwalters
2019-03-02 19:20:21 +00:00
Jonathan Lebon
24335bdf1a rust/treefile: Use HashMap to collect extra fields
Instead of the `Strict` and `Permissive` variants of
`TreeComposeConfig`, just collapse all the excess fields in a new
`extra` member and check for any keys there in the strict YAML path.
This will also allow us to drop the hardcoded list of architectures in
the next patch.

Closes: #1749
Approved by: cgwalters
2019-03-02 19:20:21 +00:00
Chris Weeks
90790cabaf Add support for bash completion
This stand-alone file doesn't impact any part of the build process and
is designed to be a convenience for end-users.

Closes: #1499
Approved by: jlebon
2019-03-01 21:36:39 +00:00
Jonathan Lebon
82594b5052 rust: Bump dependencies
Notably, the latest indicatif compiles fine again. This is now the
latest of everything, except the glib stack:

```
$ cargo outdated -R
Name      Project  Compat  Latest  Kind    Platform
----      -------  ------  ------  ----    --------
gio-sys   0.7.0    ---     0.8.0   Normal  ---
glib      0.6.1    ---     0.7.1   Normal  ---
glib-sys  0.7.0    ---     0.8.0   Normal  ---
```

because it requires a newer rustc than we're currently locked at.

Closes: #1770
Approved by: cgwalters
2019-03-01 15:51:07 +00:00
Jonathan Lebon
27e4c353b2 daemon/sysroot: Fix ActiveTransaction property
Minor regression from #1755. Noticed this after seeing the following in
the journal:

```
Mar 01 02:41:03 f29-ros rpm-ostree[3931]: Failed to GetConnectionUnixUser for client /org/projectatomic/rpmostree1/fedora_atomic: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get UID of name '/org/projectatomic/rpmostree1/fedora_atomic': no such name
Mar 01 02:41:03 f29-ros rpm-ostree[3931]: Failed to GetConnectionUnixProcessID for client /org/projectatomic/rpmostree1/fedora_atomic: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get PID of name '/org/projectatomic/rpmostree1/fedora_atomic': no such name
```

Closes: #1769
Approved by: cgwalters
2019-03-01 15:50:33 +00:00
Colin Walters
5c69bcb4fe compose: Make initramfs.img world-readable
There's nothing secret there, it's server side generated.
Ref: https://github.com/coreos/coreos-assembler/pull/372#issuecomment-467620937

Closes: #1767
Approved by: jlebon
2019-02-27 14:33:05 +00:00
Jonathan Lebon
2be532c9e9 rust/treefile: Add basearch key
Add a `basearch` key to the manifest. This can be used at compose time
to assert the architecture the compose is running on. Though my
motivation is for the common case where it gets omitted from the input
manifest and gets automatically added by rpm-ostree into
`/usr/share/rpm-ostree/treefile.json` for introspection on the client.

(The crucial part here is that the treefile created by rpm-ostree
remains deserializable into a `TreeComposeConfig`).

Closes: https://github.com/coreos/fedora-coreos-tracker/issues/154

Closes: #1766
Approved by: cgwalters
2019-02-27 01:05:43 +00:00
Jonathan Lebon
6a57db1c36 rust/treefile: Rename arch -> basearch
We're really using this variable to substitute `${basearch}` and find
basearch-specific packages. Let's rename the variable to make that more
obvious.

Closes: #1766
Approved by: cgwalters
2019-02-27 01:05:43 +00:00
Jonathan Lebon
75f415f09f tests/libtest.sh: Lift assert_jq from libvm.sh
We already had this logic, but it was in `libvm.sh`. Prep for using it
elsewhere.

Closes: #1766
Approved by: cgwalters
2019-02-27 01:05:43 +00:00
Colin Walters
3f722b5005 rust: Bump crate dependencies
Prep for adding other crate deps for sysusers, multiprocessing work.

Closes: #1765
Approved by: jlebon
2019-02-26 16:42:42 +00:00
Colin Walters
07d621bac9 compose: Pass treefile directly to core
A lot of history here.  Long before the YAML treefiles, I was
dissatisfied with the JSON treefile syntax, and also wanted
to create a format that could be used by the (still experimental)
`container` builtin, and chose to use GKeyFile.

I don't think that really worked out; the Rust YAML is just way
better.

In the future we probably want to more cleanly split off the
"compose only" aspects of the treefile.  But for now, it's rather
tedious to pass down flags from the treefile into the keyfile/gvariant.
Let's just give direct access to the treefile to the core.

Prep for sysusers.

Closes: #1764
Approved by: jlebon
2019-02-25 20:56:44 +00:00