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

cagebreak: init at 1.4.2 #99604

Merged
merged 1 commit into from Oct 8, 2020
Merged

cagebreak: init at 1.4.2 #99604

merged 1 commit into from Oct 8, 2020

Conversation

berbiche
Copy link
Member

@berbiche berbiche commented Oct 5, 2020

Motivation for this change

Cagebreak is a Wayland tiling compositor inspired by ratpoison and based on wlroots.

In order to test the binary, the user MUST create the file $XDG_CONFIG_HOME/cagebreak/config otherwise the program segfaults.
The upstream example configuration is made available in "${cagebreak.contrib}/share/cagebreak/config".

$ nix path-info -Sh '.#cagebreak'
/nix/store/zb3hh4pklhd6h5symq3nfp7hzg178bc4-cagebreak-1.4.2	 205.6M

I am neither a ratpoison user nor a cagebreak user (yet).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: nixos label Oct 5, 2020
@berbiche
Copy link
Member Author

berbiche commented Oct 5, 2020

cc relevant maintainers: @primeos @colemickens @AndersonTorres @worldofpeace

cp $src/examples/config $contrib/share/cagebreak/config
'';

postFixup = stdenv.lib.optionalString (xwayland != null) ''
Copy link
Contributor

Choose a reason for hiding this comment

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

do you know where in the code it wants to call the binary? It would be best if they didn't try to look for it from PATH since it's done with conditional compilation anyways (and not just a runtime optional feature).
They could use find_program for it and then generate a header.

Copy link
Member Author

Choose a reason for hiding this comment

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

The xwayland server is started by wlroots' libraries so no calls to the xserver binary take place in cagebreak.
The sway module requires xwayland in its extraPackages otherwise it fails to start the xwayland backend.

@worldofpeace
Copy link
Contributor

In order to test the binary, the user MUST create the file $XDG_CONFIG_HOME/cagebreak/config otherwise the program segfaults.

That sounds like a bug. Ideally it could have a settings to default when there are none (and then write those out), but not segfault. We should open a bug.

@berbiche
Copy link
Member Author

berbiche commented Oct 6, 2020

Wayland modules in NixOS do not have a common namespace which makes it awkward.
Should I add a module under programs?

@AndersonTorres
Copy link
Member

@berbiche nope. Wayland-based window managers can be started from commandline as far as I remember.

@AndersonTorres
Copy link
Member

@berbiche do you have an error log or something like that in order to fill a bug request for the Cagebreak maintainers?

cagebreakConfigfile = pkgs.writeText "config" ''
workspaces 1
escape C-t
bind t exec env DISPLAY=:0 ${pkgs.xterm}/bin/xterm -cm -pc
Copy link
Member Author

Choose a reason for hiding this comment

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

What annoys me about this is that the DISPLAY environment variable is :1 inside the VM, but when I test cagebreak locally (started as a nested wayland session within Sway) the DISPLAY environment variable is properly set to :0.
This might be a bug with cagebreak being launched by an X11 session manager (lightdm).

@berbiche
Copy link
Member Author

berbiche commented Oct 6, 2020

@berbiche do you have an error log or something like that in order to fill a bug request for the Cagebreak maintainers?

I'm not really a C/C++ programmer so I'll see what I can do. I was thinking about compiling with address sanitizer flags and without stripping the binary and debug from there.

@AndersonTorres AndersonTorres merged commit 8aeaba6 into NixOS:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants