vifino / vifino-overlay

My personal overlay for Gentoo. Contains openrazer ebuilds and friends mostly.
MIT License
10 stars 4 forks source link

openrazer +kernel 5.4.2, build fails 'no module named setuptools' #26

Closed thunderrd closed 4 years ago

thunderrd commented 4 years ago

Attempting to emerge the openrazer package results in build failure as stated above. dev-python/setuptools-42.0.2 installed. Build error here:

root@Q6600: ~# emerge -v openrazer

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    #] app-misc/openrazer-9999::vifino-overlay  PYTHON_TARGETS="python3_6 -python3_5 -python3_7" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-misc/openrazer-9999::vifino-overlay
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     5.4.2-ck
 * $(EXTRAVERSION)$(CKVERSION)
 * Checking for suitable kernel configuration options...                                                                                                                                [ ok ]
>>> Unpacking source...
 * Repository id: openrazer_openrazer.git
 * Fetching https://github.com/openrazer/openrazer.git ...
git fetch https://github.com/openrazer/openrazer.git +HEAD:refs/git-r3/HEAD
git symbolic-ref refs/git-r3/app-misc/openrazer/0/__main__ refs/git-r3/HEAD
 * Checking out https://github.com/openrazer/openrazer.git to /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999 ...
git checkout --quiet refs/git-r3/HEAD
GIT update -->
   repository:               https://github.com/openrazer/openrazer.git
   at the commit:            974cefaac71388ea0c185df5fdf5c093b5651cc4
>>> Source unpacked in /var/tmp/portage/app-misc/openrazer-9999/work
>>> Preparing source in /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999 ...
 * Preparing razerkbd module
make -j5 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' -j1 -C /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999 SUBDIRS=/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver clean driver 
make: Entering directory '/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999'

:: Cleaning OpenRazer kernel modules
========================================
make -C "/lib/modules/5.4.2-ck-ck1/build" M="/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver" clean
make[1]: Entering directory '/usr/src/linux-5.4.2-ck'
  CLEAN   /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/Module.symvers
make[1]: Leaving directory '/usr/src/linux-5.4.2-ck'

:: Compiling OpenRazer kernel modules
========================================
make -C /lib/modules/5.4.2-ck-ck1/build M=/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver modules
make[1]: Entering directory '/usr/src/linux-5.4.2-ck'
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd_driver.o
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd_driver.c: In function ‘razer_attr_write_matrix_custom_frame’:
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd_driver.c:1598:38: warning: this statement may fall through [-Wimplicit-fallthrough=]
             report.transaction_id.id = 0x80; // Fall into the 2016/blade/blade2016 to set device id
             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd_driver.c:1599:9: note: here
         default:
         ^~~~~~~
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercommon.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerchromacommon.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.o
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c: In function ‘razer_mouse_disconnect’:
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:3107:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             device_remove_file(&hdev->dev, &dev_attr_charge_colour);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:3108:9: note: here
         case USB_DEVICE_ID_RAZER_MAMBA_WIRED:
         ^~~~
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c: In function ‘razer_attr_read_mouse_dpi’:
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:1056:34: warning: this statement may fall through [-Wimplicit-fallthrough=]
         report.transaction_id.id = 0x3f;
         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:1058:5: note: here
     default:
     ^~~~~~~
In file included from /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:30:
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c: In function ‘razer_mouse_probe’:
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercommon.h:25:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if(device_create_file(dev, type)) { \
       ^
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:2784:13: note: in expansion of macro ‘CREATE_DEVICE_FILE’
             CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_colour);
             ^~~~~~~~~~~~~~~~~~
/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse_driver.c:2785:9: note: here
         case USB_DEVICE_ID_RAZER_MAMBA_WIRED:
         ^~~~
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermousemat_driver.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermousemat.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkraken_driver.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkraken.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermug_driver.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermug.o
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercore_driver.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercore.o
  Building modules, stage 2.
  MODPOST 6 modules
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercore.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razercore.ko
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkbd.ko
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkraken.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razerkraken.ko
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermouse.ko
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermousemat.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermousemat.ko
  CC [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermug.mod.o
  LD [M]  /var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999/driver/razermug.ko
make[1]: Leaving directory '/usr/src/linux-5.4.2-ck'
make: Leaving directory '/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999'
>>> Source compiled.
>>> Test phase [not enabled]: app-misc/openrazer-9999

>>> Install app-misc/openrazer-9999 into /var/tmp/portage/app-misc/openrazer-9999/image/
 * Installing razerkbd module
 * Installing razermouse module
 * Installing razermousemat module
 * Installing razerkraken module
 * Installing razermug module
 * Installing razercore module
make -j5 DESTDIR=/var/tmp/portage/app-misc/openrazer-9999/image/ ubuntu_udev_install daemon_install python_library_install 

:: Installing OpenRazer udev rules

:: Installing OpenRazer Daemon

:: Installing OpenRazer python library
=====================================================
install -m 644 -v -D install_files/udev/99-razer.rules /var/tmp/portage/app-misc/openrazer-9999/image//lib/udev/rules.d/99-razer.rules
=====================================================
make --no-print-directory -C daemon install
=====================================================
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//lib/udev'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//lib/udev/rules.d'
'install_files/udev/99-razer.rules' -> '/var/tmp/portage/app-misc/openrazer-9999/image//lib/udev/rules.d/99-razer.rules'
install -m 755 -v -D install_files/udev/razer_mount /var/tmp/portage/app-misc/openrazer-9999/image//lib/udev/razer_mount
python3 setup.py install --prefix=/usr --root=/var/tmp/portage/app-misc/openrazer-9999/image/
'install_files/udev/razer_mount' -> '/var/tmp/portage/app-misc/openrazer-9999/image//lib/udev/razer_mount'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/man'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/man/man5'
'resources/man/razer.conf.5' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/man/man5/razer.conf.5'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/man/man8'
'resources/man/openrazer-daemon.8' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/man/man8/openrazer-daemon.8'
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
make[1]: *** [Makefile:7: install] Error 1
make: *** [Makefile:76: python_library_install] Error 2
make: *** Waiting for unfinished jobs....
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/openrazer'
'resources/razer.conf' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/openrazer/razer.conf.example'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/bin'
'run_openrazer_daemon.py' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/bin/openrazer-daemon'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/dbus-1'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/dbus-1/services'
'org.razer.service' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/share/dbus-1/services/org.razer.service'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/lib'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/lib/systemd'
/usr/bin/install: creating directory '/var/tmp/portage/app-misc/openrazer-9999/image//usr/lib/systemd/user'
'openrazer-daemon.service' -> '/var/tmp/portage/app-misc/openrazer-9999/image//usr/lib/systemd/user/openrazer-daemon.service'
python3 setup.py install --prefix=/usr --root=/var/tmp/portage/app-misc/openrazer-9999/image/
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
make[1]: *** [Makefile:20: install] Error 1
make: *** [Makefile:59: daemon_install] Error 2
 * ERROR: app-misc/openrazer-9999::vifino-overlay failed (install phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-misc/openrazer-9999::vifino-overlay'`,
 * the complete build log and the output of `emerge -pqv '=app-misc/openrazer-9999::vifino-overlay'`.
 * The complete build log is located at '/var/log/portage/app-misc:openrazer-9999:20191212-163942.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-misc/openrazer-9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-misc/openrazer-9999/temp/environment'.
 * Working directory: '/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999'
 * S: '/var/tmp/portage/app-misc/openrazer-9999/work/openrazer-9999'
 * QA Notice: make jobserver unavailable:
 * 
 *  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
 *  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
JulienDlq commented 4 years ago

The needed dependency seems to exist. Did you removed dev-python/setuptools?

sudo equery depends dev-python/setuptools
[…]
 * These packages depend on dev-python/setuptools:
[…]
app-misc/openrazer-9999 (dev-python/setuptools[python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-)])
[…]
thunderrd commented 4 years ago

No, as I said in the OP, it is installed: Installed versions: 42.0.2^t(11:38:56 PM 12/12/2019)(-test PYTHON_TARGETS="python2_7 python3_6 -pypy -pypy3 -python3_5 -python3_7 -python3_8"

Does it require python-3.5 use flag?

thunderrd commented 4 years ago

Well, that's not it. I rebuilt setuptools with python3_5 flag, and the other 12 packages it needed to rebuild, but get the same failure when openrazer tries to build.

root@Q6600: ~# eix setuptools [I] dev-python/setuptools Installed versions: 42.0.2^t(10:37:10 AM 12/14/2019)(-test PYTHON_TARGETS="python2_7 python3_5 python3_6 -pypy -pypy3 -python3_7 -python3_8")

root@Q6600: ~# emerge -av openrazer These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N #] app-misc/openrazer-9999::vifino-overlay PYTHON_TARGETS="python3_5 python3_6 -python3_7" 0 KiB Results in identical failure:

Traceback (most recent call last): File "setup.py", line 3, in <module> from setuptools import setup, find_packages ModuleNotFoundError: No module named 'setuptools' make[1]: *** [Makefile:20: install] Error 1 make: *** [Makefile:59: daemon_install] Error 2

vifino commented 4 years ago

Hey @thunderrd, I'm not sure how you get that failure, it builds fine for me on =sys-kernel/pf-sources-5.4_p2 in less than 20 seconds, seems to work for others as well. I am on profile default/linux/amd64/17.1/hardened, with python3_6 instead of python3_5, perhaps try it with python3_6 instead? While I don't see a reason why it wouldn't work with 3_5, that might be worth a shot.

thunderrd commented 4 years ago

It has both 3_5 and 3_6 use flags: root@Q6600: ~# emerge -av openrazer These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N #] app-misc/openrazer-9999::vifino-overlay PYTHON_TARGETS="python3_5 python3_6 -python3_7" 0 KiB

If anything occurs to you, let me know. I can't imagine why it's happening.

JulienDlq commented 4 years ago

Hello @thunderrd ! I think I have found your issue. When I have this :

sudo eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)

… it is impossible to build openrazer, same error as you.

But when I have :

sudo eselect python list         
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python3.7
  [3]   python2.7 (fallback)

… it is finaly possible to build openrazer. :grin:

Can you try something like this sudo eselect python set python3.6?

thunderrd commented 4 years ago

That does indeed solve the problem, thank you for reporting here.

However, I don't understand why it does not build with use flag python_single_target3.6, I have tried this and all other combinations of python use flags without success.

Must be a problem in the ebuild deps, but it's beyond me; I don't see any obvious problem there. Good thing I don't have to build this very often - I'd forget to change the active interpreter back, and cause all kinds of other issues :)

Thanks again. If there is more to test, let me know in this space.

entropie commented 4 years ago

Had the same problem but temporary switching python to 3.6 via eselect solved it.

Arnvidr commented 4 years ago

I've had this for ages as well, I have just temporarily compiled setuptools with python3_7 or python3_8 (whichever is top in your interpreter list) before building openrazer, in the hope that gentoo would make this the default sometime soon. This avoids changing the interpreter, and updating world the next time re-builds setuptools as the profile dictates.

Anonymous1157 commented 4 years ago

I ran into the same issue today when I wanted to try this program out using this ebuild. The problem is that the shebang in setup.py or the Makefile generated by the project needs to be fixed to point to the correct version of Python. It just calls python3 which on my ~amd64 system was 3.9. The ebuild works fine if I eselect python set python3.7 then emerge again.

I'm pretty sure there's a Python ebuild function to fix shebangs? I've never worked with a Python package and I don't want to further debug the ebuild right this minute but this smells like a minor oversight.

vifino commented 4 years ago

Hey there. Very busy ever since December, but I'll attempt to clean up the ebuild later today. I'll switch it from using the Makefile to a more helper-functions based approach, this should fix the python issues but could cause issues in the future if upstream ever changes the source layout in an incompatible way. I'll let you all know when it's done.

vifino commented 4 years ago

Hello again. This should be fixed as of 0895a479b4082207a486c433abce5c8d92a67293, please test! Closing this, you can reopen if it's still broken, though I doubt it.