5096 Commits

Author SHA1 Message Date
Jonathan Lebon
788e171b7c docs: Add more details about 3-way merge
This came up a few times so let's go into more details in the docs.
2021-04-30 10:50:15 -04:00
Jonathan Lebon
89481ca4be
Merge pull request #2354 from cgwalters/fix-gh-action
ci: Fix GH action for rustfmt
2021-04-27 15:23:02 -04:00
Jonathan Lebon
60c14240ab
Merge pull request #2353 from cgwalters/uri-scheme-hardening
pull: Cleanly error out on unknown schemes
2021-04-27 14:09:10 -04:00
Colin Walters
0f3bccf640 pull: Cleanly error out on unknown schemes
Previous to this we'd trip an assertion `abort()` deep in the curl code if e.g.
a user did `ostree remote add foo htttp://...` etc.

Motivated by considering supporting "external remotes" where code outside
ostree does a pull, but we want to reuse the signing verification infrastructure.
2021-04-27 13:11:18 -04:00
Colin Walters
73a896e62c ci: Fix GH action for rustfmt
Since we now have a toplevel workspace, just use that.
2021-04-27 13:10:07 -04:00
Colin Walters
0fcf4a3f30
Merge pull request #2352 from dbnicholson/skip-summary-cache-envvar
tests: Test without a cache directory by default
2021-04-20 08:57:28 -04:00
Dan Nicholson
e660855796 tests: Test without a cache directory by default
Several tests generate summaries and then expect to use the generated
summary immediately. However, this can cause intermittent test failures
when they inadvertantly get a cached summary file. This typically
happens when the test is run on a filesystem that doesn't support user
extended attributes. In that case, the caching code can only use the
last modified time, which only has 1 second granularity. If tests don't
carefully manage the summary modification times or the repo cache then
they are likely subject to races in some test environments.

This introduces an environment variable `OSTREE_SKIP_CACHE` that
prevents the repo from using a cache directory. This is enabled by
default in tests and disabled for tests that are a explicitly trying to
test the caching behavior.

Fixes: #2313
Fixes: #2351
2021-04-19 11:09:44 -06:00
Colin Walters
2458df446f
Merge pull request #2350 from smcv/trap-err
libtest: On failure, make it clearer what has happened
2021-04-18 08:54:49 -04:00
Simon McVittie
9d48d39a4b libtest: On failure, make it clearer what has happened
If we fail as a result of `set -x`, It's often not completely obvious
which command failed or how. Use a trap on ERR to show the command that
failed, and its exit status.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-04-18 12:17:00 +01:00
Colin Walters
e4d42be31f
Merge pull request #2343 from cgwalters/cargo-workspace
build-sys: Add toplevel workspace Cargo.toml
2021-04-15 19:32:11 -04:00
Colin Walters
09c5578a15
Merge pull request #2346 from cgwalters/release-2021-2
Release 2021.2
2021-04-15 15:40:30 -04:00
Colin Walters
3595414c86 configure: post-release version bump 2021-04-15 13:02:48 -04:00
Colin Walters
6a72674ec6 Release 2021.2 v2021.2 2021-04-15 13:02:48 -04:00
Colin Walters
7310203ce9 tests/inst: Make nondestructive tests runnable as unit tests
Ideally in the future we change more of our unit tests to
support running installed; we've tried this in the past with
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

I'd like to pick that back up again.  This takes a step
towards that by having our Rust tests.

To make this even easier, add a `tests/run-installed`
which runs the installed tests (uninstalled, confusingly
but conveniently for now).
2021-04-15 12:33:34 -04:00
Colin Walters
46a0911c6d build-sys: Add toplevel workspace Cargo.toml
rust-analyzer is happier with this because it understands
the project structure out of the box.

We aren't actually again adding a dependency on Rust/cargo in the core,
this is only used to make `cargo build` work out of the box to build
the Rust test code.
2021-04-15 12:33:34 -04:00
Luca Bruno
36693f064c
Merge pull request #2336 from bgilbert/edit
docs: fix "Edit this page on GitHub" links
2021-04-13 12:14:52 +00:00
Jonathan Lebon
3991009c93
Merge pull request #2335 from cgwalters/write-regfile-api 2021-04-12 16:48:27 -04:00
Benjamin Gilbert
388764f1ed docs: fix "Edit this page on GitHub" links 2021-04-09 23:00:33 -04:00
Colin Walters
9b4bffc454 repo: Ensure we set the size for regfile inline
Need to clean up the internal APIs for this.
2021-04-09 22:29:55 +00:00
Colin Walters
2cc11b7808 tests: More tests for inline writing
I'm hitting a bug, add more tests.
2021-04-09 21:54:44 +00:00
Colin Walters
6f84aff0ae repo: Add ostree_repo_write_regfile
This API is push rather than pull, which makes it much more
suitable to use cases like parsing a tar file from external
code.

Now, we have a large mess in this area internally because
the original file writing code was pull based, but static
deltas hit the same problem of wanting a push API, so I added
this special `OstreeRepoBareContent` just for writing regular
files from a push API.

Eventually...I'd like to deprecate the pull based API,
and rework things so that for regular files the push API
is the default, and then `write_content_object()` would
be split up into archive/bare cases.

In this world the `ostree_repo_write_content()` API would
then need to hackily bridge pull to push and it'd be
less efficient.

Anyways for now due to this bifurcation, this API only
works on non-archive repositories, but that's fine for
now because that's what I want for the `ostree-ext-container`
bits.
2021-04-09 21:54:44 +00:00
Jonathan Lebon
020f6cb652
Merge pull request #2334 from cgwalters/write-symlink
repo: Add ostree_repo_write_symlink
2021-04-09 13:35:06 -04:00
Colin Walters
fce69cdf70 repo: Add ostree_repo_write_symlink
Continuation of the addition of `ostree_repo_write_regfile_inline()`.
This will be helpful for ostree-rs-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.
2021-04-08 21:10:00 +00:00
Colin Walters
9332955b5f
Merge pull request #2327 from cgwalters/writing-apis
repo: Add ostree_repo_write_regfile_inline
2021-04-08 17:09:11 -04:00
Colin Walters
84a7ae506b
Merge pull request #2333 from dbnicholson/travis-32bit
Add back a travis 32 bit build
2021-04-08 14:23:22 -04:00
Dan Nicholson
ed16443c82 travis: Add back a 32 bit i386 build
Although people are likely not deploying on 32 bit x86 anymore,
deploying on 32 bit armv7 is still often used. Add back an i386 build on
debian to try to catch 32 bit bugs in CI.
2021-04-08 11:49:19 -06:00
Dan Nicholson
d4147b7e35 travis: Correct ci_suite settings for buster
The install script no longer uses this anymore and maybe it should just
be removed, but in the meantime it should at least be correct.
2021-04-08 11:45:13 -06:00
Colin Walters
22b2adbb2f
Merge pull request #2332 from dbnicholson/ubuntu-ci
travis: Don't ask any debconf questions when installing packages
2021-04-08 12:58:01 -04:00
Dan Nicholson
2fc0e237d8 travis: Drop i386 Ubuntu target
Ubuntu dropped i386[1], so there's no sense in attempting the build
there. In 2021 I don't think it's worth the trouble to keep doing that,
but if desired Debian still supports it.

1. https://wiki.ubuntu.com/FocalFossa/ReleaseNotes#Upgrades_on_i386
2021-04-08 10:33:12 -06:00
Dan Nicholson
764116ef56 travis: Don't ask any debconf questions when installing packages
Currently the Ubuntu builds are stuck waiting for an answer on what
timezone to use. That could be fixed, but generally the way to do these
types of installs is to set the DEBIAN_FRONTEND environment variable to
`noninteractive` so that debconf just chooses a default. This is what
debootstrap does, for instance. I tested installing tzdata on a local
focal container this way and it just chooses `Etc/UTC` as the timezone.
2021-04-08 10:25:46 -06:00
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