Skip to content

Fix tests when certain build args are disabled - #6681

Merged
swick merged 3 commits into
mainfrom
bbhtt/fix-niche-tests
Jun 18, 2026
Merged

swick merged 3 commits into
mainfrom
bbhtt/fix-niche-tests

Conversation

@bbhtt

@bbhtt bbhtt commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@bbhtt
bbhtt marked this pull request as draft June 8, 2026 19:39
@bbhtt
bbhtt force-pushed the bbhtt/fix-niche-tests branch 5 times, most recently from 968d4f6 to afcfed6 Compare June 8, 2026 21:41
@bbhtt
bbhtt marked this pull request as ready for review June 8, 2026 21:49
Comment thread app/flatpak-builtins-history.c Outdated
bbhtt added 3 commits June 18, 2026 21:02
Fixes the testsuite with `-Dseccomp=disabled`.
The tests assumed that a system installation always uses the XDG cache
location unless running as root. However, Flatpak only uses that cache
location when the system helper is available at both compile and run
time. [1]

Builds configured with -Dsystem_helper=disabled instead use the
repo-local cache directory [2], causing the tests to look for cached
summaries in the wrong location and fail.

[1]: https://github.com/flatpak/flatpak/blob/96ad6825f3e7115eb95abeba55600b2a39b71178/common/flatpak-dir.c#L4853-L4862
[2]: https://github.com/flatpak/flatpak/blob/96ad6825f3e7115eb95abeba55600b2a39b71178/common/flatpak-dir.c#L4942-L4943
Pulls do not go to the temp repo so they are logged when system
helper is compiled out
@bbhtt
bbhtt force-pushed the bbhtt/fix-niche-tests branch from afcfed6 to 3972db0 Compare June 18, 2026 16:01
@swick

swick commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

I'm rather confused why there isn't a pull in the system helper case though. Shouldn't we see either the pull into the temp repo or the one from the temp repo into the system one?

@bbhtt

bbhtt commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

The network pulls are getting filtered because INSTALLATION=/tmp/foobar but the command is specifying installation, the other ones are the local pull getting filtered due to the code in builtins-history.c

These are the only two I see in the journal. So it ends up with nothing.

@bbhtt

bbhtt commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

It's a bit confusing. On normal (with system helper) system installs pulls are also filtered out by default because installation is set to INSTALLATION=/var/tmp/flatpak-cache-*. It needs to be system to be counted in.

Only user installs log the pull because INSTALLATION=user

g_autofree char *name = flatpak_dir_get_name (dirs->pdata[i]);
if (g_strcmp0 (name, installation) == 0)
include = TRUE;

The other case was probably unintended side effect.

@swick

swick commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

That is super confusing, and sounds like there is a bug, but then again the fixes in this PR here all make sense for the current state.

@swick

swick commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

The CI runner is not having a good day...

@swick
swick added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit ad1ff6d Jun 18, 2026
24 of 35 checks passed
@swick
swick deleted the bbhtt/fix-niche-tests branch June 18, 2026 21:25
@bbhtt

bbhtt commented Jun 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Yes, I think there was a bug in the original commit c672c55 that introduced the logging, because the filtering was also done the same day afc87ad#diff-c838b76d162fbdfb0d1f0f763a6236a0c29d5f7860d3706fba7744b0777aed51R176 and both of these is never going to work.

This is always getting set to a path for system installations or --installations, so the initial pull will always be filtered out from history. The fix I think is to delete this part and let if fall back later. Then the initial network pull will be logged as INSTALLATION=system instead of INSTALLATION=/var/tmp/flatpak-cache-*.

I haven't checked what happens with custom installations but presumably they are also similarly bugged and setting a path doesn't make sense there either.

flatpak/common/flatpak-dir.c

Lines 7128 to 7138 in ad1ff6d

if (repo == self->repo)
name = flatpak_dir_get_name (self);
else
{
GFile *file = ostree_repo_get_path (repo);
name = g_file_get_path (file);
}
(flatpak_dir_log) (self, __FILE__, __LINE__, __FUNCTION__, name,
"pull", state->remote_name, ref, rev, current_checksum, NULL,
"Pulled %s from %s", ref, state->remote_name);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants