Commit Graph

8098 Commits

Author SHA1 Message Date
Chris Williams
9a61ba7f7d uninstall: Skip in-use runtime check with --unused
confirm_runtime_removal() doesn't know about autoprune-unless
extensions, so it prompts unnecessarily when they're removed by
`flatpak uninstall --unused`. To avoid this, we can simply skip it and
trust flatpak_dir_list_unused_refs().

Closes #5712
Helps #2718
2025-02-21 19:12:46 -06:00
Simon McVittie
f78c67ba11 Merge pull request #6119 from alyssais/static
build: fix build with -Ddefault_library=static
2025-02-16 16:25:03 +00:00
Alyssa Ross
114c22e814 build: fix build with -Ddefault_library=static
Static libraries do not carry information about their dependencies.
Thus, libflatpak_dep must include all of the dependencies for
libraries to link against libflatpak.  To do this, I've repurposed the
libflatpak_common_deps variable, which previously was either empty or
contained only wayland_client, and was then included into the list of
dependencies for libflatpak-common, to be a list of all dependencies
required to both build libflatpak-common, and link against it (or
libflatpak).

This fixes building Flatpak with -Ddefault_library=static.  gtkdoc
must currently be disabled due to a Meson bug I'm working on[1].

[1]: https://github.com/mesonbuild/meson/pull/14257
2025-02-15 12:33:28 +01:00
Simon McVittie
8de11bffd2 Merge pull request #6117 from swick/wip/libtest-ostree-config-redirect
tests: Do not redirect stdout twice
2025-02-14 15:44:09 +00:00
Sebastian Wick
7c722875b7 tests: Do not redirect stdout twice 2025-02-14 15:09:01 +01:00
Simon McVittie
d79ec48d7a Merge pull request #6069 from hfiguiere/extra-data-leak
flatpak-dir: Fix a memory leak installing extra-data
2025-02-12 13:53:40 +00:00
Hubert Figuière
99143ad94b flatpak-dir: Fix a memory leak installing extra-data
Return a borrowed extra_data_name from g_variant_get_child

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2025-02-12 08:34:45 -05:00
David Auer
9f822ff145 run: Unset PYTHONPYCACHEPREFIX from envrionment
This repeatedly lead to errors when users had it set to a directory
accessible from the flatpak when importing pillow/PIL.
2025-02-11 11:36:37 -06:00
Bartłomiej Piotrowski
050f6e35fe prune: Skip calculating potential freed space in the dry run 2025-02-11 13:00:24 +01:00
Chris Williams
97c922f430 cli-transaction: Don't print fatal transaction error twice
Just clear the line and let the error be printed once in main().

Closes #3400
2025-02-10 14:12:20 -06:00
Chris Williams
402b13e32a search: Enable completion of command-specific options 2025-02-10 14:10:22 -06:00
Christian Hergert
6445ebdb24 tty-utils: use ANSI_ST to terminate OSC sequence
The VTE project has requested that we terminate our OSC sequence with
ANSI_ST rather than \007 (BEL) and may enforce this in the near future.
2025-02-07 11:06:53 -06:00
Chris Williams
23583b7791 utils-http: Simplify unclear expression discovered by clang
Closes #5013
2025-02-04 18:42:15 -06:00
Rafael Fontenelle
a8547d6236 Update Brazilian Portuguese translation 2025-01-14 20:25:26 +01:00
Chris Williams
cdc912728e flatpak-permission-show(1): Remove incorrect paragraph from description
This was probably accidentally copied from flatpak-permissions(1).

Closes #4859
2025-01-14 20:24:15 +01:00
Simon McVittie
d0ab55ea4c flatpak(1): Document more environment variables
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-10 14:30:32 +01:00
Simon McVittie
51aaaa943a flatpak(1): Re-word introduction to the list of environment variables
This is more grammatically correct.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-10 14:30:32 +01:00
Simon McVittie
bb22b078e2 flatpak(1): Sort environment variables alphabetically
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-10 14:30:32 +01:00
Chris Williams
a2691022b2 portal: Improve error message for invalid a11y own name
Include the non-matching name in the message for ease of debugging.
2025-01-09 22:41:45 +01:00
Georges Basile Stavracas Neto
a160cbcb1f ci: Update to actions/upload-artifact@v4
There should be no other changes required other than the version
bump.
2025-01-09 18:53:24 +01:00
Georges Basile Stavracas Neto
db6821b537 Post-release version bump 2025-01-09 14:42:27 -03:00
Georges Basile Stavracas Neto
1440f4faa6 Update translation files for 1.16.0 1.16.0 2025-01-09 18:28:29 +01:00
Georges Basile Stavracas Neto
8abdf5d187 Update NEWS for 1.16.0 2025-01-09 18:28:29 +01:00
Simon McVittie
424400edc6 flatpak(1): Expand description of FLATPAK_TTY_PROGRESS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-09 17:33:54 +01:00
Georges Basile Stavracas Neto
4febfb5973 flatpak: Disable progress escape sequence by default
And add the FLATPAK_TTY_PROGRESS env var to re-enable it.

This seems to only be supported by recent versions of terminal emulators
which will cause problems with shipping Flatpak on older distros.

Closes https://github.com/flatpak/flatpak/issues/6052
2025-01-09 17:22:19 +01:00
Will Thompson
2eb4819240 Fix "end of line" typo in internal #defines
The ostree and Flatpak APIs both refer to "end of life", but
this internal #define (though not the data stored in the cache)
refer to "end of line".

Fix this.
2025-01-09 17:00:07 +01:00
Hubert Figuière
6b1bb87a29 gir: Fix closure annotations
This is a new warning. Reproducible on F41
Fixes:

../common/flatpak-installation.c:1963: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:1858: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:2129: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:2014: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:1732: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:2177: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:2220: Warning: Flatpak: invalid closure annotation: only valid on callback parameters
../common/flatpak-installation.c:2608: Warning: Flatpak: invalid closure annotation: only valid on callback parameters

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2025-01-09 16:59:40 +01:00
Simon McVittie
5250be9502 doc: Document $FLATPAK_FANCY_OUTPUT
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-09 16:44:19 +01:00
Simon McVittie
8a6f98e283 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-09 15:26:26 +00:00
Simon McVittie
8882a7f0a8 Merge pull request #6043 from smcv/libglnx-2024-12-06
Update subtree: libglnx 2024-12-06
2025-01-02 14:47:30 +00:00
Simon McVittie
5f1938437a Update subtree: libglnx 2024-12-06
* Fix an assertion failure attempting to create a directory that exists
  as a dangling symlink[1]
* Fix a Meson deprecation warning[2]

[1] https://gitlab.gnome.org/GNOME/libglnx/-/issues/1
[2] https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/60

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-22 12:43:53 +00:00
Georges Basile Stavracas Neto
7a6c98c563 Post-release version bump 2024-12-20 10:44:19 -03:00
Georges Basile Stavracas Neto
18bb8a5f23 Update translation files for 1.15.91 1.15.91 2024-12-20 14:27:36 +01:00
Georges Basile Stavracas Neto
07d062b4a6 Update NEWS for 1.15.91 2024-12-20 14:27:36 +01:00
Georges Basile Stavracas Neto
f8da8d0360 Change release version to 1.15.91
As suggested by Simon.

This will be the first release (and hopefully last) release candidate
for Flatpak 1.16.0.
2024-12-20 14:27:36 +01:00
Owen W. Taylor
35995290f5 Add a FLATPAK_DOWNLOAD_TMPDIR variable
Instead of hardcoding /var/tmp when temporarily downloading layer
tarballs, support overriding with a FLATPAK_DOWNLOAD_TMPDIR
environment variable.

We don't use TMPDIR because the layer tarballs can be very big
(in extreme cases like an SDK > 1GB), and TMPDIR is more
likely to point to a in-memory tmpfs.
2024-12-18 16:35:46 +00:00
Owen W. Taylor
73dd78f775 Add FLATPAK_DATA_DIR environment variable
Now that we read remotes from $datadir/flatpaks/remotes.d as well as
/etc/flatpaks/remotes.d, we should have a mechanism to redirect this, as
we do for almost all other filesystem path locations.

To avoid an explosion of new variables, we introduce FLATPAK_DATA_DIR to
represent configuration that ships with the operating system.

This is useful:
 - To fix sandboxing of tests
 - When installing using flatpak into a chroot, so that we read
   the chroot's configuration rather than the host.

It also is used when reading triggers, but the current
FLATPAK_TRIGGERSDIR is left for compatibility.

Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-12-18 16:32:02 +00:00
Christian Hergert
a1bfc19d49 flatpak: emit progress escape sequence
Following on systemd adopting the progress OSC that ConEmu and Windows
Terminal use, this exports the progress percentage to the terminal
emulator.

VTE also has support for this in the upcoming 0.80 release and is used
by Ptyxis to display progress in the tab widget.
2024-12-15 02:39:23 +01:00
Simon McVittie
6b1b2cc804 wayland: Handle WAYLAND_SOCKET, even when using security-context-v1
As described in #5614, `WAYLAND_SOCKET` provides a single-use socket
as a file descriptor, which some Wayland compositors use to track
special-purpose Wayland clients like input methods and panels.
Since #5615, there are two cases for how it works:

1. With `--nosocket=inherit-wayland-socket` (default): the file
   descriptor is marked close-on-exec so that the sandboxed app does
   not inherit it, and the `WAYLAND_SOCKET` environment variable
   becomes unset. Every time the sandboxed app connects to Wayland,
   because `WAYLAND_SOCKET` is unset, it will fall back to the ordinary,
   public `WAYLAND_DISPLAY`.

2. With `--socket=inherit-wayland-socket`: the file descriptor is
   allowed to be inherited, and the environment variable continues
   to be set. The first time the sandboxed app connects to Wayland,
   it will connect to the `WAYLAND_SOCKET`. The second and subsequent
   connection attempts will be to the ordinary `WAYLAND_DISPLAY`.

However, when #4920 added a code path for the Wayland security-context-v1
interface, it was implemented as a completely separate code path which
early-returned from flatpak_run_add_wayland_args() before the point
where #5615 subsequently added the implementation for (1.). The practical
result of this is that if the compositor sets `WAYLAND_SOCKET` for
a Flatpak app, and it also happens to implement security-context-v1,
then the application will always inherit the `WAYLAND_SOCKET` as though
`--socket=inherit-wayland-socket` had been used. In this case, the app's
first connection to Wayland will use the `WAYLAND_SOCKET` (bypassing
the security context mechanism), the same as in compositors that do not
implement security-context-v1 at all, and only the second and subsequent
connections will use the special per-app `WAYLAND_DISPLAY` created by the
security context mechanism. This seems likely to be unexpected.

To give maintainers and users a choice between behaviours (1.) and (2.),
we can put the security-context-v1 code path through the same code to
handle `WAYLAND_SOCKET` that is used for Wayland compositors that do not
implement that interface. This means that
`--nosocket=inherit-wayland-socket` disables `WAYLAND_SOCKET` in all
cases: if the compositor supports security-context-v1 and the feature
was also available when Flatpak was compiled, then all of the sandboxed
app's Wayland connections will be to the per-app `WAYLAND_DISPLAY`
created by security-context-v1, and otherwise all of the sandboxed app's
Wayland connections will be to the ordinary, public `WAYLAND_DISPLAY`.

With `--socket=inherit-wayland-socket`, the sandboxed app's
first connection to Wayland will continue to be to the inherited
`WAYLAND_SOCKET` fd, and the second and subsequent connections will
be to the `WAYLAND_DISPLAY`, which might either be the special per-app
version created by security-context-v1, or the ordinary public version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-15 02:14:22 +01:00
Simon McVittie
5d235764c0 wayland: Only have one code path to bind-mount WAYLAND_DISPLAY into sandbox
In the older code path where we were not using Wayland security contexts,
we would try to preserve the name of the Wayland display socket
(`$WAYLAND_DISPLAY`), only falling back to `wayland-0` if the name was
something unconventional (contains `/` or does not start with `wayland-`).
This means that in practice, apps could often successfully use a value
of `$WAYLAND_DISPLAY` from the wrong "world" - for example reading the
value used outside the sandbox from a file in code that runs inside the
sandbox, or conversely, passing the value used inside the sandbox via
IPC to a service like gpg-agent outside the sandbox.

However, the implementation in
flatpak_run_add_wayland_security_context_args() did not do this, and
instead would unconditionally use `wayland-0`. There's no real need to
enforce use of that name.

Apps should not really be passing the string value of `WAYLAND_DISPLAY`
across a sandbox boundary, but in practice some do, and we will get
better interoperability if we try to keep that working in at least the
simple cases. This is similar in spirit to how we have handled X11
since 2022 (flatpak/flatpak#5034).

For now, we skip the last few lines of flatpak_run_add_wayland_args() if
we are using Wayland security contexts, to preserve existing
functionality. A subsequent commit will revisit that.

Resolves: https://github.com/flatpak/flatpak/issues/5863
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-15 02:14:22 +01:00
Simon McVittie
0edc8c4159 wayland: Avoid some duplication when getting the Wayland display name
There's no need to have the logic for falling back to `wayland-0` in more
than one place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-15 02:14:22 +01:00
Will Thompson
5544bfdd82 Merge branch 'wip/smcv/issue1' into 'master'
glnx-shutil: Cope with ENOENT even after recursing to create parents

Closes #1

See merge request GNOME/libglnx!62
2024-12-06 13:57:01 +00:00
Simon McVittie
e6151ffbc0 Add a test for glnx_shutil_mkdir_p_at with an unusable parent
This is a slight generalization of the reproducer contributed by Will
Thompson: as well as exercising the case where the parent is a dangling
symlink (reproducing GNOME/libglnx#1), this also exercises the case where
the parent is a non-directory non-symlink (in this case a regular file).

Reproduces: GNOME/libglnx#1
Co-authored-by: Will Thompson <wjt@endlessos.org>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:29:50 +00:00
Simon McVittie
2eb4bcc282 glnx-shutil: Cope with ENOENT even after recursing to create parents
If we try to create `link/content` where `link` is a dangling symlink,
recursing to create `link` will succeed (mkdirat fails with EEXIST,
which is explicitly ignored), but then mkdirat for `link/content` will
still fail. Fail gracefully instead of crashing out with an assertion
failure.

Resolves: GNOME/libglnx#1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:29:50 +00:00
Simon McVittie
f44d944233 tests: Run each shutil test in a temporary directory
Otherwise it could potentially race with tests in other executables that
also want to create `./test`, or interfere with other test-cases in the
same executable that expect `./test` to be nonexistent or empty.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:29:50 +00:00
Will Thompson
b345955140 Merge branch 'wip/smcv/meson-bool' into 'master'
build: Use a boolean default for a boolean option, rather than a string

See merge request GNOME/libglnx!60
2024-12-05 11:39:21 +00:00
Simon McVittie
f92968a8d2 build: Use a boolean default for a boolean option, rather than a string
Meson 1.1.0 officially deprecates string defaults for boolean options,
but boolean defaults worked in many older Meson versions, going back to
at least 0.49.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-05 11:35:45 +00:00
Simon McVittie
51d01f810e Belatedly add more release notes for 1.15.11
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-28 19:14:52 +00:00
Anders Jonsson
deea87f056 context: Use plural form in string 2024-11-28 17:16:41 +00:00
Simon McVittie
4025a96213 tests: Install missing test data
Without this, "as-installed" tests via `ginsttest-runner` will fail,
for example in Debian's autopkgtest framework.

Fixes: 1d56bd37 "context: Implement device lists for usb"
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-11-28 16:52:36 +00:00