Skip to content
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

xdg-desktop-portal-gtk: Enable all default portals unconditionally #345979

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 2, 2024

Things done

xdg-desktop-portal-gtk: Enable all default portals unconditionally

In 80ea989 we updated to x-d-p-gtk 1.10.0, in which some portals were extracted to x-d-p-gnome and were disabled by default in x-d-p-gtk. This was continued with x-d-p-gtk 1.15 bump in 6d64606, which default-enabled all portals because of port to Meson’s auto features.

But I do not think the conflict between portal implementations from x-d-p-gtk and x-d-p-gnome has ever been an issue at runtime – since gnome comes before gtk alphabetically, the gnome portal should have been always preferred when both were available.
And since x-d-p 1.17.0, the portal implementation conflicts are a complete non-issue, as desktop environments can configure which implementation to use for each portal.

Since the benefits of disabling the extra portals are minimal and can lead to conflicts when multiple DEs are enable, we have stopped DEs from doing that in parent commits. This makes the argument unused so let’s remove it.

Fixes: #345733

cc @wineee @bobby285271 @Frontear

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This will fix the conflict when another DE using the full `xdg-desktop-portal-gtk` is enabled simultaneously with Cinnamon.
There will no longer be conflicts at runtime since the portals are now configured by `cinnamon-common` in `xdg.portal.configPackages`.
The added closure size should be negligible, as most of the packages are also used by Cinnamon.
This will fix the conflict when another DE using the full `xdg-desktop-portal-gtk` is enabled simultaneously with Deepin.
Currently, our Deepin uses `gtk` as the preferred default implementation for all portals so presumably the duplicate portals should not have been disabled anyway.
The added closure size should be negligible, as most of the packages are probably also used by Deepin transitively.
This will fix the conflict when another DE using the full `xdg-desktop-portal-gtk` is enabled simultaneously with GNOME.
There will not be conflicts at runtime since the portals have been configured by `gnome-session` in `xdg.portal.configPackages` for a while now.
There will be minimal effect on system closure as all the extra x-d-p dependencies are also used by GNOME platform.
In 80ea989 we updated to x-d-p-gtk 1.10.0, in which some portals were extracted to x-d-p-gnome and were disabled by default in x-d-p-gtk. This was continued with x-d-p-gtk 1.15 bump in 6d64606, which default-enabled all portals because of port to Meson’s auto features.

But I do not think the conflict between portal implementations from x-d-p-gtk and x-d-p-gnome has ever been an issue at runtime – since `gnome` comes before `gtk` alphabetically, the `gnome` portal should have been always preferred when both were available.
And since x-d-p 1.17.0, the portal implementation conflicts are a complete non-issue, as desktop environments can configure which implementation to use for each portal.

Since the benefits of disabling the extra portals are minimal and can lead to conflicts when multiple DEs are enable, we have stopped DEs from doing that in parent commits. This makes the argument unused so let’s remove it.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: GNOME GNOME desktop environment and its underlying platform 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: cinnamon Desktop environment labels Oct 2, 2024
Copy link
Member

@Frontear Frontear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm though i'd love the user who opened the issue to chime in and test if nothing has broken unexpectedly.

paging @freelock

Copy link
Contributor

@K900 K900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plasma was already using the full version so we're good there

@jtojnar jtojnar requested review from bobby285271 and wineee October 2, 2024 18:02
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Oct 2, 2024
@caffineehacker
Copy link
Contributor

This solves my build failing with hyprland and gnome enabled. I have the same error as #345733 without this fix.

@wegank wegank added the 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people label Oct 4, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/ln-failed-to-create-symbolic-link-nix-store-user-units-xdg-desktop-portal-gtk-service-file-exists/53876/6

@K900 K900 merged commit d5f1752 into NixOS:master Oct 4, 2024
30 checks passed
philiptaron added a commit to philiptaron/flock.nix that referenced this pull request Oct 4, 2024
@jtojnar jtojnar deleted the x-d-g-gtk-always-dups branch October 5, 2024 14:00
@K900 K900 mentioned this pull request Oct 8, 2024
13 tasks
@SuperSandro2000
Copy link
Member

It's a shame that most DEs now draw in a whole bag of gnome dependencies including the entire settings daemon.

Are the gnome specific things of any use on other distro? I doubt it and they increase closure size dramatically.

@jtojnar
Copy link
Member Author

jtojnar commented Oct 8, 2024

It's a shame that most DEs now draw in a whole bag of gnome dependencies including the entire settings daemon.

This was always the default case. Only GNOME, Deepin and Cinnamon were disabling pulling in the extra dependencies.

Are the gnome specific things of any use on other distro? I doubt it and they increase closure size dramatically.

Other distros have FHS so they can just pick the GSettings schemas from there if they are present.

We do not really need the whole package, just the settings schemas so if someone managed to create a dummy package it might be fine.

Or maybe we could drop those dependencies since DEs that use gnome-settings-daemon might not even use the settings portal implementation from x-d-p-gtk. But it is hard to be certain with runtime dependencies.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 10, 2024

Only GNOME, Deepin and Cinnamon were disabling pulling in the extra dependencies.

I wanted to use that for Plasma, too, to avoid all the extra dependencies. IMO it is not acceptable for plasma to depend on so many gnome things for a feature which doesn't even work there or are not even required.

We do not really need the whole package, just the settings schemas so if someone managed to create a dummy package it might be fine.

#347739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cinnamon Desktop environment 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build failure: adding xdg-desktop-portal-gtk conflicts with GNOME's implementation
10 participants