Closed bluca closed 6 years ago
Can not reproduce on Arch Linux with cmake 3.12.4.
==> Starting build()...
-- The C compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for libusb.h
-- Looking for libusb.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /build/razercfg-git/src/razercfg
Scanning dependencies of target pyrazer
Scanning dependencies of target razer
[ 4%] Generating build/stamp
[ 12%] Building C object librazer/CMakeFiles/razer.dir/profile_emulation.o
[ 12%] Building C object librazer/CMakeFiles/razer.dir/librazer.o
[ 16%] Building C object librazer/CMakeFiles/razer.dir/buttonmapping.o
[ 25%] Building C object librazer/CMakeFiles/razer.dir/config.o
[ 25%] Building C object librazer/CMakeFiles/razer.dir/util.o
running build
running build_py
creating /build/razercfg-git/src/razercfg/ui/build
creating /build/razercfg-git/src/razercfg/ui/build/lib
creating /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer
copying pyrazer/main.py -> /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer
copying pyrazer/__init__.py -> /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer
copying pyrazer/ui.py -> /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer
running build_scripts
creating /build/razercfg-git/src/razercfg/ui/build/scripts-3.7
copying and adjusting razercfg -> /build/razercfg-git/src/razercfg/ui/build/scripts-3.7
copying and adjusting qrazercfg -> /build/razercfg-git/src/razercfg/ui/build/scripts-3.7
copying and adjusting qrazercfg-applet -> /build/razercfg-git/src/razercfg/ui/build/scripts-3.7
changing mode of /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/razercfg from 644 to 755
changing mode of /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/qrazercfg from 644 to 755
changing mode of /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/qrazercfg-applet from 644 to 755
[ 29%] Building C object librazer/CMakeFiles/razer.dir/synapse.o
[ 33%] Building C object librazer/CMakeFiles/razer.dir/cypress_bootloader.o
[ 33%] Built target pyrazer
[ 37%] Building C object librazer/CMakeFiles/razer.dir/hw_boomslangce.o
[ 41%] Building C object librazer/CMakeFiles/razer.dir/hw_copperhead.o
[ 45%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder.o
[ 50%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder2013.o
[ 54%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder_chroma.o
[ 58%] Building C object librazer/CMakeFiles/razer.dir/hw_krait.o
[ 66%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis5k6.o
[ 66%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis.o
[ 70%] Building C object librazer/CMakeFiles/razer.dir/hw_naga.o
[ 75%] Building C object librazer/CMakeFiles/razer.dir/hw_imperator.o
[ 79%] Building C object librazer/CMakeFiles/razer.dir/hw_taipan.o
[ 83%] Building C object librazer/CMakeFiles/razer.dir/hw_mamba_tournament_edition.o
[ 87%] Building C object librazer/CMakeFiles/razer.dir/hw_diamondback_chroma.o
[ 91%] Linking C shared library librazer.so
[ 91%] Built target razer
Scanning dependencies of target razerd
[ 95%] Building C object razerd/CMakeFiles/razerd.dir/razerd.o
[100%] Linking C executable razerd
[100%] Built target razerd
==> Entering fakeroot environment...
==> Starting package()...
[ 4%] Built target pyrazer
[ 91%] Built target razer
[100%] Built target razerd
Install the project...
-- Install configuration: ""
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/lib/udev/rules.d/80-razer.rules
-- Installing: /build/razercfg-git/pkg/razercfg-git/etc/pm/sleep.d/50-razer
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/lib/systemd/system/razerd.service
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/lib/librazer.so.1
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/lib/librazer.so
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
CMake Warning at librazer/cmake_install.cmake:76 (message):
WARNING: ldconfig failed: 1
Your system will probably be unable to locate librazer.so library
Call Stack (most recent call first):
cmake_install.cmake:78 (include)
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/bin/razerd
-- Set runtime path of "/build/razercfg-git/pkg/razercfg-git//usr/bin/razerd" to ""
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
CMake Warning at razerd/cmake_install.cmake:64 (message):
WARNING: systemctl --system daemon-reload failed: 1
If you use systemd, please reload systemd manually or reboot the system
Call Stack (most recent call first):
cmake_install.cmake:79 (include)
Failed to enable unit, unit razerd.service does not exist.
CMake Warning at razerd/cmake_install.cmake:77 (message):
WARNING: systemctl --system --force enable razerd.service failed: 1
If you use systemd, enable razerd.service manually
Call Stack (most recent call first):
cmake_install.cmake:79 (include)
CMake Warning at razerd/cmake_install.cmake:90 (message):
WARNING: udevadm control --reload-rules failed: 2
Please reload udev manually or reboot the system
Call Stack (most recent call first):
cmake_install.cmake:79 (include)
running build
running build_py
running build_scripts
running install
running install_lib
creating /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7
creating /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages
creating /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer
copying /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer/main.py -> /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer
copying /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer/__init__.py -> /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer
copying /build/razercfg-git/src/razercfg/ui/build/lib/pyrazer/ui.py -> /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer
byte-compiling /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer/main.py to main.cpython-37.pyc
byte-compiling /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer/__init__.py to __init__.cpython-37.pyc
byte-compiling /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/pyrazer/ui.py to ui.cpython-37.pyc
running install_scripts
copying /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/qrazercfg-applet -> /build/razercfg-git/pkg/razercfg-git/usr/bin
copying /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/razercfg -> /build/razercfg-git/pkg/razercfg-git/usr/bin
copying /build/razercfg-git/src/razercfg/ui/build/scripts-3.7/qrazercfg -> /build/razercfg-git/pkg/razercfg-git/usr/bin
changing mode of /build/razercfg-git/pkg/razercfg-git/usr/bin/qrazercfg-applet to 755
changing mode of /build/razercfg-git/pkg/razercfg-git/usr/bin/razercfg to 755
changing mode of /build/razercfg-git/pkg/razercfg-git/usr/bin/qrazercfg to 755
running install_egg_info
Writing /build/razercfg-git/pkg/razercfg-git/usr/lib/python3.7/site-packages/razercfg-0.40-py3.7.egg-info
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/bin/razer-gamewrapper
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/share/applications/razercfg.desktop
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/share/icons/hicolor/scalable/apps/razercfg.svg
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/share/icons/hicolor/scalable/apps/razercfg-alt.svg
-- Installing: /build/razercfg-git/pkg/razercfg-git/usr/share/icons/hicolor/scalable/apps/razercfg-snake.svg
Tried with CMake's own 3.12.4 binaries, rather than Debian's, and it still fails in the same way... this is very frustrating. Any idea what else it could be?
What are the CMake commands you use?
Ah I can reproduce it when I do an out-of-source build
right, it's just the standard:
mkdir build
cd build
cmake ..
make
Strange. It works for me on Debian Unstable:
user@machine:~/develop/git$ mkdir builddir
user@machine:~/develop/git$ cd builddir/
user@machine:~/develop/git/builddir$ cmake ../razer/
-- The C compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for libusb.h
-- Looking for libusb.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mb/develop/git/builddir
user@machine:~/develop/git/builddir$ make
Scanning dependencies of target pyrazer
Scanning dependencies of target razer
[ 4%] Generating build/stamp
[ 12%] Building C object librazer/CMakeFiles/razer.dir/profile_emulation.o
[ 12%] Building C object librazer/CMakeFiles/razer.dir/buttonmapping.o
[ 16%] Building C object librazer/CMakeFiles/razer.dir/librazer.o
running build
running build_py
creating /home/mb/develop/git/builddir/ui/build
creating /home/mb/develop/git/builddir/ui/build/lib
creating /home/mb/develop/git/builddir/ui/build/lib/pyrazer
copying pyrazer/ui.py -> /home/mb/develop/git/builddir/ui/build/lib/pyrazer
copying pyrazer/__init__.py -> /home/mb/develop/git/builddir/ui/build/lib/pyrazer
copying pyrazer/main.py -> /home/mb/develop/git/builddir/ui/build/lib/pyrazer
running build_scripts
creating /home/mb/develop/git/builddir/ui/build/scripts-3.6
copying and adjusting razercfg -> /home/mb/develop/git/builddir/ui/build/scripts-3.6
copying and adjusting qrazercfg -> /home/mb/develop/git/builddir/ui/build/scripts-3.6
copying and adjusting qrazercfg-applet -> /home/mb/develop/git/builddir/ui/build/scripts-3.6
changing mode of /home/mb/develop/git/builddir/ui/build/scripts-3.6/razercfg from 644 to 755
changing mode of /home/mb/develop/git/builddir/ui/build/scripts-3.6/qrazercfg from 644 to 755
changing mode of /home/mb/develop/git/builddir/ui/build/scripts-3.6/qrazercfg-applet from 644 to 755
[ 20%] Building C object librazer/CMakeFiles/razer.dir/config.o
[ 20%] Built target pyrazer
[ 25%] Building C object librazer/CMakeFiles/razer.dir/util.o
[ 29%] Building C object librazer/CMakeFiles/razer.dir/synapse.o
[ 33%] Building C object librazer/CMakeFiles/razer.dir/cypress_bootloader.o
[ 37%] Building C object librazer/CMakeFiles/razer.dir/hw_boomslangce.o
[ 41%] Building C object librazer/CMakeFiles/razer.dir/hw_copperhead.o
[ 45%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder.o
[ 50%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder2013.o
[ 54%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder_chroma.o
[ 58%] Building C object librazer/CMakeFiles/razer.dir/hw_krait.o
[ 62%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis.o
[ 66%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis5k6.o
[ 70%] Building C object librazer/CMakeFiles/razer.dir/hw_naga.o
[ 79%] Building C object librazer/CMakeFiles/razer.dir/hw_taipan.o
[ 79%] Building C object librazer/CMakeFiles/razer.dir/hw_imperator.o
[ 83%] Building C object librazer/CMakeFiles/razer.dir/hw_mamba_tournament_edition.o
[ 87%] Building C object librazer/CMakeFiles/razer.dir/hw_diamondback_chroma.o
[ 91%] Linking C shared library librazer.so
[ 91%] Built target razer
Scanning dependencies of target razerd
[ 95%] Building C object razerd/CMakeFiles/razerd.dir/razerd.o
[100%] Linking C executable razerd
[100%] Built target razerd
user@machine:~/develop/git/builddir$ sudo make install
[ 87%] Built target razer
[ 95%] Built target razerd
[100%] Built target pyrazer
Install the project...
-- Install configuration: ""
-- Installing: /lib/udev/rules.d/80-razer.rules
-- Installing: /etc/pm/sleep.d/50-razer
-- Installing: /lib/systemd/system/razerd.service
-- Installing: /usr/local/lib/librazer.so.1
-- Up-to-date: /usr/local/lib/librazer.so
-- ldconfig: 0
-- Installing: /usr/local/bin/razerd
-- Set runtime path of "/usr/local/bin/razerd" to ""
-- systemctl --system daemon-reload: 0
-- systemctl --system --force enable razerd.service: 0
-- udevadm control --reload-rules: 0
running build
running build_py
running build_scripts
running install
running install_lib
running install_scripts
copying /home/mb/develop/git/builddir/ui/build/scripts-3.6/qrazercfg -> /usr/local/bin
copying /home/mb/develop/git/builddir/ui/build/scripts-3.6/razercfg -> /usr/local/bin
copying /home/mb/develop/git/builddir/ui/build/scripts-3.6/qrazercfg-applet -> /usr/local/bin
changing mode of /usr/local/bin/qrazercfg to 755
changing mode of /usr/local/bin/razercfg to 755
changing mode of /usr/local/bin/qrazercfg-applet to 755
running install_egg_info
Removing /usr/local/lib/python3.6/dist-packages/razercfg-0.40-py3.6.egg-info
Writing /usr/local/lib/python3.6/dist-packages/razercfg-0.40-py3.6.egg-info
-- Installing: /usr/local/bin/razer-gamewrapper
-- Installing: /usr/local/share/applications/razercfg.desktop
-- Installing: /usr/local/share/icons/hicolor/scalable/apps/razercfg.svg
-- Installing: /usr/local/share/icons/hicolor/scalable/apps/razercfg-alt.svg
-- Installing: /usr/local/share/icons/hicolor/scalable/apps/razercfg-snake.svg
user@machine:~/develop/git/builddir$ cmake --version
cmake version 3.12.3
Is that a fresh chroot? Could it be that there is some new unexpressed build-dependency?
On a fresh sid chroot, with the tarball downloaded from Github:
root@luca-desktop:/tmp/build# cmake ../razer-razercfg-0.40/
-- The C compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for libusb.h
-- Looking for libusb.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
root@luca-desktop:/tmp/build# make -j1
Scanning dependencies of target razer
[ 4%] Building C object librazer/CMakeFiles/razer.dir/buttonmapping.o
[ 8%] Building C object librazer/CMakeFiles/razer.dir/profile_emulation.o
[ 12%] Building C object librazer/CMakeFiles/razer.dir/librazer.o
[ 16%] Building C object librazer/CMakeFiles/razer.dir/config.o
[ 20%] Building C object librazer/CMakeFiles/razer.dir/util.o
[ 25%] Building C object librazer/CMakeFiles/razer.dir/synapse.o
[ 29%] Building C object librazer/CMakeFiles/razer.dir/cypress_bootloader.o
[ 33%] Building C object librazer/CMakeFiles/razer.dir/hw_boomslangce.o
[ 37%] Building C object librazer/CMakeFiles/razer.dir/hw_copperhead.o
[ 41%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder.o
[ 45%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder2013.o
[ 50%] Building C object librazer/CMakeFiles/razer.dir/hw_deathadder_chroma.o
[ 54%] Building C object librazer/CMakeFiles/razer.dir/hw_krait.o
[ 58%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis.o
[ 62%] Building C object librazer/CMakeFiles/razer.dir/hw_lachesis5k6.o
[ 66%] Building C object librazer/CMakeFiles/razer.dir/hw_naga.o
[ 70%] Building C object librazer/CMakeFiles/razer.dir/hw_imperator.o
[ 75%] Building C object librazer/CMakeFiles/razer.dir/hw_taipan.o
[ 79%] Building C object librazer/CMakeFiles/razer.dir/hw_mamba_tournament_edition.o
[ 83%] Building C object librazer/CMakeFiles/razer.dir/hw_diamondback_chroma.o
[ 87%] Linking C shared library librazer.so
[ 87%] Built target razer
Scanning dependencies of target razerd
[ 91%] Building C object razerd/CMakeFiles/razerd.dir/razerd.o
[ 95%] Linking C executable razerd
[ 95%] Built target razerd
Scanning dependencies of target pyrazer
[100%] Generating build/stamp
Traceback (most recent call last):
File "/tmp/build/ui/setup.py", line 4, in <module>
from pyrazer import RAZER_VERSION
ModuleNotFoundError: No module named 'pyrazer'
make[2]: *** [ui/CMakeFiles/pyrazer.dir/build.make:63: ui/build/stamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:201: ui/CMakeFiles/pyrazer.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
root@luca-desktop:/tmp/build# cmake --version
cmake version 3.12.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Is that a fresh chroot?
It's not a chroot.
@bluca
My first guess is that
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
doesn't work correctly for you for some unknown reason. With that setup.py should be able to import pyrazer from pwd.
diff --git a/ui/setup.py.in b/ui/setup.py.in
index dd5d7a6..5b9df7f 100644
--- a/ui/setup.py.in
+++ b/ui/setup.py.in
@@ -1,6 +1,9 @@
#!/usr/bin/env python3
from distutils.core import setup
+import os
+import sys
+sys.path.append(os.getcwd())
from pyrazer import RAZER_VERSION
setup( name = "razercfg",
seems to help (copied from https://stackoverflow.com/a/16021058)
@mbuesch do you have by any chance razercfg installed?
I had it wrong, and it's not due to the version of CMake, but simply to the fact that on my Stretch desktop I had razercfg already installed, so I've got /usr/lib/python3/dist-packages/pyrazer.
@z3ntu yes, that fixes the issue.
@bluca It also works without installed pyrazer. So I don't think it takes the system pyrazer.
I think that your Python doesn't like to import from the working directory.
@z3ntu That change looks reasonable. Could you please prepare a pull request? But please change it to prepend the cwd path instead. That can be done with sys.path.insert(0, os.getcwd()) That way we avoid system pyrazer, if there is any. Thanks a lot!
Strange, I was immediately able to repro on my Stretch desktop where it previously worked by simply removing pyrazer. Oh well, the important thing is that there's a fix :-)
@bluca Could you add a print(sys.path) just before the import in setup.py.in? Would be interesting to see what paths are in there.
$ make
[ 87%] Built target razer
[ 95%] Built target razerd
[100%] Generating build/stamp
['/home/luca/git/razercfg/build/ui', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
Traceback (most recent call last):
File "/home/luca/git/razercfg/build/ui/setup.py", line 8, in <module>
from pyrazer import RAZER_VERSION
ImportError: No module named 'pyrazer'
ui/CMakeFiles/pyrazer.dir/build.make:62: recipe for target 'ui/build/stamp' failed
make[2]: *** [ui/build/stamp] Error 1
CMakeFiles/Makefile2:195: recipe for target 'ui/CMakeFiles/pyrazer.dir/all' failed
make[1]: *** [ui/CMakeFiles/pyrazer.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
@bluca Hm yes, the sourcedir path is missing. For me it looks like this:
['/home/mb/develop/git/razer/build/ui', '/home/mb/develop/git/razer/ui', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/mb/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']
Maybe it has something to do with Python 3.5 vs. 3.6?
But anyway, I think the fix should be applied. It makes it more robust for everyone.
Hi,
Since https://github.com/mbuesch/razer/commit/65f9cdb8b243eff54ca48ebd7f37e822264905dc and the change to run the python setup command in CMAKE_CURRENT_BINARY_DIR rather than CMAKE_CURRENT_SOURCE_DIR, the build breaks with CMake 3.12 (and possibly earlier), which is in Debian unstable/testing. It works fine with CMake 3.9.5 from Debian stable-backports.
I'm 99.9% sure the issue is with CMake as I tried (in a Debian stable chroot) to selectively upgrade packages, and by upgrading CMake the issue starts to occur.
The problem seems to be that while CMake 3.9 correctly copies the 3 pyrazer source files in the build directory, as instructed by the add_custom_command DEPENDS field, CMake 3.12 does not.
CMake 3.9:
CMake 3.12:
Copying the files manually makes it work. I've tried to mess around with the CMake file but I'm no expert so I had no luck unfortunately. I tried to diff the generated makefiles in the ui/ directory between the different CMake versions but I don't see anything obvious that would cause this issue.
Any idea?