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

webkitgtk: Bind NixOS directories to sandbox last #201219

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Nov 14, 2022

Description of changes

Since WebKit/WebKit@31ac354, bubblewrap gets called the following way on NixOS system, when it has share/fonts in environment.pathsToLink:

$ bwrap --ro-bind /nix/store /nix/store --ro-bind /run/current-system /run/current-system --ro-bind-try /run/current-system/sw/share/fonts /run/current-system/sw/share/fonts -- $(realpath $(which true))
bwrap: Can't mkdir parents for /run/current-system/sw/share/fonts: No such file or directory

It fails because /run/current-system/sw is a symlink so bubblewrap is not be able to add another mountpoint inside.

Ideally, we would remove the /run/current-system/sw bind mount and mount only specific subdirectories we need, like the fonts. Unfortunately, it is not clear what else is needed. For example, in the past, Pipewire’s Jack module was loaded from /run/current-system/sw/lib.

So, for now, let’s keep the and mount and move the binding of NixOS directories to the end. Adding bindings starting at leaves and moving to root should be fine.

While at it, let’s also make the binding of /run/current-system conditional, since it will not be available outside of NixOS.

Fixes: #197085

Things done

Untested.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Since WebKit/WebKit@31ac354,
bubblewrap gets called the following way on NixOS system,
when it has `share/fonts` in `environment.pathsToLink`:

    $ bwrap --ro-bind /nix/store /nix/store --ro-bind /run/current-system /run/current-system --ro-bind-try /run/current-system/sw/share/fonts /run/current-system/sw/share/fonts -- $(realpath $(which true))
    bwrap: Can't mkdir parents for /run/current-system/sw/share/fonts: No such file or directory

It fails because `/run/current-system/sw` is a symlink
so bubblewrap is not be able to add another mountpoint inside.

Ideally, we would remove the `/run/current-system/sw` bind mount
and mount only specific subdirectories we need, like the fonts.
Unfortunately, it is not clear what else is needed. For example,
in the past, Pipewire’s Jack module was loaded from `/run/current-system/sw/lib`
NixOS@756e603

So, for now, let’s keep the and mount and move the binding of NixOS directories
to the end. Adding bindings starting at leaves and moving to root should be fine.

While at it, let’s also make the binding of `/run/current-system` conditional
since it will not be available outside of NixOS.

Fixes: NixOS#197085
Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

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

Cherry-picked this commit on my 22.05 installation where GNOME Web would simply not load any pages and now it works perfectly.

Thanks, @jtojnar !

Copy link
Member

@austinbutler austinbutler left a comment

Choose a reason for hiding this comment

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

Online Accounts, Epiphany, and Tangram all seem to be fixed for me with this PR.

@austinbutler
Copy link
Member

Result of nixpkgs-review pr 201219 run on x86_64-linux 1

18 packages marked as broken and skipped:
  • elementary-planner
  • gnome.gnome-todo
  • lispPackages_new.sbclPackages.nyxt_slash_application_slash_tests
  • lispPackages_new.sbclPackages.nyxt_slash_benchmark
  • lispPackages_new.sbclPackages.nyxt_slash_documentation
  • lispPackages_new.sbclPackages.nyxt_slash_gi-gtk
  • lispPackages_new.sbclPackages.nyxt_slash_gi-gtk-application
  • lispPackages_new.sbclPackages.nyxt_slash_gi-gtk_slash_tests
  • lispPackages_new.sbclPackages.nyxt_slash_gtk
  • lispPackages_new.sbclPackages.nyxt_slash_gtk-application
  • lispPackages_new.sbclPackages.nyxt_slash_tests
  • lispPackages_new.sbclPackages.nyxt_slash_version
  • mailnagWithPlugins
  • nasc
  • pantheon.elementary-tasks
  • qgis
  • qgis-ltr
  • xmonad_log_applet
11 packages failed to build:
  • aws-workspaces
  • citrix_workspace (citrix_workspace_22_07_0)
  • citrix_workspace_21_01_0
  • citrix_workspace_21_03_0
  • citrix_workspace_21_06_0
  • citrix_workspace_21_08_0
  • citrix_workspace_21_09_0
  • citrix_workspace_21_12_0
  • citrix_workspace_22_05_0
  • lispPackages_new.sbclPackages.nyxt-ubuntu-package
  • timeline
210 packages built:
  • ChowKick
  • adapta-gtk-theme
  • alfis
  • almanah
  • apache-directory-studio
  • apostrophe
  • astroid
  • balsa
  • bespokesynth
  • bespokesynth-with-vst2
  • birdfont
  • bookworm
  • bottles
  • bubblemail
  • calls
  • cambalache
  • cargo-tauri
  • chatty
  • cinnamon.cinnamon-common
  • cinnamon.cinnamon-control-center
  • cinnamon.cinnamon-gsettings-overrides
  • cinnamon.cinnamon-screensaver
  • cinnamon.pix
  • cinnamon.xreader
  • cinny-desktop
  • claws-mail
  • cog
  • dbeaver
  • eclipse-mat
  • eclipses.eclipse-committers
  • eclipses.eclipse-cpp
  • eclipses.eclipse-java
  • eclipses.eclipse-jee
  • eclipses.eclipse-modeling
  • eclipses.eclipse-platform
  • eclipses.eclipse-rcp
  • eclipses.eclipse-scala-sdk
  • eclipses.eclipse-sdk
  • empathy (gnome.empathy)
  • endeavour
  • eolie
  • ephemeral
  • epiphany (gnome.epiphany)
  • evolution
  • evolution-data-server (gnome.evolution-data-server)
  • evolution-data-server-gtk4
  • evolution-ews
  • evolutionWithPlugins
  • foliate
  • folks
  • font-manager
  • formiko
  • gamehub
  • gfbgraph
  • giara
  • glade
  • gnome-browser-connector
  • gnome-builder
  • gnome-feeds
  • gnome-inform7
  • gnome-online-accounts
  • gnome-photos
  • gnome-recipes
  • gnome.cheese
  • gnome.devhelp
  • gnome.geary
  • gnome.gnome-applets
  • gnome.gnome-boxes
  • gnome.gnome-calendar
  • gnome.gnome-contacts
  • gnome.gnome-control-center
  • gnome.gnome-flashback
  • gnome.gnome-initial-setup
  • gnome.gnome-music
  • gnome.gnome-notes
  • gnome.gnome-online-miners
  • gnome.gnome-panel
  • gnome.gnome-session
  • gnome.gnome-shell
  • gnome.gnome-terminal
  • gnome.gnome-tweaks
  • gnome.gvfs
  • gnome.nixos-gsettings-overrides
  • gnome.polari
  • gnome.sushi
  • gnome.totem
  • yelp (gnome.yelp)
  • gnomeExtensions.easyScreenCast
  • gnomeExtensions.gsconnect
  • gnomeExtensions.system-monitor
  • gnucash
  • gnunet-gtk
  • gnvim
  • gnvim-unwrapped
  • grass
  • grilo-plugins
  • gthumb
  • haskellPackages.ghcjs-dom-hello
  • haskellPackages.gi-javascriptcore
  • haskellPackages.gi-webkit2
  • haskellPackages.gi-webkit2webextension
  • haskellPackages.jsaddle-hello
  • haskellPackages.jsaddle-webkit2gtk
  • haskellPackages.reflex-dom
  • haskellPackages.webkit2gtk3-javascriptcore
  • holochain-launcher
  • kicad-small
  • kicad-unstable-small
  • kotatogram-desktop-with-webkit
  • libgdata
  • libgepub
  • libzapojit
  • liferea
  • lispPackages.cl-webkit2
  • lispPackages.nyxt
  • lispPackages_new.sbclPackages.cl-webkit2
  • lispPackages_new.sbclPackages.nyxt (lispPackages_new.sbclPackages.nyxt-gtk)
  • loxodo
  • luakit
  • lutris
  • lutris-free
  • lutris-unwrapped
  • marker
  • mate.atril
  • mate.mate-user-guide
  • mavproxy
  • meerk40t
  • metamorphose2
  • meteo
  • midori-unwrapped
  • minigalaxy
  • mmex
  • mojave-gtk-theme
  • newsflash
  • notes-up
  • nyxt
  • onboard
  • osmo
  • pantheon.elementary-calendar
  • pantheon.elementary-capnet-assist
  • pantheon.elementary-greeter
  • pantheon.elementary-gsettings-schemas
  • pantheon.elementary-mail
  • pantheon.elementary-photos
  • pantheon.elementary-session-settings
  • pantheon.epiphany
  • pantheon.switchboard-plug-a11y
  • pantheon.switchboard-plug-keyboard
  • pantheon.switchboard-plug-onlineaccounts
  • pantheon.switchboard-with-plugs
  • pantheon.wingpanel-applications-menu
  • pantheon.wingpanel-indicator-datetime
  • pantheon.wingpanel-with-indicators
  • pdfpc
  • phosh
  • playonlinux
  • poedit
  • portfolio
  • printrun
  • protonvpn-gui
  • python310Packages.humblewx
  • python310Packages.kicad
  • python310Packages.wxPython_4_0
  • python310Packages.wxPython_4_1
  • python310Packages.wxPython_4_2
  • python39Packages.humblewx
  • python39Packages.kicad
  • python39Packages.wxPython_4_0
  • python39Packages.wxPython_4_1
  • python39Packages.wxPython_4_2
  • pytrainer
  • quisk
  • quodlibet
  • quodlibet-full
  • quodlibet-without-gst-plugins
  • quodlibet-xine
  • quodlibet-xine-full
  • rednotebook
  • remmina
  • rnnoise-plugin
  • rymcast
  • setzer
  • shotwell
  • skytemple
  • slade
  • sladeUnstable
  • sparkleshare
  • surf
  • surf-display
  • tangram
  • tdesktop
  • thiefmd
  • tonelib-zoom
  • trillian-im
  • tunefish
  • ulauncher
  • vala-language-server
  • vimb-unwrapped
  • vimix-gtk-themes
  • vocal
  • wails
  • webkit2-sharp
  • webkitgtk
  • webkitgtk_4_1
  • webkitgtk_5_0
  • whatsapp-for-linux
  • whitesur-gtk-theme
  • wike
  • woeusb-ng
  • xiphos

@github-actions
Copy link
Contributor

Successfully created backport PR #203770 for release-22.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants