-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: fix remote origin management #93
Conversation
When a flatpakref file does not provide a SuggestRemoteName key, create an origin from the Name field. This change implements the algorithm found in flatpak's create_origin_remote_config() function. Remove the option of setting an origin label in packageOption. This option was poorly documented, and its default behavior - labeling as "flathub" if no origin was set - would break system activation.
Renaming for consistency.
I tried this branch and I still get the same issue:
I will try the steps you suggested in the issue but the cause might not be what you made a fix for. |
Test if the remote exists before deleting it. This guards against two potential issues: 1. A Flatpakref might install non-enumerable remotes that are automatically deleted when the application is uninstalled, so attempting to delete them without checking could cause errors. 2. Users might manually delete apps/remotes, which could impact nix-flatpak state; checking prevents errors if the remote has already been removed.
Hey,
This suggests that the Flatpak |
If you saw the message I just deleted, ignore that, the issue has unfortunately manifested again, surprisingly, it was still there after full system re-install so I would be surprised if this issue would be difficult to reproduce on your end.
Something to note, when I do all of these steps, the issue is not present on the next activation, but the activation after that (and all following activations), I cant imagine how I got a "No remote refs for .." error for any rebuild after one where sober was not installed in any form. Also given the fact I tried this on a freshly installed system the issue should definitely be reproducable and related to nix-flatpak. |
I'm really at a loss here. Let me walk you through what I did to test this PR. Note: the snippets below are from a VM, but the same behavior occurs on my daily driver, which has a much more complex configuration. Can you help me pinpoint what might be different on my end, compared to what you are doing? SetupI'm loading nix flatpak as a nixos module. The flake input is set to:
Flatpakref in a freshly built VMI spin up a freshly built vm (build atop the config in
At boot, Sober and its remote are installed:
I build the first generation with:
Which is
Sober's remote and flatpak-state are the same as the build. Now I'll run I tried adding new Flatpaks at activations 3 (
By generation 7, I only have Sober.
Let's check the service status:
Remove and then re-install a flatpakrefAs a further test, I removed sober (by commenting out the flatpakref config) and then re-installed it.
By generation 8 there is no Sober installed:
Let's check the service status:
Now let's re-install Sober:
After activation:
At generation 9, sober has been installed again:
I've run nixos-rebuild a couple more times. Let's check the service status:
|
I'm merging after about a week of daily driving and tests in VM. I won't resolve #90 yet. |
When a flatpakref file does not provide a SuggestRemoteName key, create an origin from the Name field.
This change implements the algorithm found in flatpak's create_origin_remote_config() function.
Remove the option of setting an origin label in packageOption. This option was poorly documented, and its default behavior ( labeling as "flathub" if no origin was set) would break system activation.
Fixes #90