- Jun 17, 2020
-
-
Simon McVittie authored
This is primarily useful for testing and development: it lets us generate the temporary sysroot and inspect its contents, even if we are in a container (such as Docker or Flatpak) that does not give us the necessary privileges to run bubblewrap and create a new user namespace. In particular, this will make it more straightforward for us to check some of our assumptions when running on a non-Debian-derived host system. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This is good for two reasons. In a Flatpak runtime, we will not be able to do tricks with arbitrary bind-mounts; if we want the host library stack, we will have to rewrite the mutable copy of the runtime to replace container libraries with symlinks into /run/host. Also, when not in a Flatpak runtime, having a mutable copy of the immutable runtime gives developers a chance to edit the runtime to inject workarounds or things they're testing. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 16, 2020
-
-
Simon McVittie authored
This will be used to delete libraries from the runtime if their SONAME is the same as a library that we brought in from outside, to avoid conflicts when precedence gets mixed up. A manual test is included. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This gives us a way to traverse paths in the sysroot, without accidentally following a symbolic link that leads outside. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If we're running locale-gen on the host system, we might as well just run it, without wrapping bwrap around it. This requires the new --output-dir option in p-v-locale-gen. To stay consistent, also move from bwrap --chdir DIR to p-v-locale-gen --output-dir DIR in the case where we still need to use bwrap. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If the runtime is already "the right shape", then we don't need to use bwrap to mount it on /usr and populate a suitable tmpfs root filesystem. We need to do this if we want to support being run from inside a Flatpak, because we can't run bwrap inside Flatpak. It might also speed up accesses to suitable runtimes, because we won't waste time invoking extra bwrap processes. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
flatpak_canonicalize_filename() only does a syntactic normalization, eliminating ./ and similar constructs; it does not resolve symbolic links. We need to use the realpath() of the 64-bit dynamic linker, because otherwise, when we start replacing the dynamic linker in the container with a symlink into /run/host, the host system might have a symlink /lib64/ld-linux-x86-64.so.2 pointing outside /lib64, for example to /lib/ld-linux-x86-64-2.30.so. Then we'd get: runtime's ld-linux-x86-64.so.2 -> /run/host/lib64/ld-linux-x86-64.so.2 -> /lib/ld-linux-x86-64-2.30.so -> does not necessarily exist inside container Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
As noted in the comment, the order matters. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This was using bwrap to make ${libdir}/dri available on /run/host/${libdir}/dri, in order to run the equivalent of: ln -fns /run/host/${libdir}/dri/* /overrides/lib/${tuple}/dri/ Instead of using the shell wildcard '*' to implement readdir(), let's just call readdir(${libdir}/dri) ourselves, and fix up the symlink targets to point into /run/host/${libdir}/dri. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The PATH from outside the container doesn't really make sense inside the container, because the directory hierarchy could be totally different (particularly on unusual host systems like GoboLinux and Exherbo). Resetting it also makes sure we don't pick up local installations in ~/bin or ~/.local/bin, which could have dependencies that are unsatisfied in the container. Conversely, the PATH from the host might not include everything we need in the container. If the host system is an OS that only supports merged-/usr use, like Arch Linux, then it might not have both /usr/bin and /bin in the PATH - but if the container is not merged /usr, like a scout SDK sysroot, then we'll need both. This approximately matches Flatpak's behaviour: by default it resets PATH to /app/bin:/usr/bin (because it puts app-specific content in /app and can assume that its runtimes are always merged-/usr). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 12, 2020
-
-
Simon McVittie authored
This lets us hold a fd to the parent directory open and resolve paths relative to it (see openat(2)). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
At some point while I was designing this, the @path was a directory, but it ended up being a file. Fixes: 8b531350 "wrap: Add API for a bubblewrap-compatible fcntl lock" Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Rather than saying "but what if they are on different filesystems?" we might as well just make it work optimally fast either way, since the author of libglnx has already done the hard part for us. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
It isn't particularly important either way, but there's no real reason not to. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This is one of the slower parts of the whole process, and not all games (or automated tests) even need it. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 21, 2020
-
-
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
Using only the 0th slot doesn't actually save us any memory, and being consistent about what the slots mean will make it easier to factor out common code. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If we failed to bind the driver into the container, then we don't want to try to use it later. 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
We'll need those if we want to run ldconfig. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The entire setup for this call to `readlink -f` should have been removed when it was hoisted further up in bind_runtime() (and replaced with `readlink -e`) during commit 26b3be64, but in fact only the part that actually *ran* the wrapped readlink command was deleted. This also always leaked some memory. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
While adding basic test coverage I discovered that this was not giving the intended answer if two values for the same variable appear in the environment block, which is rare but technically possible. 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>
-
Simon McVittie authored
We already (optionally) use --unshare-pid since commit feb948ed. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 20, 2020
-
-
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
Use its own name, and not the first word of the command we executed or would have executed. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 18, 2020
-
-
Simon McVittie authored
If we are on an OS where /sbin is not normally in unprivileged users' PATHs (for example Debian), we won't find ldconfig in PATH and will need to try harder. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Apr 15, 2020
-
-
Simon McVittie authored
We use the same GPtrArray to accumulate both i386 and x86_64 drivers, so ideally we allocate enough space for both and never have to reallocate it again. (But if we guess wrong, no harm done.) Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Even better than an assertion that crashes at runtime if we were wrong - an assertion that makes the build fail if we were wrong, so we can't release code where this assertion would fail. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Unlike EGL and Vulkan, we assign to these variables once per multiarch tuple, separately; so we need to free them once per multiarch tuple, too. Move their scope inwards so we can do that. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-