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

libinput update #29784

Closed
wants to merge 3 commits into from
Closed

libinput update #29784

wants to merge 3 commits into from

Conversation

lukateras
Copy link
Member

Motivation for this change

New version of libinput provides improved support for MacBook touchpads.

Things done

Update libinput to the latest version. This includes a switch to Meson build system, patch to Meson itself (see #28444 (comment)), and xf86-input-libinput update.

NB: this triggers a mass rebuild. I've rebuilt all packages I use on my system, and they all work fine.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@yegortimoshenko, thanks for your PR! By analyzing the history of the files in this pull request, we identified @codyopel, @lambdafu and @fpletz to be potential reviewers.

@@ -18,7 +18,11 @@ python3Packages.buildPythonApplication rec {
popd
'';

setupHook = ./setup-hook.sh;
postPatch = ''
sed -i -e 's|e.fix_rpath(install_rpath)||' mesonbuild/scripts/meson_install.py
Copy link
Member

@Mic92 Mic92 Sep 26, 2017

Choose a reason for hiding this comment

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

Can you add a comment why this necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Mic92 Sure. If Meson is not patched, result/bin/libinput has empty rpath and consequently, it won't find libinput.so and other dependencies and won't run.

Copy link
Member

@Mic92 Mic92 Sep 26, 2017

Choose a reason for hiding this comment

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

Have you checked how if removing breaks other projects depending on this? I am also a bit concerned, because it is also used outside of nixpkgs.

Copy link
Member Author

@lukateras lukateras Sep 26, 2017

Choose a reason for hiding this comment

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

I'm pretty sure nothing will break since most Meson-built derivations (there are currently only a few) patch ELF executables after compilation or set LD_LIBRARY_PATH:

postFixup = ''
patchelf --set-rpath '${rpath}' "$out/bin/sshfs"
'';

postFixup = ''
for prog in $out/bin/* $out/libexec/fwupd/*; do
wrapProgram "$prog" --prefix LD_LIBRARY_PATH : ${rpath}
done
'';

postFixup = ''
for elf in "$out"/bin/* "$out"/lib/*.so; do
patchelf --set-rpath '${rpath}':"$out/lib" "$elf"
done
'';

We would be able to throw this fixup out of Meson derivations.

Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of meson's behavior here? I would like to understand this because it might affect users using meson to build there own software outside of nix store.

Copy link
Member

Choose a reason for hiding this comment

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

@Mic92 it is purely a bug mesonbuild/meson#314

@jtojnar
Copy link
Contributor

jtojnar commented Sep 30, 2017

Just reminding that 1.9 will be released soon.

via https://groups.google.com/forum/#!topic/nix-devel/X8cGDbz1wM8

@lukateras
Copy link
Member Author

@jtojnar I'll update it to 1.9 when it comes out.

@Mic92
Copy link
Member

Mic92 commented Oct 15, 2017

Thanks!

@Mic92 Mic92 closed this in 12f460e Oct 15, 2017
@sifmelcara
Copy link
Member

Hello, I encountered an error when building some packages on master, and it seems this package does not build on my machine, probably caused by this package update?

$ git rev-parse HEAD
7bf191337ef46e5ca5f5860419c8a85c446a5a45

$ nix-build -K -A libinput
these derivations will be built:
  /nix/store/4dpjnpig1f8pqv7xf2vz4ahj7ir68q8v-libinput-1.8.3.drv
building path(s) ‘/nix/store/01nvilz1bdpp769s6fbrg8q01awbf8l0-libinput-1.8.3’, ‘/nix/store/kk567v10lil4x29pvcwy715phcaxdhjq-libinput-1.8.3-dev’
unpacking sources
unpacking source archive /nix/store/prq85hx8633889hsmj3229l82dhxawl9-libinput-1.8.3.tar.xz
source root is libinput-1.8.3
setting SOURCE_DATE_EPOCH to timestamp 1507087887 of file libinput-1.8.3/tools/libinput.1
patching sources
applying patch /nix/store/h7wgnsji81gcdbgr15by4q4p3v9kc7d5-udev-absolute-path.patch
patching file meson.build
configuring
meson flags: --buildtype=release --prefix=/nix/store/01nvilz1bdpp769s6fbrg8q01awbf8l0-libinput-1.8.3 -Ddocumentation=false -Ddebug-gui=false -Dtests=false 
Warning: You are using 'ANSI_X3.4-1968' which is not a Unicode-compatible locale.
You might see errors if you use UTF-8 strings as filenames, as strings, or as file contents.
Please switch to a UTF-8 locale for your platform.
The Meson build system
Version: 0.43.0
Source dir: /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3
Build dir: /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3/build
Build type: native build

Meson encountered an error in file meson_options.txt, line 1, column 0:
Invalid kwargs for option "udev-dir": "default"

A full log can be found at /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3/build/meson-logs/meson-log.txt
note: keeping build directory ‘/tmp/nix-build-libinput-1.8.3.drv-0’
builder for ‘/nix/store/4dpjnpig1f8pqv7xf2vz4ahj7ir68q8v-libinput-1.8.3.drv’ failed with exit code 1
error: build of ‘/nix/store/4dpjnpig1f8pqv7xf2vz4ahj7ir68q8v-libinput-1.8.3.drv’ failed

$ cat /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3/build/meson-logs/meson-log.txt
Build started at 2017-10-16T03:37:28.968437
Python binary: /nix/store/2lb6nn8ivk1alhckv43n7734lqwbw7h9-python3-3.6.2/bin/python3.6m
Python system: Linux
The Meson build system
Version: 0.43.0
Source dir: /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3
Build dir: /tmp/nix-build-libinput-1.8.3.drv-0/libinput-1.8.3/build
Build type: native build

@vcunat
Copy link
Member

vcunat commented Oct 16, 2017

Yes, it doesn't even build. That makes me wonder how much testing it has received.

It's blocking channel tests, and we haven't had update for ~9 days now, so reverted for now: 88b853e.

@vcunat vcunat reopened this Oct 16, 2017
vcunat added a commit that referenced this pull request Oct 16, 2017
This reverts commit 12f460e.
It doesn't build.  Discuss at #29784.
@lukateras
Copy link
Member Author

lukateras commented Oct 16, 2017

I've used to test packages I change/update in NixOS via an overlay instead of touching nixpkgs directly. I thought that was going to be good enough, and didn't know better.

I'll specify my nixpkgs on NIX_PATH, test that it works, and push fixes. I'll also update libinput to 1.8.902.

Sorry to everyone I've pissed off. Also see #30286.

@vcunat
Copy link
Member

vcunat commented Oct 16, 2017

1.8.902 sounds like a pre-release version.

@jtojnar
Copy link
Contributor

jtojnar commented Oct 25, 2017

@lukateras
Copy link
Member Author

@jtojnar Thanks. It's already in my overlay (https://github.com/yegortimoshenko/overlay/blob/master/pkgs/libinput/default.nix) and I'll try to open а pull request to nixpkgs today.

@jtojnar
Copy link
Contributor

jtojnar commented Nov 4, 2017

I updated my branch with additional cleanups: jtojnar@afbb8ee

@jtojnar
Copy link
Contributor

jtojnar commented Nov 6, 2017

1.9.1 is now in master.

@lukateras
Copy link
Member Author

@jtojnar Thanks so much for getting it into master. I won't have to recompile a lot of stuff on every nixos-rebuild switch anymore :-)

@lukateras lukateras closed this Nov 6, 2017
@lukateras lukateras deleted the libinput-update branch December 15, 2017 01:52
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 this pull request may close these issues.

None yet

7 participants