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

Nix build #41

Open
colonelpanic8 opened this issue Jun 30, 2019 · 22 comments · May be fixed by #42
Open

Nix build #41

colonelpanic8 opened this issue Jun 30, 2019 · 22 comments · May be fixed by #42

Comments

@colonelpanic8
Copy link

Similar request to #4, but for nix. I am actually working on this right now and almost done. Once done, getting travis working should be really simple.

I've fixed a ton of stuff, but am currently stuck on waymonad itself, getting:

src/Waymonad/Protocols/Background.hs:1:1: error:
    Exception when trying to run compile-time code:
      wayland-scanner: readCreateProcess: runInteractiveProcess: exec: does not exist2 (No such file or directory)
    Code: runScanner (protocolFromFile "protocols/background.xml")
            $ ScannerEnv
                $ M.fromList
                    [("wl_surface",
                      (TH.AppT (TH.ConT ''Ptr) (TH.ConT ''WlrSurface),
                       TH.VarE 'surfaceFromResource,
                       TH.LamE [TH.WildP] (TH.VarE 'getSurfaceResource))),
                     ("wl_output",
                      (TH.AppT (TH.ConT ''Ptr) (TH.ConT ''WlrOutput),
                       TH.VarE 'outputFromResource, TH.VarE 'outputResourceForClient))]
  |
1 | {-
  | ^

Any idea what this might be coming from?

@colonelpanic8
Copy link
Author

Seems like this is coming from this line:

https://github.com/waymonad/waymonad-scanner/blob/91f184e390aeb542eb3ccecabc848e9baea7162c/src/Graphics/Wayland/Scanner.hs#L51

the weird thing is that waymonad-scanner doesn't seem to have an associated executable, so I'm a little bit confused about where this executable is supposed to be coming from.

@colonelpanic8 colonelpanic8 linked a pull request Jun 30, 2019 that will close this issue
@colonelpanic8
Copy link
Author

travis build works here:

https://travis-ci.org/IvanMalison/waymonad

@puffnfresh
Copy link

@IvanMalison looks like that's part of the Wayland library build:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/wayland/default.nix#L3

I guess it's disabled by default 😢

@colonelpanic8
Copy link
Author

@puffnfresh yeah I figured that out. The nix build works now (see #42)

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Thanks for getting this working @IvanMalison. I too looked into building this with nix some time ago, but couldn't make it work.

@colonelpanic8
Copy link
Author

@xaverdh Were you able to get it to build? nix-build should just work with this PR. I would love it if someone else could build and actually see if they get it working. I cant get the binary to do anything useful except show a mouse pointer

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Not quite, I get the following

error: anonymous function at /nix/store/x7wxji51hbi990jilb5fz5ii1mszjiv7-cabal2nix-libinput/default.nix:1:1 
called with unexpected argument 'libinput',
at /nix/store/fwjz2jvv2fmj8c0534fklfrcdc9qdy3x-source/pkgs/development/haskell-modules/make-package-set.nix:87:27

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Adding PkgConfig-Depends: libinput to the cabal file of libinput in hsroots/libinput/ made it compile (it did take some time though, because it had to rebuild glibc-2.27).

@colonelpanic8
Copy link
Author

@xaverdh as mentioned in the pull request:

This depends on swaywm/hsroots#7, which, in turn, depends on waymonad/libinput#1

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Ah sorry, overlooked that. Well I guess it works then :-)

@colonelpanic8
Copy link
Author

@xaverdh Were you able to actually run it and do things with it. I just get a gray screen and none of the keybindings seem to work.

@colonelpanic8
Copy link
Author

@Ongy Would love some help.

@willat8
Copy link

willat8 commented Jul 12, 2019

Check out Ongy's waymonad-config https://github.com/Ongy/waymonad-config
Default modifier key is super instead of alt, with super+return launching urxvt https://github.com/Ongy/waymonad-config/blob/master/lap/Main.hs#L173 (which can be changed to gnome-terminal or similar for a wayland-native option).

@colonelpanic8
Copy link
Author

@willat I tried both super and alt

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Actually I can't get it to run yet. How do you usually run the binary?
I tried exec'ing from a tty. That didn't work, because it needed CAP_SYS_ADMIN for something. After launching with that capability it couldn't find egl drivers.
Im on NixOS btw.

@colonelpanic8
Copy link
Author

Actually I can't get it to run yet. How do you usually run the binary?

I tried this:
https://github.com/ivanmalison/dotfiles/blob/f2887c9a281ccd70de5771676fcf4f30fee3ae86/nixos/configuration.nix#L339

but it didn't really work. Maybe it needs to be run not as a windowmanager but as a desktop environment.

@xaverdh
Copy link

xaverdh commented Jul 12, 2019

Ok, no matter what I do, I can't get it to find the EGL drivers. Very likely that is nixpkgs/nixos related.
@IvanMalison you are also on nixos though, but don't have any problem with EGL, right?
Whats your driver setup and what channel are you using?
Im on unstable (nixos-19.09pre185176.1036dc66416) and using intel graphics.

@colonelpanic8
Copy link
Author

@xaverdh I'm using nvidia graphics. You get a runtime issue?

@xaverdh
Copy link

xaverdh commented Jul 13, 2019

Yes, logs look like this:

2019-07-13 01:20:27 - [types/wlr_idle_inhibit_v1.c:191] idle_inhibit manager created
2019-07-13 01:20:27 - [backend/wayland/backend.c:183] Creating wayland backend
2019-07-13 01:20:27 - [backend/wayland/backend.c:199] Could not connect to remote display: No such file or directory
2019-07-13 01:20:27 - [backend/session/logind.c:576] Session '33' isn't a graphical session (type: 'tty')
2019-07-13 01:20:27 - [backend/session/direct.c:271] Successfully loaded direct session
2019-07-13 01:20:27 - [backend/backend.c:157] Found 1 GPUs
2019-07-13 01:20:27 - [backend/drm/backend.c:152] Initializing DRM backend for /dev/dri/card0 (i915)
2019-07-13 01:20:27 - [backend/drm/drm.c:64] Using atomic DRM interface
2019-07-13 01:20:27 - [backend/drm/drm.c:179] Found 3 DRM CRTCs
2019-07-13 01:20:27 - [backend/drm/drm.c:88] Found 9 DRM planes
2019-07-13 01:20:27 - [backend/drm/drm.c:152] (3 overlay, 3 primary, 3 cursor)
2019-07-13 01:20:27 - [EGL] eglGetPlatformDisplayEXT: No EGL drivers found.
2019-07-13 01:20:27 - [render/egl.c:130] Failed to create EGL display
2019-07-13 01:20:27 - [render/wlr_renderer.c:216] Could not initialize EGL
2019-07-13 01:20:27 - [backend/drm/renderer.c:42] Failed to create EGL/WLR renderer
2019-07-13 01:20:27 - [backend/drm/backend.c:196] Failed to initialize renderer
2019-07-13 01:20:27 - [backend/backend.c:163] Failed to open DRM device 15
2019-07-13 01:20:27 - [backend/backend.c:300] Failed to open any DRM device
Failed to start fuse:
failed

@xaverdh
Copy link

xaverdh commented Jul 26, 2019

Maybe building from a pinned commit is not a good idea? The GL stuff is rather impure, so maybe the problem is that I build against a version different from the one my system configuration is based on?
Anyway I tried building from newer nixpkgs and ran into this issue

@DieracDelta
Copy link

Did this ever get resolved? @xaverdh did you ever get this successfully building?

@xaverdh
Copy link

xaverdh commented Mar 17, 2020

I could not get it building unfortunately :-(
You would have to fix swaywm/hsroots#5 first. I am not too familiar with either the code or the technical details of wayland, so I gave up on it for the moment.

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 a pull request may close this issue.

5 participants