eoyilmaz / displaycal-py3

DisplayCAL Modernization Project
https://eoyilmaz.github.io/displaycal-py3/
GNU General Public License v3.0
756 stars 56 forks source link

any idea how to fix `/usr/include/X11/extensions/Xrandr.h:339:61: note: expected ‘long unsigned int *’ but argument is of type ‘long unsigned int **’` on fedora 40 #391

Open tolland opened 1 month ago

tolland commented 1 month ago

Describe the bug When trying to install package from pip on fedora 40, build fails here:

Building wheels for collected packages: displaycal
  Building wheel for displaycal (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for displaycal (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      DisplayCAL/RealDisplaySizeMM.c: In function ‘get_displays’:
      DisplayCAL/RealDisplaySizeMM.c:871:71: error: passing argument 12 of ‘XRRGetOutputProperty’ from incompatible pointer type [-Wincompatible-pointer-types]
        871 |                                     &ret_type, &ret_format, &ret_len, &ret_togo, &atomv) == Success
            |                                                                       ^~~~~~~~~
            |                                                                       |
            |                                                                       long unsigned int **
      In file included from DisplayCAL/RealDisplaySizeMM.c:33:
      /usr/include/X11/extensions/Xrandr.h:339:61: note: expected ‘long unsigned int *’ but argument is of type ‘long unsigned int **’
        339 |                       unsigned long *nitems, unsigned long *bytes_after,
            |                                              ~~~~~~~~~~~~~~~^~~~~~~~~~~
      ['bdist_wheel', '--dist-dir', '/tmp/pip-wheel-3rdq215e/.tmp-z6vjfd_0']
      *** /usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py bdist_wheel --dist-dir /tmp/pip-wheel-3rdq215e/.tmp-z6vjfd_0
      using distutils
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-3dlut-maker.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-apply-profiles.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-curve-viewer.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-profile-info.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-scripting-client.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-synthprofile.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-testchart-editor.desktop
      desktopfile: /tmp/pip-install-gigt4vhm/displaycal_4d3ba024c3f548ac9e6cef2592f28df9/DisplayCAL/../misc/displaycal-vrml-to-x3d-converter.desktop
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for displaycal
Failed to build displaycal
ERROR: Could not build wheels for displaycal, which is required to install pyproject.toml-based projects

To Reproduce Steps to reproduce the behavior:

  1. install the prerequisites
  2. pip install --user displaycal

Expected behavior Would expect it to build successfully.

Versions (please complete the following information):

Additional context

I tried to install from source, but got a different error relating to wxpython, so will look into that one separately

p5k369 commented 1 month ago

Hey @tolland the important part that is missing here is your gcc version. It is very likely you are try to build with gcc14. That has been fixed in the last commit to the develop branch which also works with python 3.12.4. eda424388be5dc18f76b02f8d015d6b2ddafa174

The pip package wont compile RealDisplaySizeMM.c with gcc 14 and even if you mangaged to compile it with another version you wont be able to run it with python 3.12.4. So you have to downgrade both, seems not worth the hustle. Just follow https://github.com/eoyilmaz/displaycal-py3?tab=readme-ov-file#how-to-install and checkout develop instead of main.