Commit Graph

4388 Commits

Author SHA1 Message Date
Stefan Agner
77b27c07df Avoid race condition when building outside of source tree
When building outside of source tree it can happen that src/ostree/
does not exist (yet) when bison is called. This leads to an build
error like so:
  bison: src/ostree/parse-datetime.c: cannot open: No such file or directory

Make sure that src/ostree/ exists when parse-datetime.c is built.
2019-11-26 09:22:30 +01:00
OpenShift Merge Robot
1dff567f2c
Merge pull request #1976 from cgwalters/repo-finder-test
tests/repo-finder: Run realpath() on /tmp
2019-11-25 15:26:31 +01:00
Colin Walters
16bb294384 tests/repo-finder: Run realpath() on /tmp
This fixes running this test case inside
https://github.com/cgwalters/coretoolbox
2019-11-23 18:04:58 +00:00
OpenShift Merge Robot
7a7838b7a7
Merge pull request #1968 from ptomato/ostree-async-progress-copy-state
libostree: Add ostree_async_progress_copy_state()
2019-11-21 15:14:04 +01:00
Philip Chimento
54639c03ca libostree: Add ostree_async_progress_copy_state()
This allows copying the state from one OstreeAsyncProgress object to
another, atomically, without invoking the callback. This is needed in
libflatpak, in order to chain OstreeAsyncProgress objects so that you
can still receive progress updates when iterating a different
GMainContext than the one that the OstreeAsyncProgress object was
created under.

See https://github.com/flatpak/flatpak/pull/3211 for the application of
this API.
2019-11-20 12:24:26 -08:00
Philip Chimento
382ad59822 Bump version in symbols file
There were no new symbols in 2019.5 and this version didn't get bumped
when 2019.5 was released.
2019-11-20 11:18:36 -08:00
OpenShift Merge Robot
6ba5c57d59
Merge pull request #1909 from rfairley/rfairley-kargs-order-entries
lib/kernel-args: Store kernel args as key/value entries
2019-11-08 23:54:12 +01:00
OpenShift Merge Robot
eb05ace3ed
Merge pull request #1971 from akiernan/us-tests-dir
build: create tests directory for split builds
2019-11-08 17:08:15 +01:00
OpenShift Merge Robot
4a992caaad
Merge pull request #1972 from cgwalters/bump-libglnx-20191108
Bump libglnx
2019-11-08 16:26:47 +01:00
Colin Walters
1e0761849c Bump libglnx
This has a few fixes, mainly I want to get this in
as prep for fs-verity.

Update submodule: libglnx

```
Alex Kiernan (1):
      macros: Add TEMP_FAILURE_RETRY for musl

Alexander Larsson (1):
      Add glnx_open_anonymous_tmpfile_full() allowing you to specify the directory

Colin Walters (8):
      Merge branch 'shutil-rm-rf-errprefix' into 'master'
      Merge branch 'us-temp-failure-retry' into 'master'
      Merge branch 'anonymous-tmpfile-dir' into 'master'
      Merge branch 'meson-older-compilers' into 'master'
      fdio: Add glnx_tmpfile_reopen_rdonly()
      Merge branch 'reopen-rdonly' into 'master'
      build-sys: Add libglnx-testlib.c to Automake
      Merge branch 'testlib-automake' into 'master'

Jonathan Lebon (1):
      Merge branch 'uchar' into 'master'

Simon McVittie (5):
      missing: Remove unused <uchar.h>
      Run the fdio test in its own temporary directory
      meson: Define HAVE_DECL_FOO to 0 if foo isn't declared
      Make the Meson build work on older compilers
      CI: Target a Fedora stable release

Will Thompson (3):
      Add meson.build files
      Document using this as a Meson subproject
      Add GitLab CI

```
2019-11-08 13:36:23 +00:00
Alex Kiernan
f07838fa08 build: create tests directory for split builds
When `--disable-dependency-tracking` is in effect with separate build
directory, the tests directory isn't created as a result of the
dependency generation, which leads to a build race for the tests
directory being created and failures:

  Making all in .
  make[2]: Entering directory 'TOPDIR/build/tmp/work/riscv64-yoe-linux-musl/ostree/2019.5-r0/build'
  (echo '[Test]' > tests/test-local-pull-depth.sh.test.tmp; \
  echo 'Type=session' >> tests/test-local-pull-depth.sh.test.tmp; \
  echo 'Exec=env G_TEST_SRCDIR=/usr/libexec/installed-tests/libostree G_TEST_BUILDDIR=/usr/libexec/installed-tests/libostree /usr/libexec/installed-tests/libostree/test-local-pull-depth.sh' >> tests/test-local-pull-depth.sh.test.tmp; \
  mv tests/test-local-pull-depth.sh.test.tmp tests/test-local-pull-depth.sh.test)
  /bin/sh: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  /bin/sh: line 1: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  /bin/sh: line 2: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  mv: cannot stat 'tests/test-local-pull-depth.sh.test.tmp': No such file or directory
  make[2]: *** [Makefile:9282: tests/test-local-pull-depth.sh.test] Error 1

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-11-08 06:51:36 +00:00
Robert Fairley
aadc4db012 lib/kernel-args: Store kernel args as key/value entries
Define an `OstreeKernelArgsEntry` structure, which holds
both the key and the value. The kargs order array stores
entries for each key/value pair, instead of just the keys.
The hash table is used to locate entries, by storing
entries in a pointer array for each key. The same public
interface is preserved, while maintaining ordering
information of each key/value pair when
appending/replacing/deleting kargs.

Fixes: #1859
2019-11-07 23:39:10 -05:00
OpenShift Merge Robot
49513ccc1b
Merge pull request #1970 from cgwalters/keyfile-group-not-found
lib/keyfile: Treat "group not found" the same as "key not found"
2019-11-07 22:47:40 +01:00
Colin Walters
58980a717a lib/keyfile: Treat "group not found" the same as "key not found"
Prep for fsverity, where I want to create a new group
`[fsverity]` in the keyfile that has default values.  We should
treat the absence of a group the same as absence of a key
in these "with defaults" APIs.
2019-11-07 21:15:41 +00:00
OpenShift Merge Robot
cb3eff6cfa
Merge pull request #1969 from ricardosalveti/master
Makefile: declare ostree_boot_SCRIPTS and append values
2019-11-06 16:39:59 +01:00
Ricardo Salveti
de8e0765a4
Makefile: declare ostree_boot_SCRIPTS and append values
ostree_boot_SCRIPTS was being set on both Makefile-boot.am and
Makefile-switchroot.am, causing the first one to be replaced by the
other at the final Makefile, so declare as empty and append on both
places instead.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
2019-11-06 11:44:08 -03:00
OpenShift Merge Robot
44988e6a77
Merge pull request #1966 from akiernan/us-musl-tests
Fix tests with musl
2019-11-02 17:03:37 +01:00
OpenShift Merge Robot
03a65fc12f
Merge pull request #1965 from akiernan/us-lc-all-en-us
tests/core: Fallback to en_US.UTF-8 locale
2019-11-01 19:42:19 +01:00
Alex Kiernan
abf1a7392b tests: Avoid musl failure with cp -a
When copying the tree, using musl and GNU coreutils, something gets confused
when setting the ownership of symlinks and the copy fails with:

  cp: failed to preserve ownership for osdata-devel/bin: Not supported

Rework using tar to avoid the problem.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-11-01 05:05:53 +00:00
Alex Kiernan
3d48021fb0 tests/core: Assume C.UTF-8 if locale isn't found
When building with musl there's no locale command, also its default
locale is C.UTF-8, so just get C.UTF-8 if we can't find locale.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-11-01 05:05:53 +00:00
Alex Kiernan
fb519f0361 tests: Handle EPIPE failures when head terminates
When using musl, it appears that the default is line buffered output, so
when `head -1` reads from a pipe we have to handle the source end of the
pipe getting EPIPE.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-11-01 05:05:53 +00:00
Alex Kiernan
4d17cd917f tests/core: Fallback to en_US.UTF-8 locale
A number of tests expect explicit left/right single quotes in their
messages, which will never happen in the C locale. Change so we pick a
likely UTF-8 locale, or fail if we can't find one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-10-31 21:28:30 +00:00
OpenShift Merge Robot
d554cee2df
Merge pull request #1963 from cgwalters/release
Release 2019.5
2019-10-30 18:46:41 +01:00
Colin Walters
dc92b09efb Post-release version bump 2019-10-30 17:08:00 +00:00
Colin Walters
980ca07b03 Release 2019.5 2019-10-30 17:08:00 +00:00
OpenShift Merge Robot
632e4ebd60
Merge pull request #1962 from jlebon/pr/support-hmac
lib/deploy: Also install HMAC file into /boot
2019-10-30 14:20:08 +01:00
Jonathan Lebon
7ae8da08b9 lib/deploy: Also install HMAC file into /boot
To allow for FIPS mode, we need to also install the HMAC file from
`/usr/lib/modules` to `/boot` alongside the kernel image where the
`fips` dracut module will find it. For details, see:

https://github.com/coreos/fedora-coreos-tracker/issues/302

Note I didn't include the file in the boot checksum since it's itself a
checksum of the kernel, so we don't really gain much here other than
potentially causing an unnecessary bootcsum bump.
2019-10-29 16:45:29 -04:00
OpenShift Merge Robot
476f375cfc
Merge pull request #1953 from uajain/uajain/fix-memory-leak
async-progress: Plug memory leak while destroying GSource
2019-10-29 06:26:17 +01:00
OpenShift Merge Robot
ee3f3b4cdd
Merge pull request #1961 from jlebon/pr/refine-gsource
lib/pull: Tweak update_timeout logic again
2019-10-28 20:58:37 +01:00
Jonathan Lebon
74936f98d8 lib/pull: Tweak update_timeout logic again
I was hitting `SIGSEGV` when running `cosa build` and narrowed it down
to #1954. What's happening here is that because we're using the default
context, when we unref it in the out path, it may not actually destroy
the `GSource` if it (the context) is still ref'ed elsewhere. So then,
we'd still get events from it if subsequent operations iterated the
context.

This patch is mostly a revert of #1954, except that we still keep a ref
on the `GSource`. That way it is always safe to destroy it afterwards.
(And I've also added a comment to explain this better.)
2019-10-28 15:26:45 -04:00
Umang Jain
78c8c25d64 async-progress: Plug memory leak while destroying GSource
See https://gitlab.gnome.org/GNOME/glib/commit/71973c722
2019-10-25 20:59:15 +05:30
OpenShift Merge Robot
bd3f24e6c3
Merge pull request #1955 from cgwalters/revert-grub2-exit
Revert grub2 exit, add new grub2: Honor /boot/.grub2-bls-enabled
2019-10-25 16:07:25 +02:00
OpenShift Merge Robot
4b496264b8
Merge pull request #1956 from akiernan/us-test-export
tests/export: Guard with check for libarchive
2019-10-25 15:50:49 +02:00
Alex Kiernan
e314b31ec9 tests/export: Guard with check for libarchive
If we are built without libarchive support, this test fails:

  error: This version of ostree is not compiled with libarchive support
  ...
  ERROR: tests/test-export.sh - too few tests run (expected 5, got 0)
  ERROR: tests/test-export.sh - exited with status 1

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-10-24 19:08:59 +01:00
Colin Walters
650d6252af Revert "grub2: Exit gracefully if the configuration has BLS enabled"
This reverts commit 985a141002.
It turned out that some people have old bootloaders, and hence
get the "no entries" problem.  That's much, much much worse
than double entries.
2019-10-24 17:49:53 +00:00
OpenShift Merge Robot
69b604722d
Merge pull request #1954 from jlebon/pr/update-timeout
lib/pull: Avoid calling destroy on unref'ed GSource
2019-10-23 18:02:30 +02:00
OpenShift Merge Robot
53f9487c5e
Merge pull request #1952 from cgwalters/trivial-rename
build-sys: Rename internal conditionals for trivial-httpd
2019-10-23 17:53:27 +02:00
Jonathan Lebon
d4a186e80e lib/pull: Avoid calling destroy on unref'ed GSource
We're creating the timer source and then passing ownership to the
context, but because we didn't free the pointer, we would still call
`g_source_destroy` in the exit path. We'd do this right after doing
`unref` on the context too, which would have already destroyed and
unref'ed the source.

Drop that and just restrict the scope of that variable down to make
things more obvious.

Just noticed this after reviewing #1953.
2019-10-23 11:15:02 -04:00
Colin Walters
ac4e3ab3e6 build-sys: Cleanup handling for trivial-httpd-cmdline
This way it's clearer this bit is only about the CLI entrypoint
also living in `ostree trivial-httpd`, not the underlying
`ostree-trivial-httpd` binary that's separate now.

Delete the automake conditional for this, and make the manpage
conditional use `if USE_LIBSOUP` the same way the C build does.

Suggested-by: Jonathan Lebon <jonathan@jlebon.com>
2019-10-23 15:05:30 +00:00
OpenShift Merge Robot
f333ae74f4
Merge pull request #1950 from akiernan/us-revert-trivial-httpd
Revert trivial httpd changes (#1912)
2019-10-21 23:43:22 +02:00
Alex Kiernan
967ea66921 Revert "Always enable trivial-httpd for tests"
This reverts commit 82699a67db.
2019-10-19 22:20:27 +01:00
Alex Kiernan
8f0b225d60 Revert "Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD"
This reverts commit 83d44ac20a.
2019-10-19 22:20:25 +01:00
OpenShift Merge Robot
1645416aac
Merge pull request #1947 from cgwalters/more-scan-build-2
More scan build 2
2019-10-18 20:59:06 +02:00
OpenShift Merge Robot
7661f3e809
Merge pull request #1949 from dbnicholson/no-g-gnuc-function
repo: Stop using deprecated G_GNUC_FUNCTION
2019-10-18 19:56:14 +02:00
Dan Nicholson
4df90d4012 repo: Stop using deprecated G_GNUC_FUNCTION
In glib 2.62 this has been changed to emitting a warning. Use G_STRFUNC
instead, which has been available for a long time and is already used in
other places in ostree.
2019-10-18 11:10:44 -06:00
Colin Walters
fbed380483 lib/checksum-utils: Use g_memdup()
This is clearer and silences a scan-build warning.
2019-10-18 15:07:39 +00:00
Colin Walters
01a3a65525 tests: [scan-build] Initialize a variable
False positive.
2019-10-18 15:07:39 +00:00
Colin Walters
57bb06419a lib: Port variant-builder.c to new style
Seeing `scan-build` warning here, prep for fixing it.
2019-10-18 15:07:39 +00:00
Colin Walters
0a808ffe20 tests: Port keyfile test to new style
Just noticed in passing.
2019-10-18 15:07:39 +00:00
Colin Walters
25c5ae5d08 lib/pull: [scan-build] Silence a dead store warning
This one was actual duplicate code.
2019-10-18 15:07:39 +00:00