eoyilmaz / displaycal-py3

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

Build / install fail #336

Closed hfiguiere closed 3 months ago

hfiguiere commented 3 months ago

I'm trying to update the build on flathub beta, and it fail because it can't find the appdata.xml file in dist.

See the output.

Running: pip install --prefix=/app --root=/ --no-build-isolation .
Processing /run/build/displaycal
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: build in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (0.10.0)
Requirement already satisfied: certifi in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (2023.5.7)
Requirement already satisfied: distro in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (1.8.0)
Requirement already satisfied: numpy in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (1.24.3)
Requirement already satisfied: Pillow in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (9.5.0)
Requirement already satisfied: PyChromecast in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (13.0.7)
Requirement already satisfied: Send2Trash in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (1.8.2)
Requirement already satisfied: wxPython in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (4.2.0)
Requirement already satisfied: zeroconf in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (0.39.4)
Requirement already satisfied: dbus-python in /app/lib/python3.11/site-packages (from DisplayCAL==3.9.12) (1.2.18)
Requirement already satisfied: packaging>=19.0 in /app/lib/python3.11/site-packages (from build->DisplayCAL==3.9.12) (23.1)
Requirement already satisfied: pyproject_hooks in /app/lib/python3.11/site-packages (from build->DisplayCAL==3.9.12) (1.0.0)
Requirement already satisfied: protobuf>=3.19.1 in /app/lib/python3.11/site-packages (from PyChromecast->DisplayCAL==3.9.12) (4.23.0)
Requirement already satisfied: casttube>=0.2.0 in /app/lib/python3.11/site-packages (from PyChromecast->DisplayCAL==3.9.12) (0.2.1)
Requirement already satisfied: async-timeout>=4.0.1 in /app/lib/python3.11/site-packages (from zeroconf->DisplayCAL==3.9.12) (4.0.2)
Requirement already satisfied: ifaddr>=0.1.7 in /app/lib/python3.11/site-packages (from zeroconf->DisplayCAL==3.9.12) (0.2.0)
Requirement already satisfied: six in /usr/lib/python3.11/site-packages (from wxPython->DisplayCAL==3.9.12) (1.16.0)
Requirement already satisfied: requests in /app/lib/python3.11/site-packages (from casttube>=0.2.0->PyChromecast->DisplayCAL==3.9.12) (2.30.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /app/lib/python3.11/site-packages (from requests->casttube>=0.2.0->PyChromecast->DisplayCAL==3.9.12) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /app/lib/python3.11/site-packages (from requests->casttube>=0.2.0->PyChromecast->DisplayCAL==3.9.12) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /app/lib/python3.11/site-packages (from requests->casttube>=0.2.0->PyChromecast->DisplayCAL==3.9.12) (2.0.2)
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
  ╰─> [59 lines of output]
      DisplayCAL/RealDisplaySizeMM.c: In function ‘get_displays’:
      DisplayCAL/RealDisplaySizeMM.c:871:61: warning: pointer targets in passing argument 11 of ‘XRRGetOutputProperty’ differ in signedness [-Wpointer-sign]
        871 |                                     &ret_type, &ret_format, &ret_len, &ret_togo, &atomv) == Success
            |                                                             ^~~~~~~~
            |                                                             |
            |                                                             long int *
      In file included from DisplayCAL/RealDisplaySizeMM.c:33:
      /usr/include/X11/extensions/Xrandr.h:339:38: note: expected ‘long unsigned int *’ but argument is of type ‘long int *’
        339 |                       unsigned long *nitems, unsigned long *bytes_after,
            |                       ~~~~~~~~~~~~~~~^~~~~~
      DisplayCAL/RealDisplaySizeMM.c:871:71: warning: 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 **
      /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,
            |                                              ~~~~~~~~~~~~~~~^~~~~~~~~~~
      DisplayCAL/RealDisplaySizeMM.c:1036:53: warning: pointer targets in passing argument 10 of ‘XGetWindowProperty’ differ in signedness [-Wpointer-sign]
       1036 |                             &ret_type, &ret_format, &ret_len, &ret_togo, &atomv) == Success
            |                                                     ^~~~~~~~
            |                                                     |
            |                                                     long int *
      In file included from DisplayCAL/RealDisplaySizeMM.c:27:
      /usr/include/X11/Xlib.h:2700:5: note: expected ‘long unsigned int *’ but argument is of type ‘long int *’
       2700 |     unsigned long*      /* nitems_return */,
            |     ^~~~~~~~~~~~~~
      DisplayCAL/RealDisplaySizeMM.c:1036:63: warning: pointer targets in passing argument 11 of ‘XGetWindowProperty’ differ in signedness [-Wpointer-sign]
       1036 |                             &ret_type, &ret_format, &ret_len, &ret_togo, &atomv) == Success
            |                                                               ^~~~~~~~~
            |                                                               |
            |                                                               long int *
      /usr/include/X11/Xlib.h:2701:5: note: expected ‘long unsigned int *’ but argument is of type ‘long int *’
       2701 |     unsigned long*      /* bytes_after_return */,
            |     ^~~~~~~~~~~~~~
      DisplayCAL/RealDisplaySizeMM.c: In function ‘enumerate_displays’:
      DisplayCAL/RealDisplaySizeMM.c:1364:56: warning: pointer targets in passing argument 1 of ‘PyBytes_FromStringAndSize’ differ in signedness [-Wpointer-sign]
       1364 |               (value = PyString_FromStringAndSize(dp[i]->edid, dp[i]->edid_len)) != NULL) {
            |                                                   ~~~~~^~~~~~
            |                                                        |
            |                                                        unsigned char *
      In file included from /usr/include/python3.11/Python.h:50,
                       from DisplayCAL/RealDisplaySizeMM.c:1:
      /usr/include/python3.11/bytesobject.h:34:50: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
         34 | PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
            |                                                  ^~~~~~~~~~~~
      ['bdist_wheel', '--dist-dir', '/tmp/pip-wheel-fco90clj/.tmp-q85iiskw']
      *** /usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py bdist_wheel --dist-dir /tmp/pip-wheel-fco90clj/.tmp-q85iiskw
      using distutils
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-3dlut-maker.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-apply-profiles.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-curve-viewer.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-profile-info.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-scripting-client.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-synthprofile.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-testchart-editor.desktop
      desktopfile: /run/build/displaycal/DisplayCAL/../misc/displaycal-vrml-to-x3d-converter.desktop
      error: can't copy '/run/build/displaycal/DisplayCAL/../dist/net.displaycal.DisplayCAL.appdata.xml': doesn't exist or not a regular file
      [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
eoyilmaz commented 3 months ago

Do you have any .xml files in the dist folder? It might be generating it with the wrong name.

hfiguiere commented 3 months ago

There is no dist directory

eoyilmaz commented 3 months ago

Would it be possible to first build the library and then run the installation through the whl or tar.gz:

make build
pip install --prefix=/app --root=/ --no-build-isolation .

I'm writing this totally unaware of the build process required for the "flathub" and I'm currently on MacOS so I can't test it.

Patrick (@p5k369) do you have any idea?

hfiguiere commented 3 months ago

there is no makefile in the tarball.

p5k369 commented 3 months ago

looks pretty much like #264

hfiguiere commented 3 months ago

I don't see a fix there. It was working with the previous release.

eoyilmaz commented 3 months ago

Okay let's fix this...

p5k369 commented 3 months ago

@hfiguiere There was no fix, just 2 workarounds. But the problem already existed in 3.9.11, so maybe your last working version was 3.9.10. https://github.com/eoyilmaz/displaycal-py3/issues/264#issuecomment-1611509949

hfiguiere commented 3 months ago

yeah 3.9.10

eoyilmaz commented 3 months ago

So as I understand you untar the tar.gz file and inside it run the pip command, right?

hfiguiere commented 3 months ago

it's pretty much standard python way of doing things... for a loose definition on standard.

hfiguiere commented 3 months ago

and python -m build doesn't work because it require internet access.

eoyilmaz commented 3 months ago

Okay I think I know what is not working properly...

eoyilmaz commented 3 months ago

@hfiguiere can you try with this Tarball: https://github.com/eoyilmaz/displaycal-py3/releases/download/3.9.12/DisplayCAL-3.9.12.tar.gz

I see that the dist folder exists in this one.

eoyilmaz commented 3 months ago

So, I updated the DisplayCAL/setup.py so that it references the net.displaycal.DisplayCAL.appdata.xml file directly (meaning no ".." in the path), I'm not sure if the problem was this (because I'm also currently in my Linux workstation... and thinking again may be this is the problem, I'll report back later...) now the created tar.gz file contains the dist folder and the appdata.xml file... If this is a MacOS vs Linux problem (which I'll test in a minute) it means that I need to create the future releases from Linux or fix that part of the code too...

eoyilmaz commented 3 months ago

🤦‍♂️ okay it seems to be a MacOS vs Linux issue, when I create the tar file in MacOS it doesn't include the xml file...

eoyilmaz commented 3 months ago

Okay now it is fixed, creating the tarball from any OS will always create the net.displaycal.DisplcayCAL.appdata.xml file under the dist folder.

eoyilmaz commented 3 months ago

@hfiguiere can you please report back if you problem is solved with the previously uploaded tar file, and it would be very nice if you can also test this tarball that I generated in MacOS:

DisplayCAL-3.9.12.tar.gz

hfiguiere commented 3 months ago

@hfiguiere can you try with this Tarball: https://github.com/eoyilmaz/displaycal-py3/releases/download/3.9.12/DisplayCAL-3.9.12.tar.gz

I see that the dist folder exists in this one.

Please don't release new tarballs with the same names. This breaks everything when people actually verify the checksum. And doesn't help identifying if there is a problem or not...

eoyilmaz commented 3 months ago

Please don't release new tarballs with the same names. This breaks everything when people actually verify the checksum. And doesn't help identifying if there is a problem or not...

The tarball in PyPI is the same as before, I can't change it, and that's the only place that a checksum is anounced along side the tarball. Here at GitHub I can change the tarball if there is a problem with it, and I can use the same name, it wouldn't be very helpful if I keep the broken tarbal here... If you really require, I can anounce a checksum and update it along with the tarball when I update the tarball with the same name, or drop a note saying that the tarbal was broken and updated at a certain date. But, I would definitely update it, if I can, I would update PyPI too.

hfiguiere commented 3 months ago

no

a new tarball should have a new version. This is what release is about. It was broken? The it's a new bugfix release. The fact that you can not change it on PyPi is actually good. Otherwise it's even hard to know when a problem is introduced or fixed.

This new tarball to work. But then whoever didn't follow will be confused.

eoyilmaz commented 3 months ago

Simply put, I don't care, if it is broken I'll replace it.

hfiguiere commented 3 months ago

That's very nice to downstream distributor that try to keep things sane.

Noted.

eoyilmaz commented 3 months ago

All things aside, is it working for you now?

eoyilmaz commented 3 months ago

Tested in Fedora and it seems to be working fine (at least with the tarball generated with Linux is working fine). Closing this now. The changes will be released with 3.9.13.