georgefst / evdev

Haskell bindings to libevdev. Read from Linux input devices, and create virtual ones.
https://hackage.haskell.org/package/evdev
12 stars 6 forks source link

Set uinput permissions properly on CI #14

Open georgefst opened 3 years ago

georgefst commented 3 years ago

I've tried the usual commands:

sudo groupadd uinput
sudo usermod -a -G uinput $USER
echo 'KERNEL=="uinput", GROUP="uinput", MODE:="0660", OPTIONS+="static_node=uinput"' | sudo tee -a /etc/udev/rules.d/99-uinput.rules > /dev/null

# usually I'd just log out and back in, but that's not an option on Github Actions
# it's possible that not all of these are necessary
# EDIT: related: https://github.com/georgefst/evdev/issues/32
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo modprobe uinput

Checking with ls -l /dev/uinput, the group is correctly set to uinput. But only if there are no uses statements (checkout, cache, setup-haskell) elsewhere in haskell.yml. Somehow these must interfere with the udev rules...

13 works around this by compiling the test executable, then running it with sudo.

NB: most of this experimentation went on in #12, but the history there is not worth trying to follow

guygastineau commented 3 years ago

Weird. I will try to look into this if I find some extra time.

georgefst commented 3 years ago

I am curious to know what on earth is going on here.

Although I am very possibly gonna move all my CI stuff over to Nix and Hydra. So, given this is probably just a weird quirk of Github Actions, I wouldn't spend too much time on it.