giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.32k stars 1.39k forks source link

[Linux] Failing to compile latest version on on lder compiler #2345

Closed arossert closed 11 months ago

arossert commented 11 months ago

Summary

Description

Trying to build the latest version on an older compiler fails on this error

      psutil/_psutil_linux.c: In function 'PyInit__psutil_linux':
      psutil/_psutil_linux.c:79:56: error: 'DUPLEX_UNKNOWN' undeclared (first use in this function)
           if (PyModule_AddIntConstant(mod, "DUPLEX_UNKNOWN", DUPLEX_UNKNOWN)) INITERR;
                                                              ^
      psutil/_psutil_linux.c:79:56: note: each undeclared identifier is reported only once for each function it appears in
      psutil could not be installed from sources. Perhaps Python header files are not installed. Try running:
        sudo apt-get install gcc python3-dev
      error: command '/usr/bin/gcc' failed with exit code 1

Looking at the diff it seems that this commit removed the needed DUPLEX_UNKNOWN in psutil/_psutil_linux.c

#ifndef DUPLEX_UNKNOWN
    #define DUPLEX_UNKNOWN 0xff
#endif

Found an older ticket on the same issue https://github.com/giampaolo/psutil/issues/2156

arossert commented 11 months ago

Created a PR for this issue https://github.com/giampaolo/psutil/pull/2346

giampaolo commented 11 months ago

Thank you. Merged.

arossert commented 11 months ago

Thanks, any estimation on new release?