Commit Graph

8168 Commits

Author SHA1 Message Date
Sebastian Wick
b76f2533c7 Update translation files for 1.16.3 1.16.3 2026-01-21 12:19:58 +01:00
Sebastian Wick
11bed7cca4 Update NEWS for 1.16.3 2026-01-21 12:18:38 +01:00
Christian Hergert
11473c515c app: be selective about when to map font-dirs.xml
If the command calling `flatpak build` has already specified a
font-dirs.xml to map, then mapping in again may break (as exemplified in
Builder and Foundry).

This checks to see if an argument has already been mapped in before doing
so and resolves the issue with Builder/Foundry.

Follow-up to !6138

Fixes: GNOME/gnome-builder#2387

(cherry picked from commit c896faae19)
2026-01-21 15:59:52 +05:30
Sebastian Wick
8b73df49b1 Post-release version bump 2025-12-17 22:33:05 +01:00
Sebastian Wick
7c806e340c Update translation files for 1.16.2 1.16.2 2025-12-15 18:52:28 +01:00
Sebastian Wick
631213c562 Update NEWS for 1.16.2 2025-12-15 18:52:28 +01:00
Sebastian Wick
ec36a48446 tests/test-run.sh: Only test for trigger results if we have the deps
If the binaries are not available in the environment, the trigger will
not do anything. The tests will not know about this and fail. So only
test for the results of the triggers if they have the dependencies they
require.

(cherry picked from commit 78b3c47c13)
2025-12-15 18:52:28 +01:00
Sebastian Wick
5c549cd5d0 kill: Do not kill pid 0 and embrace races
There are a number of races, and failure conditions which can lead to a
pid of 0 being returned from flatpak_instance_get_child_pid. This would
lead to a whole bunch of things getting killed.

We will skip the instance in those cases now, and retry a few times. We
also notice when the instance just goes away by itself now.

This should make killing more robust, and especially not SIGKILL pid 0.

(cherry picked from commit 8354ee56cf)
2025-12-03 19:34:17 -05:00
Georgia Garcia
2acd59913f common: Fix running_under_sudo check by checking euid
Sudo can be used in several ways other than calling a command with the
root user. For example, one can use -u to run the command as the
specified user, or -g to specify a primary group to run the command
as.

Flatpak adds a check when --user is used to prevent an installation in
the root's directory, for example, but it does it by only checking if
sudo was used. As stated previously, it does not necessarily imply
root, so this patch explicitly checks if the command is being run with
the root user.

Fixes: https://github.com/flatpak/flatpak/issues/5979
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
(cherry picked from commit f61d931da8)
2025-12-03 19:34:17 -05:00
Kolja Lampe
2cd0b8c05e http: Add cancellation support for curl downloads and error handling
(cherry picked from commit b6775dc221)
2025-12-03 19:34:17 -05:00
Sebastian Wick
e4271b82b2 doc: Build libflatpak-doc.html
Closes #4591

(cherry picked from commit 815301f341)
2025-12-03 19:34:17 -05:00
Sebastian Wick
94b915352a context: Canonicalize xdg dir and home dir paths
When an xdg dir is not available, it is supposed to point at $HOME. We
do not want to mount $HOME though in that case, so we just skip the xdg
dir instead.

The check compares the strings of the the xdg dir path and the home dir
path. So far it relied on the functions internally canonicalizing the
paths in the same way, but there was a glib regression:

https://gitlab.gnome.org/GNOME/glib/-/issues/3811
("g_get_user_special_dir doesn't strip trailing slash from $HOME")

Which then was fixed in cb3e9fe74 ("gutils: Strip all trailing
slashes").

We can however just canonicalize on the paths on the caller side to make
this more robust, so let's just do that.

Closes: #6323
(cherry picked from commit bb2d517bb1)
2025-12-01 11:38:47 -05:00
joj
f415c676a3 Enable VA-API extension for Intel GPUs if either i915 or xe is loaded
Xe module supports the discrete and new integrated GPUs (the Arc series) and
the i915 supports the older Intel integrated GPUs (Intel HD).

Closes: https://github.com/flatpak/flatpak/issues/5248
(cherry picked from commit f53cef0041)
2025-12-01 11:04:56 -05:00
Mary Strodl
4c5693b892 common: support reinstall option on bundle installations
Fixes #2489

Adds and wires up a `reinstall` option to
`flatpak_dir_install_bundle`. Previously, bundle install
transactions would silently drop the reinstall flag.

(backported from commit 919d2922bf)
2025-12-01 11:04:56 -05:00
Sebastian Wick
159796af54 oci: Actually only return the only manifest in get_only_manifest
Instead of using flatpak_oci_manifest_descriptor_get_ref which requires
the `org.opencontainers.image.ref.name` annotation, get any valid
manifest, and make sure to return NULL if there are multiple valid
manifests.

Closes: https://github.com/flatpak/flatpak/issues/6081
(cherry picked from commit 3773617f30)
2025-12-01 11:04:56 -05:00
Sebastian Wick
3c007c97e2 transaction: Handle --include-sdk if SDK is installed in other dir
If an SDK is already installed in a dir that is not targeted with a
flatpak transaction, and the transaction has auto_install_sdk set,
add_new_dep_op returns NULL in dep_op which is not correctly handled in
add_deps.

Fixes #5894

(cherry picked from commit c4af112df4)
2025-11-20 06:20:38 +05:30
Chris Williams
f98c5d1bc4 dir: Also reload repo configuration after setting via system helper
Without doing so, flatpak_dir_get_config() won't reflect changes made
with flatpak_dir_set_config().

This fixes passing multiple patterns to `flatpak mask` for the system
installation.

Closes #5464

(cherry picked from commit a7ac4206c6)
2025-11-20 06:20:38 +05:30
bbhtt
7127ef00d0 utils-http: Fix an uninitialised variable warning
Fixes c75ba1c7e1

```
In file included from /usr/lib/aarch64-linux-gnu/glib-2.0/include/glibconfig.h:9,
 from /usr/include/glib-2.0/glib/gtypes.h:34,
 from /usr/include/glib-2.0/glib/galloca.h:34,
 from /usr/include/glib-2.0/glib.h:32,
 from /usr/include/glib-2.0/gobject/gbinding.h:30,
 from /usr/include/glib-2.0/glib-object.h:24,
 from /usr/include/glib-2.0/gio/gioenums.h:30,
 from /usr/include/glib-2.0/gio/giotypes.h:30,
 from /usr/include/glib-2.0/gio/gio.h:28,
 from ../common/flatpak-utils-http.c:23:
In function ‘glib_autoptr_clear_GFileEnumerator’,
 inlined from ‘glib_autoptr_cleanup_GFileEnumerator’ at /usr/include/glib-2.0/gio/gio-autocleanups.h:69:1,
 inlined from ‘flatpak_get_certificates_for_uri’ at ../common/flatpak-utils-http.c:284:34:
/usr/include/glib-2.0/glib/gmacros.h:1361:10: warning: ‘enumerator’ may be used uninitialized [-Wmaybe-uninitialized]
 1361 | { if (_ptr) (cleanup) ((ParentName *) _ptr); } \
 | ^
/usr/include/glib-2.0/glib/gmacros.h:1379:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
 1379 | _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, TypeName, func)
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gio/gio-autocleanups.h:69:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
 69 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileEnumerator, g_object_unref)
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/flatpak-utils-http.c: In function ‘flatpak_get_certificates_for_uri’:
../common/flatpak-utils-http.c:284:34: note: ‘enumerator’ was declared here
 284 | g_autoptr(GFileEnumerator) enumerator;
```

(cherry picked from commit cd0212aa40)
2025-11-14 20:14:30 +05:30
Sebastian Wick
5ef65d31ee oci-registry: Fix leak by freeing certificates in finalize
(backported from commit 5a80ac679d)
2025-11-14 20:14:30 +05:30
taoky
228dfab479 utils: Don't pass NULL remote to ostree_repo_get_remote_option
Fixes: #4662
(cherry picked from commit dd2a04f978)
2025-11-14 20:14:30 +05:30
Michael Catanzaro
c3c611ce19 doc: update documentation of flatpak-spawn --watch-bus
The current documentation is misleading, and confused multiple
experienced developers for the past two years.

Fixes #5501

(cherry picked from commit 0152272d6c)
2025-11-14 20:14:30 +05:30
Simon Chopin
a13fc5b72f testlib: add expected argument to fcntl(F_DUPFD)
The F_DUPFD and its relative F_DUPFD_CLOEXEC both expect an int argument
as extra argument, being the minimal value for the new FD. This argument
must be within the accepted range (see ulimit -H -n).

This was detected in Ubuntu during testing against the latest glibc,
stracing resulted in:

107244 fcntl(1, F_DUPFD_CLOEXEC, 1847846346272) = -1 EINVAL (Invalid argument)

On the system in question (ppc64el machine running Ubuntu Questing), the
relevant limit is 524288.

For the fix we use 3 as a reasonable floor value, as in the first one
after stderr. It also happens to be the one used in revokefs/main.c.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2121039
(cherry picked from commit 7399dea960)
2025-11-14 08:39:37 +05:30
Martin Schwenke
d02c0bbec5 session-helper: Avoid a memory leak
Apply the fix suggested more than a year ago in:

  https://github.com/flatpak/flatpak/issues/5821#issuecomment-2121673464

Signed-off-by: Martin Schwenke <martin@meltin.net>

Fixes: https://github.com/flatpak/flatpak/issues/5821
(cherry picked from commit cd80e84343)
2025-11-13 06:29:44 +05:30
Johannes Maibaum
378cb66230 flatpak-build: Add empty /run/host/font-dirs.xml
flatpak run writes /run/host/font-dirs.xml, but flatpak build so far
didn't.  This resulted in fontconfig writing:

Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml

to the stderr of all processes utilizing fontconfig and run during
flatpak build, as /run/host/font-dirs.xml is included via
/etc/fonts/50-flatpak.conf. This could cause issues for tests run during
building an application, for example.

Closes #6137

(cherry picked from commit 054f4f4a7b)
2025-10-11 06:56:55 +05:30
Simon McVittie
fef96436a3 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-08 19:14:57 +01:00
Piotr Drąg
b58fa8500a Update Polish translation 2025-09-01 07:58:30 -03:00
Georges Basile Stavracas Neto
fd2049e092 ci: Add flatpak-1.16.x to branch allowlist
This lets CI run for the flatpak-1.16.x branch. Needs backporting to
fully work.
2025-09-01 07:42:24 -03:00
Georges Basile Stavracas Neto
c8bd78dfb5 Post-release version bump 2025-05-10 23:44:21 -03:00
Georges Basile Stavracas Neto
b676905d91 Update translation files for 1.16.0 1.16.1 2025-05-11 02:28:03 +00:00
Georges Basile Stavracas Neto
29a4e5506a Update NEWS for 1.16.1 2025-05-11 02:28:03 +00:00
Owen W. Taylor
a2aad56cd7 tests: Add tests for https OCI remotes 2025-05-08 16:08:21 +00:00
Owen W. Taylor
c75ba1c7e1 common: Implement /etc/containers/certs.d for OCI registries
Docker and podman can be configured to use mutual TLS authentication
to the registry by dropping files into system-wide and user
directories. Implement this in a largely compatible way.

(Because of the limitations of our underlying libraries, we
can't support multiple certificates within the same host config,
but I don't expect anybody actually needs that.)

The certs.d handling is extended so that certificates are separately
looked up when downloading the look-aside index. This is mostly
to simplify our tests, so we can use one web server for both -
in actual operation, we expect the indexes to be unauthenticated.

Also for testing purposes, FLATPAK_CONTAINER_CERTS_D is supported
to override the standard search path.

Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-05-08 16:08:21 +00:00
Owen W. Taylor
f439e83f2a tests/oci-registry: Add support for SSL to client and server 2025-05-08 16:08:21 +00:00
Sebastian Wick
59c2186703 tests/oci-registry-server.py: Always get bytes for the response
And sent the Content-Length header.
2025-05-08 16:08:21 +00:00
Owen W. Taylor
199f7ccac5 tests/oci-registry-server.py: Convert to argparse 2025-05-08 16:08:21 +00:00
Sebastian Wick
5945a18d97 tests/oci-registry-server.py: Clean up Python style 2025-05-08 16:08:21 +00:00
Owen W. Taylor
05e2b083ed tests/oci-registry-client.py: Convert to argparse 2025-05-08 16:08:21 +00:00
Owen W. Taylor
34acb5799e tests/oci-registry-client.py: Parse URL parameter 2025-05-08 16:08:21 +00:00
Owen W. Taylor
82706e6d28 tests/oci-registry-client.py: Drop python2 compatibility 2025-05-08 16:08:21 +00:00
Siteshwar Vashisht
4c33b3cec3 profile: fix a shellcheck warning
Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/etc/profile.d/flatpak.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

Resolves: https://openscanhub.fedoraproject.org/task/51962/log/flatpak-1.16.0-3.fc43/scan-results.html#def1

Signed-off-by: Siteshwar Vashisht <svashisht@redhat.com>
2025-05-07 17:54:28 +00:00
Simon McVittie
fb5264327a Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-06 12:12:15 +01:00
Sebastian Wick
d0a5125d38 run: Use the instance id in the cgroup name
The systemd Desktop Environments conventions for cgroup names is

  app[-<launcher>]-<ApplicationID>-<RANDOM>.scope

where RANDOM should ensure that multiple instances of the application
can be launched. Currently flatpak uses the PID of itself but the
instance fullfills this convention and is a bit more useful for matching
the cgroup to a flatpak instance.

There are cases where flatpak is doing some internal work (apply extra
data) where there is no instance id, and more philosophically also no
app instance. In those cases we simply do not move the process to the
cgroup with the XDG convention.
2025-04-30 14:16:11 +00:00
filmsi
3ecf90cd02 Create sl.po
50 % translated sl.po
2025-04-30 14:12:15 +00:00
filmsi
2856498ba0 Update LINGUAS + add sl.po
Adding Slovenian translation to flatpak.
2025-04-30 14:12:15 +00:00
Bartłomiej Piotrowski
b6836ee865 prune: Move locking operations to execute only outside dry run
The original idea behind this code was that the initial lockless scan
of reachable objects will make the locking one fast enough that
it won't matter to software managing flatpak repos like flat-manager.
Few years later I can say this is not true, and the locking variant
of scan does take too long and affects Flathub's publishing process.

By keeping only the lockless variant in dry run, we can run it on a
weekly schedule without affecting operations, and issue actual pruning
with flat-manager which will hold a lock in external system and avoid
executing any actions requiring locking to avoid errors/timeouts.
2025-04-30 14:00:20 +00:00
Ekaterine Papava
7d0927d27a Update Georgian translation 2025-04-30 13:59:38 +00:00
Anders Jonsson
c9275d543d Update Swedish translation 2025-04-30 13:57:28 +00:00
Álvaro Burns
f2c5cf44c4 Update Brazilian Portuguese translation 2025-04-30 13:56:58 +00:00
Georges Basile Stavracas Neto
ff9f509682 ci: Cosmetics
- Properly title-case some job names
2025-04-30 13:46:06 +00:00
Jordan Petridis
ff2f18cb42 ci: Do not build with ASAN on older ubuntu
We already build and test with asan with the newer
toolchain in the ubuntu 24.04 job. Sometimes the older
toolchain found in 22.04 or the asan version will
trigger issues that are either false positive or that
have been already against in newer versions.
2025-04-30 13:46:06 +00:00