Commit Graph

5166 Commits

Author SHA1 Message Date
Dan Nicholson 4d5f333efc
Merge pull request #2331 from cgwalters/update-travis-ubuntu
travis: Bump Ubuntu versions
2021-04-08 09:44:12 -06:00
Colin Walters aff1d269bc travis: Bump Ubuntu versions
xenial is EOL soon, let's bump to the latest LTS and the latest.
2021-04-08 15:36:08 +00:00
Colin Walters 4e2a14eb0c repo: Add ostree_repo_write_regfile_inline
When working on ostree-ext and importing from tar, it's
quite inefficient and awkward for small files to end up creating
a whole `GInputStream` and `GFileInfo` and etc. for small files.

Plus the gtk-rs binding API to map from `impl Read` to Gio
https://docs.rs/gio/0.9.1/gio/struct.ReadInputStream.html
requires that the input stream is `Send` but the Rust `tar` API
isn't.

This is only 1/3 of the problem; we also need similar APIs
to directly create a symlink, and to stream large objects via
a push-based API.
2021-04-08 14:57:33 +00:00
Luca Bruno 6dca0e0e29
Merge pull request #2330 from cgwalters/silence-libarchive-warning
tests: Silence a gcc warning
2021-04-08 14:54:42 +00:00
Colin Walters 5d68a99a2f tests: Silence a gcc warning
We can't mix `goto` and `__attribute__((cleanup))`.
2021-04-08 14:45:28 +00:00
Luca Bruno 078f022cfe
Merge pull request #2326 from cgwalters/writing-api-prep
core: Drop unused error handling from object stream helper
2021-04-08 08:12:59 +00:00
Luca Bruno 9154f41fd4
Merge pull request #2324 from cgwalters/test-use-ex
Various patches for tests/inst
2021-04-08 08:10:05 +00:00
Dan Nicholson ff47c57790
Merge pull request #2323 from cgwalters/remove-experimental
build-sys: Remove --enable-experimental-api
2021-04-07 15:31:40 -06:00
Colin Walters dfaf314c42 core: Drop unused error handling from object stream helper
I was going to add some new API and I noticed that this function
never returns an error; presumably at one point it did, but
not anymore.  It simplifies the code flow noticeably
to remove that.
2021-04-07 20:01:07 +00:00
Colin Walters 1d0b704ba1
Merge pull request #2325 from dbnicholson/apidoc-gitignore
API doc gitignore cleanup
2021-04-07 15:50:30 -04:00
Dan Nicholson d05e7ba2e2 Ensure consistent apidoc .gitignore
If you don't configure with --enable-gtk-doc, these won't be included in
the generated .gitignore. If you later configure with --enable-gtk-doc
in the same checkout, they'll show up as untracked files. Include them
in GITIGNOREFILES to ensure they're always added regardless of configure
options.
2021-04-07 13:37:53 -06:00
Dan Nicholson 36da85ecbe Remove apidoc .gitignore from version control
Like the top level .gitignore, there's no reason to track this if it's
being generated automatically. It only produces spurious diff changes
that you almost certainly don't want.
2021-04-07 13:36:01 -06:00
Colin Walters a90d59cf2d build-sys: Remove --enable-experimental-api
It was added for the collections bits, but we made that stable.
It's now just cruft and we're very unlikely to reuse the infrastructure
again.

Motivated by a unit test failure when running from a tarball:
https://github.com/ostreedev/ostree/issues/2313
2021-04-07 19:19:05 +00:00
Colin Walters 4d9e6de46b tests/inst: Update tokio, hyper and nix 2021-04-07 18:00:57 +00:00
Colin Walters 2628637a78 tests/inst: Update rpm-ostree client 2021-04-07 18:00:57 +00:00
Colin Walters 642dcd10ef tests/inst: Update ostree crate 2021-04-07 18:00:57 +00:00
Colin Walters 35d4e657e7 tests: Drop openat override
No longer needed.
2021-04-07 18:00:57 +00:00
Colin Walters b5c21defe9 core: Fix lgtm.com warning about always true `if (bits > 0)`
Since we're not going to change this, let's constant fold the logic
here.
2021-04-07 11:48:35 -04:00
Colin Walters 80e4f27a59 manual-tests: Fix unused variables
lgtm.com harshly makes our JS grade "D" due to these unused
variables.
2021-04-07 11:48:35 -04:00
Colin Walters ac38372f49 build-sys: Include all mkinitcpio bits
It's still so tempting to switch to `git archive` to ship sources.

Closes: https://github.com/ostreedev/ostree/issues/2312
2021-04-06 08:58:59 -04:00
Stefan Berger 81d3017463 rofiles-fuse: Enable support for setting and getting xattrs
Enable support for setting and getting xattrs. Allow modifications
to xattrs only on user.ima xattr.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Co-authored-by: Colin Walters <walters@verbum.org>
2021-04-05 17:01:58 -04:00
Colin Walters 57270db9a1 repo: Ensure load_variant_if_exists sets NULL value
Spotted by @jlebon - we usually expect callers to zero, but
let's be explicit.
2021-04-03 16:44:39 -04:00
Colin Walters 0c0e58e06c repo: Fix load_variant_if_exists to return a nullable value
Another introspection fix I hit when trying to use this in Rust.
2021-04-03 16:44:39 -04:00
Colin Walters 6d0bb10bf0 cci: Update for buildroot changes
See latest in https://github.com/coreos/fedora-coreos-tracker/blob/master/docs/ci-and-builds.md
2021-03-31 15:11:34 -04:00
Colin Walters cb0fd2bf93 tests/pull-test: Use mv -f in a few cases
For some reason I'm hitting this locally because some files are mode `0`.
Which is clearly a different bug but anyways we don't want to prompt.
2021-03-31 15:11:34 -04:00
Colin Walters 7170cf9efd installdeps: Drop PyYAML
Doesn't exist anymore in f33 and we don't depend on python2 anymore.
2021-03-31 15:11:34 -04:00
Felix Krull 47bf29fed3 lib: fix some version tags 2021-03-26 15:59:07 -04:00
Jonathan Lebon 96875b37e5
Merge pull request #2315 from cgwalters/add-lgtm-dot-com
.lgtm.yml: Add package deps
2021-03-26 14:08:06 -04:00
Colin Walters ca2ea1455f .lgtm.yml: Add package deps
I was recently looking at systemd's CI and came across this.
AFAICS it's a proprietary analysis but it looks useful.

We still have `clang-analyzer` for example for FOSS analysis.
2021-03-26 17:34:09 +00:00
Colin Walters dafa404606 configure: post-release version bump 2021-03-23 15:23:55 -04:00
Colin Walters e9e4b91120 Release 2021.1 2021-03-23 15:23:55 -04:00
Colin Walters 269ede1015
Merge pull request #2309 from jlebon/pr/prefix-pull
lib/pull: Add some error-prefixing in dirtree scanning
2021-03-22 18:58:39 -04:00
Jonathan Lebon 36a543ceb1 lib/pull: Add some error-prefixing in dirtree scanning
I think these are the paths involved in the error message at
https://github.com/coreos/rpm-ostree/issues/2250.
2021-03-22 16:32:11 -04:00
Jonathan Lebon a16be7df6e
Merge pull request #2306 from cgwalters/drop-core-rust 2021-03-22 09:59:42 -04:00
Colin Walters b69a4180b8 tests/inst: Patch to use my PR for openat
Fixes the build.
2021-03-19 21:45:54 +00:00
Colin Walters 61184163ea Drop minimal rust/ library
This was my first experiment with using Rust in this way; I gained
a lot of knowledge from it.  But, we don't really gain
anything from the code as it is today - while it is "bit fiddling"
code, the C code is well tested.

We have a lot of compile-time options, and trimming them will be
helpful.

We've also gotten pushback on hard requiring Rust client side.

Instead, what I'd like to do is hopefully soon create an `ostree-system`
crate that uses the existing `ostree` library and can contain
code drained from the rpm-ostree Rust and used by other projects perhaps.

So the goal here is really more Rust, but we need to focus our
efforts on where it's most valuable.
2021-03-18 21:54:52 +00:00
Colin Walters 9c29141c04
Merge pull request #2298 from KloudJack/remove-grub2-suffix
Add configure option for unsuffixed GRUB2 commands linux/initrd
2021-03-18 17:46:18 -04:00
Kenneth J. Miller cfe313afae Add configure option for unsuffixed GRUB2 commands
GRUB starting with version 2.02 permits the use of the linux and
initrd commands for both EFI boot in *-efi installations, as
well as 32-bit BIOS boot in i386-pc installations.

This makes the use of the -16 and -efi suffixes for BIOS and EFI
boot obsolete on systems with a modern GRUB installation.

The --with-modern-grub configure flag makes ostree use the
unsuffixed linux/initrd commands when generating a GRUB
configuration, while defaulting to the previous behaviour for
users not wanted this option.
2021-03-18 14:31:28 +01:00
Colin Walters 407477f191
Merge pull request #2301 from cgwalters/api-require-booted
sysroot: Add _require_booted_deployment() API
2021-03-18 08:46:35 -04:00
Colin Walters 1b28e6041c sysroot: Add _require_booted_deployment() API
This is a common pattern that is replicated both in our code
and in rpm-ostree a lot.  Let's add a canonical API.
2021-03-17 19:55:56 +00:00
Colin Walters 236a5ca9bf
Merge pull request #2303 from cgwalters/gh-actions
ci: Add a Github Action for Rust for tests/inst
2021-03-17 15:49:05 -04:00
Colin Walters 26166bb8e3 ci: Add a Github Action for Rust for tests/inst
Let's dip our toes in GH Actions (specifically aiming to migrate
away from Travis).
2021-03-17 19:37:21 +00:00
Colin Walters c52a2ff52e tests/inst: cargo fmt 2021-03-17 18:45:17 +00:00
Colin Walters 92e2bc397b
Merge pull request #2302 from cgwalters/tests-inst-clippy
tests/inst: Fix lots of `cargo clippy` warnings
2021-03-17 14:43:10 -04:00
Colin Walters d11dd7a37b tests/inst: Fix lots of `cargo clippy` warnings
Prep for doing this in CI.
2021-03-17 17:13:52 +00:00
OpenShift Merge Robot d522f261db
Merge pull request #2296 from cgwalters/commit-os
Add an API+CLI to inject metadata for bootable OSTree commits
2021-03-12 17:22:45 -05:00
Colin Walters 857587615d Add an API+CLI to inject metadata for bootable OSTree commits
I was doing some rpm-ostree work and I wanted to compare two
OSTree commits to see if the kernel has changed.  I think
this should be a lot more natural.

Add `ostree commit --bootable` which calls into a new generic
library API `ostree_commit_metadata_for_bootable()` that
discovers the kernel version and injects it as an `ostree.linux`
metadata key.  And for extra clarity, add an `ostree.bootable`
key.

It's interesting because the "core" OSTree layer is all about
generic files, but this is adding special APIs around bootable
OSTree commits (as opposed to e.g. flatpak as well as
things like rpm-ostree's pkgcache refs).

Eventually, I'd like to ensure everyone is using this and
hard require this metadata key for the `ostree admin deploy`
flow - mainly to prevent accidents.
2021-03-12 19:01:42 +00:00
OpenShift Merge Robot 31e19935b5
Merge pull request #2293 from ostreedev/fix-file-uri-decoding
Fix translation of file:// URIs into paths
2021-03-10 21:14:51 +01:00
Phaedrus Leeds 19577522f8 Fix translation of file:// URIs into paths
Currently if a file path contains a special character such as '\', and
that character is encoded into a file:// URI that is passed to
ostree_repo_pull_with_options(), the percent encoding will remain in the
path passed to g_file_new() (in the case of backslash %5C) and the pull
will then fail with a file not found error. This is an important edge
case to handle because by default on many Linux distributions a
filesystem with no label is mounted at a path based on its UUID, and
this is then passed to systemd-escape by Flatpak (when
--enable-auto-sideloading was used at compile time) to create a symbolic
link such as this which contains backslashes:

$ ls -l /run/flatpak/sideload-repos/
total 0
lrwxrwxrwx 1 mwleeds mwleeds 55 Mar  9 14:21
'automount-run-media-mwleeds-29419e8f\x2dc680\x2d4e95\x2d9a31\x2d2cc907d421cb'
-> /run/media/mwleeds/29419e8f-c680-4e95-9a31-2cc907d421cb

And Flatpak then passes libostree a file:// URI containing that path, to
implement sideloading (pulling content from the USB drive).

This results in an error like:

Error: While pulling app/org.videolan.VLC/x86_64/stable from remote
flathub:
/run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo:
opendir(/run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo):
No such file or directory

This patch avoids such errors by using g_file_new_for_uri() instead of
g_file_new_for_path(), so that GLib handles the %-decoding for us.

Bug report by user:
https://community.endlessos.com/t/can-not-install-vlc-from-usb-drive-3-9-3/16353
2021-03-10 10:11:06 -08:00
Phaedrus Leeds 2709da4360 pull: Fix some whitespace and a comment 2021-03-10 10:01:04 -08:00