Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pygame does not build with 24.08 runtime #316

Open
MateusRodCosta opened this issue Sep 11, 2024 · 2 comments · Fixed by #317
Open

Pygame does not build with 24.08 runtime #316

MateusRodCosta opened this issue Sep 11, 2024 · 2 comments · Fixed by #317

Comments

@MateusRodCosta
Copy link
Contributor

Issue noticed while updating shared-modules reference, updating to fdo 24.08 and updating metadata of dtipbijays

Relevant logs:

-- Build files have been written to: /run/build/portmidi
[1/30] Building C object pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinux.c.o
FAILED: pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinux.c.o 
/usr/bin/cc  -I/run/build/portmidi/pm_common -I/run/build/portmidi/porttime -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -DPMALSA -MD -MT pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinux.c.o -MF pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinux.c.o.d -o pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinux.c.o -c /run/build/portmidi/pm_linux/pmlinux.c
/run/build/portmidi/pm_linux/pmlinux.c: In function ‘pm_init’:
/run/build/portmidi/pm_linux/pmlinux.c:45:34: error: implicit declaration of function ‘find_default_device’; did you mean ‘pm_find_default_device’? [-Wimplicit-function-declaration]
   45 |     pm_default_input_device_id = find_default_device(
      |                                  ^~~~~~~~~~~~~~~~~~~
      |                                  pm_find_default_device
[2/30] Building C object pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/finddefault.c.o
FAILED: pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/finddefault.c.o 
/usr/bin/cc  -I/run/build/portmidi/pm_common -I/run/build/portmidi/porttime -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -DPMALSA -MD -MT pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/finddefault.c.o -MF pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/finddefault.c.o.d -o pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/finddefault.c.o -c /run/build/portmidi/pm_linux/finddefault.c
/run/build/portmidi/pm_linux/finddefault.c: In function ‘skip_spaces’:
/run/build/portmidi/pm_linux/finddefault.c:16:12: error: implicit declaration of function ‘isspace’ [-Wimplicit-function-declaration]
   16 |     while (isspace(c = getc(inf))) ;
      |            ^~~~~~~
/run/build/portmidi/pm_linux/finddefault.c:9:1: note: include ‘<ctype.h>’ or provide a declaration of ‘isspace’
    8 | #include "portmidi.h"
  +++ |+#include <ctype.h>
    9 | 
/run/build/portmidi/pm_linux/finddefault.c: In function ‘find_default_device’:
/run/build/portmidi/pm_linux/finddefault.c:84:13: error: implicit declaration of function ‘pm_find_default_device’; did you mean ‘find_default_device’? [-Wimplicit-function-declaration]
   84 |         i = pm_find_default_device(pref_str, input);
      |             ^~~~~~~~~~~~~~~~~~~~~~
      |             find_default_device
[3/30] Building C object pm_common/CMakeFiles/portmidi-static.dir/__/porttime/ptlinux.c.o
/run/build/portmidi/porttime/ptlinux.c: In function ‘Pt_Start’:
/run/build/portmidi/porttime/ptlinux.c:82:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Wdeprecated-declarations]
   82 |     ftime(&time_offset); /* need this set before process runs */
      |     ^~~~~
In file included from /run/build/portmidi/porttime/ptlinux.c:34:
/usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
   29 | extern int ftime (struct timeb *__timebuf)
      |            ^~~~~
/run/build/portmidi/porttime/ptlinux.c: In function ‘Pt_Time’:
/run/build/portmidi/porttime/ptlinux.c:125:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Wdeprecated-declarations]
  125 |     ftime(&now);
      |     ^~~~~
/usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
   29 | extern int ftime (struct timeb *__timebuf)
      |            ^~~~~
[5/30] Building C object pm_test/CMakeFiles/midithru.dir/midithru.c.o
/run/build/portmidi/pm_test/midithru.c: In function ‘exit_with_message’:
/run/build/portmidi/pm_test/midithru.c:227:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  227 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[6/30] Building C object pm_test/CMakeFiles/latency.dir/latency.c.o
/run/build/portmidi/pm_test/latency.c: In function ‘main’:
/run/build/portmidi/pm_test/latency.c:237:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  237 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/latency.c:263:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  263 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/latency.c: In function ‘get_number’:
/run/build/portmidi/pm_test/latency.c:286:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  286 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[7/30] Building C object pm_test/CMakeFiles/midithread.dir/midithread.c.o
/run/build/portmidi/pm_test/midithread.c: In function ‘exit_with_message’:
/run/build/portmidi/pm_test/midithread.c:169:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  169 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/midithread.c: In function ‘main’:
/run/build/portmidi/pm_test/midithread.c:269:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  269 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/midithread.c:327:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  327 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[8/30] Building C object pm_test/CMakeFiles/test.dir/test.c.o
/run/build/portmidi/pm_test/test.c: In function ‘get_number’:
/run/build/portmidi/pm_test/test.c:43:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   43 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c: In function ‘main_test_output’:
/run/build/portmidi/pm_test/test.c:146:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  146 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:160:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  160 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:165:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  165 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:172:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  172 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:176:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  176 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:184:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  184 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:203:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  203 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c: In function ‘main_test_stream’:
/run/build/portmidi/pm_test/test.c:308:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  308 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:365:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  365 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c: In function ‘main’:
/run/build/portmidi/pm_test/test.c:426:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  426 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/test.c:487:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  487 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[9/30] Building C object pm_test/CMakeFiles/mm.dir/mm.c.o
/run/build/portmidi/pm_test/mm.c: In function ‘get_number’:
/run/build/portmidi/pm_test/mm.c:125:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  125 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[10/30] Building C object pm_test/CMakeFiles/sysex.dir/sysex.c.o
/run/build/portmidi/pm_test/sysex.c: In function ‘get_number’:
/run/build/portmidi/pm_test/sysex.c:45:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   45 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/sysex.c: In function ‘loopback_test’:
/run/build/portmidi/pm_test/sysex.c:104:13: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  104 |             fgets(line, STRING_MAX, stdin);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/sysex.c: In function ‘receive_sysex’:
/run/build/portmidi/pm_test/sysex.c:381:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  381 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/sysex.c: In function ‘send_sysex’:
/run/build/portmidi/pm_test/sysex.c:446:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  446 |     fgets(line, STRING_MAX, stdin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_test/sysex.c: In function ‘main’:
/run/build/portmidi/pm_test/sysex.c:504:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  504 |         fgets(line, STRING_MAX, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[11/30] Building C object pm_common/CMakeFiles/portmidi-static.dir/__/pm_linux/pmlinuxalsa.c.o
/run/build/portmidi/pm_linux/pmlinuxalsa.c: In function ‘alsa_out_open’:
/run/build/portmidi/pm_linux/pmlinuxalsa.c:36:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   36 | #define GET_DESCRIPTOR_CLIENT(info) ((((int)(info)) >> 8) & 0xff)
      |                                        ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:151:20: note: in expansion of macro ‘GET_DESCRIPTOR_CLIENT’
  151 |     desc->client = GET_DESCRIPTOR_CLIENT(client_port);
      |                    ^~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_linux/pmlinuxalsa.c:37:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   37 | #define GET_DESCRIPTOR_PORT(info) (((int)(info)) & 0xff)
      |                                     ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:152:18: note: in expansion of macro ‘GET_DESCRIPTOR_PORT’
  152 |     desc->port = GET_DESCRIPTOR_PORT(client_port);
      |                  ^~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_linux/pmlinuxalsa.c: In function ‘alsa_in_open’:
/run/build/portmidi/pm_linux/pmlinuxalsa.c:36:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   36 | #define GET_DESCRIPTOR_CLIENT(info) ((((int)(info)) >> 8) & 0xff)
      |                                        ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:293:20: note: in expansion of macro ‘GET_DESCRIPTOR_CLIENT’
  293 |     desc->client = GET_DESCRIPTOR_CLIENT(client_port);
      |                    ^~~~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_linux/pmlinuxalsa.c:37:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   37 | #define GET_DESCRIPTOR_PORT(info) (((int)(info)) & 0xff)
      |                                     ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:294:18: note: in expansion of macro ‘GET_DESCRIPTOR_PORT’
  294 |     desc->port = GET_DESCRIPTOR_PORT(client_port);
      |                  ^~~~~~~~~~~~~~~~~~~
/run/build/portmidi/pm_linux/pmlinuxalsa.c: In function ‘alsa_write_flush’:
/run/build/portmidi/pm_linux/pmlinuxalsa.c:436:52: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  436 |     VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
      |                                                    ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c: In function ‘pm_linuxalsa_init’:
/run/build/portmidi/pm_linux/pmlinuxalsa.c:35:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   35 | #define MAKE_DESCRIPTOR(client, port) ((void*)(((client) << 8) | (port)))
      |                                        ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:750:31: note: in expansion of macro ‘MAKE_DESCRIPTOR’
  750 |                               MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
      |                               ^~~~~~~~~~~~~~~
/run/build/portmidi/pm_linux/pmlinuxalsa.c:35:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   35 | #define MAKE_DESCRIPTOR(client, port) ((void*)(((client) << 8) | (port)))
      |                                        ^
/run/build/portmidi/pm_linux/pmlinuxalsa.c:760:31: note: in expansion of macro ‘MAKE_DESCRIPTOR’
  760 |                               MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
      |                               ^~~~~~~~~~~~~~~
[12/30] Building C object pm_common/CMakeFiles/portmidi-static.dir/portmidi.c.o
ninja: build stopped: subcommand failed.
Error: module portmidi: Child process exited with code 1

According to @kepstin:kepstin.ca on #flatpak:matrix.org:

i just pulled down the portmidi 2.0.4 tarball and it looks like this should all work, the pmlinux.c file includes "finddefault.h" which provides a prototype for the find_default_device function.

well, https://github.com/flathub/shared-modules/blob/d1ce8751989f021eb48b1dfd1e72db6083d9b122/pygame/pygame-1.9.6.json sure is using a portmidi release from 2010.

@Eonfge
Copy link
Collaborator

Eonfge commented Sep 12, 2024

Same issue as: #314

MateusRodCosta added a commit to MateusRodCosta/com.scoutshonour.dtipbijays that referenced this issue Sep 14, 2024
Was originally going to be a runtime upgrade to fdo 24.08, but couldn't be done due to flathub/shared-modules#316
@bbhtt bbhtt reopened this Sep 14, 2024
@bbhtt
Copy link
Contributor

bbhtt commented Sep 14, 2024

#317 fixed it partially. Pygame build in 24.08 is still broken #317 (comment)

@bbhtt bbhtt changed the title Unable to build portmidi (pygame dependency) due to "implicit declaration of function ‘find_default_device’" Pygame does not build with 24.08 runtime Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants