- Jun 01, 2020
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Now that G_TEST_SRCDIR is what Autotools would call "${top_srcdir}/tests/", we need to look one level up for the root of the source tree. Fixes: 09925ab2 "build: Split into subdirectories" Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 21, 2020
-
-
Simon McVittie authored
At the moment it writes to the current working directory, and we invoke it via `bwrap ... --chdir DIRECTORY`; but we want to make it possible to use this code from inside a Flatpak runtime (at least in the case where we're using the host system's glibc), which means we won't be allowed to run bwrap and must do this some other way. Rather than using `env --chdir=...` (which isn't supported in scout anyway), let's teach this script to output to an explicitly specified directory. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Previously we were missing coverage for this. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Now that it's in a static library, we can have some test coverage. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Unlike Autotools, in Meson this doesn't have the problems caused by recursive make: ninja always has an overview of the whole source tree. With this change, test-locale-gen.sh needs minor adjustments, because G_TEST_SRCDIR, G_TEST_BUILDDIR now point into tests/ instead of the root directory of the source tree. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Apr 03, 2020
-
-
Simon McVittie authored
In Steam Runtime 1 'scout' and Steam Runtime 1½ 'heavy' SDK environments, we have a backport of python3.5 in order to run Meson, and meson.build automatically selects it if available. In newer environments like a developer's laptop, we expect to have a strictly newer Python version, like the python3.7 in Debian 10. One notable exception is that we only require Python 3.4+ for scripts that are meant to run on test machines or on non-developer Steam users' systems, which right now just means the test UI. This version was chosen because SteamOS 2 'brewmaster' and Ubuntu 14.04 'trusty' both have 3.4. Ubuntu 12.04 'precise' only has 3.2, but the Steam client doesn't actually work on 12.04 any more for orthogonal reasons. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Feb 26, 2020
-
-
Simon McVittie authored
This will let us duplicate a runtime and edit it in-place. The major appeal of doing this is that it's something we can do in a Flatpak environment, where recursively invoking bubblewrap isn't allowed. It also seems like it might yield a more reliable way to overwrite parts of the runtime with their host-system equivalents than the tricks we currently use with files and directories mounted over their runtime counterparts. The major down side is that after we've done this, we have a copy of the runtime, which we need to garbage-collect and clean up eventually. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 14, 2019
-
-
Simon McVittie authored
We can use this in the SteamLinuxRuntime depot to deploy and garbage-collect runtimes stored in tarballs. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 12, 2019
-
-
Simon McVittie authored
This doesn't really matter, since it only happens when our process is about to exit anyway, but it makes it easier to use AddressSanitizer and similar tools. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 11, 2019
-
-
Simon McVittie authored
This doesn't really matter, since it only happens when our process is about to exit anyway, but it makes it easier to use AddressSanitizer and similar tools. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Otherwise, clang diagnoses it as unused. It is - deliberately - only allocated and cleaned up, with no other use. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Sep 12, 2019
-
-
Simon McVittie authored
This avoids relying on the host system (if using the host system) or the container (otherwise) having both its configured locales and the frequently-hard-coded en_US.UTF-8. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 22, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 16, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 15, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 09, 2019
-
-
Simon McVittie authored
This is a step towards potentially building pressure-vessel releases as packages in the scout environment, so that tagged releases can go through the same latest/beta/stable release pipeline as everything else. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 24, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 02, 2019
-
-
Simon McVittie authored
The temporary directory will be deleted on success, but will remain intact on failure. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Mar 28, 2019
-
-
Will Thompson authored
-
- Oct 16, 2017
-
-
Colin Walters authored
Port to `glnx_autofd` tree wide, and add one missed `glnx_close_fd()` use in the tmpfile code.
-
- Oct 11, 2017
-
-
Jonathan Lebon authored
-
- Oct 06, 2017
-
-
Jonathan Lebon authored
Often, the caller doesn't actually care about the details of the stat struct itself, but just whether the entry exists or not. It does work to just pass `NULL` directly to glibc in a quick test, but given that the argument is tagged as `__nonnull` and that the documentation does not explicitly specify this is supported, let's do this safely.
-
- Sep 26, 2017
-
-
Philip Withnall authored
If the directory for @dfd is deleted after being opened, glnx_shutil_mkdir_p_at() would fail with an assertion failure. Fix that, and make it return an ENOENT error instead. Add a unit test. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Reviewed-by:
Colin Walters <walters@verbum.org> Reviewed-by:
Jonathan Lebon <jlebon@redhat.com> https://github.com/ostreedev/ostree/issues/1215
-
- Sep 25, 2017
-
-
Colin Walters authored
Particularly if `AT_FDCWD` is used, we need to open in the target dir, otherwise we can get `EXDEV` when trying to do the final link. (Theoretically we can cross a mountpoint even with fd-relative though this is a lot less likely)
-
- Sep 13, 2017
-
-
Colin Walters authored
Having our tests forced into a `goto out` style is seriously annoying since we can't write tests like we write production code. Add a macro that checks for the error being NULL. This doesn't fully solve the problem since the test functions are still forced into `void` returns; at some point I may extend GLib to have `g_test_add_err_func()`.
-
- Sep 12, 2017
-
-
Colin Walters authored
I was working on rpm-ostree unified core, and hit the fact that `glnx_file_copy_at()` had the same bug with `fsetxattr()` and files whose mode is <= `0400` (e.g. `000` in the case of `/etc/shadow`) that libostree did a while ago. Basically, Linux currently allows `write()` on non-writable open files but not `fsetxattr()`. This situation is masked for privileged (i.e. `CAP_DAC_OVERRIDE`) code. Looking at this, I think it's cleaner to convert to `O_TMPFILE` here, since that code already handles setting the tmpfile to mode `0600`. Now, this *is* a behavior change in the corner case of existing files which are symbolic links. Previously we'd do an `open(O_TRUNC)` which would follow the link. But in the big picture, I think the use cases for `open(O_TRUNC)` are really rare - I audited all callers of this in ostree/rpm-ostree/flatpak, and all of them will be fine with this behavior change. For example, the ostree `/etc` merge code already explicitly unlinks the target beforehand. Other cases like supporting `repo/pubring.gpg` in an ostree repo being a symlink...eh, just no. Making this change allows us to convert to new style, and brings all of the general benefits of using `O_TMPFILE` too.
-
Colin Walters authored
While reading a strace I noticed a double close in the tests; this was because we were missing an assignment to `-1` in the tests. However, let's make supporting this clearer by explicitly supporting the fd being `-1` while still setting the `initialized` variable to `FALSE`. We also add the `EBADF` assertion checking.
-
- Sep 07, 2017
-
-
Colin Walters authored
This is a very common pattern in both ostree/rpm-ostree. Make a better API for this. I thought a lot about simply zeroing out `struct stat` but that feels dangerous; none of the values have seem obviously `cannot be zero`.
-
- Aug 25, 2017
-
-
Jonathan Lebon authored
-
- Aug 18, 2017
-
-
Colin Walters authored
Basically all of the ostree/rpm-ostree callers want to both create and open, so let's merge `glnx_mkdtempat()` and `glnx_mkdtempat_open()`. Second, all of them want to do `glnx_shutil_rm_rf_at()` on cleanup, so we do the same thing we did with `GLnxTmpfile` and create `GLnxTmpDir` that has a cleanup attribute. The cleanup this results in for rpm-ostree is pretty substantial.
-
- Jul 24, 2017
-
-
Colin Walters authored
It'd be really nice if gtest had a variant which had the funcs take `GError`. May work on that.
-
- Jul 19, 2017
-
-
Colin Walters authored
This is kind of long overdue. Reasons are the same as the other wrappers. I debated adding `O_NOFOLLOW` support but the use cases for that are pretty obscure, callers who want that can just use the syscall directly for now.
-
- Jul 17, 2017
-
-
Colin Walters authored
In a lot of places in ostree, we end up prefixing errors in the *caller*. Often we only have 1-2 callers, and doing the error prefixing isn't too duplicative. But there are definitely cases where it's cleaner to do the prefixing in the callee. We have functions that aren't ported to new style for this reason (they still do the prefixing in `out:`). Introduce a cleanup-oriented version of error prefixing so we can port those functions too.
-
Colin Walters authored
Mostly in ostree/rpm-ostree, we work in either raw `int fd`, or `G{Input,Output}Stream`. One exception is the rpm-ostree `/etc/passwd` handling, which uses `FILE*` since that's what glibc exposes. And in general, there are use cases for `FILE*`; the raw `GUnixOutputStream` for example isn't buffered, and doing so via e.g. `GBufferedOutputStream` means allocating *two* GObjects and even worse going through multiple vfuncs for every write. `FILE*` is used heavily in systemd, and provides buffering. It is a bit cheaper than gobjects, but has its own trap; by default every operation locks a mutex. For more information on that, see `unlocked_stdio(3)`. However, callers can avoid that by using e.g. `fwrite_unlocked`, which I plan to do for most users of `FILE*` that aren't writing to one of the standard streams like `stdout` etc.
-