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

Current RetroArch cannot build with the menu disabled #16880

Open
kwyxz opened this issue Aug 15, 2024 · 9 comments
Open

Current RetroArch cannot build with the menu disabled #16880

kwyxz opened this issue Aug 15, 2024 · 9 comments

Comments

@kwyxz
Copy link
Contributor

kwyxz commented Aug 15, 2024

Description

While troubleshooting a Haiku issue, I noticed that running ./configure --disable-menu unfortunately does not allow RetroArch to build. This is not Haiku-specific and also happens on Linux (and I am assuming on most, if not all, archs)

Expected behavior

RetroArch should build, albeit with the menu disabled.

Actual behavior

CC retroarch.c
retroarch.c: In function ‘command_event’:
retroarch.c:4469:46: warning: implicit declaration of function ‘menu_state_get_ptr’; did you mean ‘uico_state_get_ptr’? [-Wimplicit-function-declaration]
 4469 |             struct menu_state *menu_st     = menu_state_get_ptr();
      |                                              ^~~~~~~~~~~~~~~~~~
      |                                              uico_state_get_ptr
retroarch.c:4469:46: warning: initialization of ‘struct menu_state *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
retroarch.c:4528:26: error: invalid use of undefined type ‘struct menu_state’
 4528 |                   menu_st->flags                  |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
      |                          ^~
retroarch.c:4528:54: error: ‘MENU_ST_FLAG_ENTRIES_NEED_REFRESH’ undeclared (first use in this function)
 4528 |                   menu_st->flags                  |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
retroarch.c:4528:54: note: each undeclared identifier is reported only once for each function it appears in
retroarch.c:4529:30: error: invalid use of undefined type ‘struct menu_state’
 4529 |                   if (menu_st->driver_ctx->environ_cb)
      |                              ^~
retroarch.c:4530:29: error: invalid use of undefined type ‘struct menu_state’
 4530 |                      menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST,
      |                             ^~
retroarch.c:4530:54: error: ‘MENU_ENVIRON_RESET_HORIZONTAL_LIST’ undeclared (first use in this function)
 4530 |                      menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST,
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
retroarch.c:4531:41: error: invalid use of undefined type ‘struct menu_state’
 4531 |                            NULL, menu_st->userdata);
      |                                         ^~
make: *** [Makefile:209: obj-unix/release/retroarch.o] Error 1

Steps to reproduce the bug

  1. git clone the latest version of RA
  2. ./configure --disable-menu
  3. make

Bisect Results

According to @sonninnos this was possibly introduced in 87b9d03 but there are various errors at various stages.
I have a pull request ready (#16881) that will allow building with --disable-menu --disable-cheevos --disable-qt but not --disable-menu alone.

Version/Commit

Environment information

  • OS: Debian GNU/Linux / Haiku
  • Compiler: gcc 12.2.0 / gcc 13.3.0
@kwyxz
Copy link
Contributor Author

kwyxz commented Aug 15, 2024

Update : I think I re-added cheevos in 8349a48

So now the bug could be solved by just automatically disabling QT when configuring with --disable-menu

@gouchi
Copy link
Member

gouchi commented Aug 21, 2024

@kwyxz This issue should be closed per #16881 ? Thank you.

@kwyxz
Copy link
Contributor Author

kwyxz commented Aug 21, 2024 via email

@gouchi
Copy link
Member

gouchi commented Aug 21, 2024

You are right, I forgot about --disable-qt !

So the idea would be to add something like add_opt QT no maybe around this bloc config.libs.sh ?

@kwyxz
Copy link
Contributor Author

kwyxz commented Aug 22, 2024

Possibly, I have been too scared to touch the configuration scripts to be honest 😅

@gouchi
Copy link
Member

gouchi commented Aug 22, 2024

Using this patch

diff --git a/qb/config.libs.sh b/qb/config.libs.sh
index 06ca062f0c..3eb945a6b3 100644
--- a/qb/config.libs.sh
+++ b/qb/config.libs.sh
@@ -283,22 +283,23 @@ check_enabled CXX DISCORD discord 'The C++ compiler is' false
 check_enabled CXX QT 'Qt companion' 'The C++ compiler is' false
 
 if [ "$HAVE_QT" != 'no' ]; then
-   check_pkgconf QT5CORE Qt5Core 5.2
-   check_pkgconf QT5GUI Qt5Gui 5.2
-   check_pkgconf QT5WIDGETS Qt5Widgets 5.2
-   check_pkgconf QT5CONCURRENT Qt5Concurrent 5.2
-   check_pkgconf QT5NETWORK Qt5Network 5.2
-   #check_pkgconf QT5WEBENGINE Qt5WebEngine 5.4
-
-   # pkg-config is needed to reliably find Qt5 libraries.
-
-   check_enabled QT5CORE QT Qt 'Qt5Core is' true
-   check_enabled QT5GUI QT Qt 'Qt5GUI is' true
-   check_enabled QT5WIDGETS QT Qt 'Qt5Widgets is' true
-   check_enabled QT5CONCURRENT QT Qt 'Qt5Concurrent is' true
-   check_enabled QT5NETWORK QT Qt 'Qt5Network is' true
-   #check_enabled QT5WEBENGINE QT Qt 'Qt5Webengine is' true
-
+   if [ "$HAVE_MENU" != 'no' ]; then
+      check_pkgconf QT5CORE Qt5Core 5.2
+      check_pkgconf QT5GUI Qt5Gui 5.2
+      check_pkgconf QT5WIDGETS Qt5Widgets 5.2
+      check_pkgconf QT5CONCURRENT Qt5Concurrent 5.2
+      check_pkgconf QT5NETWORK Qt5Network 5.2
+      #check_pkgconf QT5WEBENGINE Qt5WebEngine 5.4
+
+      # pkg-config is needed to reliably find Qt5 libraries.
+
+      check_enabled QT5CORE QT Qt 'Qt5Core is' true
+      check_enabled QT5GUI QT Qt 'Qt5GUI is' true
+      check_enabled QT5WIDGETS QT Qt 'Qt5Widgets is' true
+      check_enabled QT5CONCURRENT QT Qt 'Qt5Concurrent is' true
+      check_enabled QT5NETWORK QT Qt 'Qt5Network is' true
+      #check_enabled QT5WEBENGINE QT Qt 'Qt5Webengine is' true
+   fi
    if [ "$HAVE_QT" != yes ]; then
       die : 'Notice: Qt support disabled, required libraries were not found.'
    fi
@@ -587,6 +588,9 @@ if [ "$HAVE_MENU" != 'no' ]; then
       fi
       die : 'Notice: Hardware rendering context not available.'
    fi
+else
+   add_opt QT no
+   die : 'Notice: Qt support disabled, because menu is disabled.'
 fi
 
 if [ "$HAVE_STEAM" = 'yes' ]; then

If I use ./configure --disable-menu I got

Notice: Qt support disabled, because menu is disabled.

And if you try ./configure --disable-menu --enable-qt

Notice: Qt support disabled, because menu is disabled.

Checking for moc ... /usr/bin/moc does not work
Warning: moc not found, Qt companion support will be disabled.

@viachaslavic
Copy link
Contributor

Still getting error from master

CC gfx/video_driver.c
CC tasks/task_pl_thumbnail_download.c
tasks/task_pl_thumbnail_download.c: In function 'task_push_pl_entry_thumbnail_download':
tasks/task_pl_thumbnail_download.c:909:7: error: implicit declaration of function 'runloop_msg_queue_push'; did you mean 'msg_queue_push'? [-Wimplicit-function-declaration]
  909 |       runloop_msg_queue_push(
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       msg_queue_push
make: *** [Makefile:209: obj-unix/debug/tasks/task_pl_thumbnail_download.o] Error 1
make: *** Waiting for unfinished jobs....
gfx/video_driver.c: In function 'video_driver_frame':
gfx/video_driver.c:3765:45: error: 'MENU_ST_FLAG_ALIVE' undeclared (first use in this function)
 3765 |             && !(video_info.menu_st_flags & MENU_ST_FLAG_ALIVE)
      |                                             ^~~~~~~~~~~~~~~~~~
gfx/video_driver.c:3765:45: note: each undeclared identifier is reported only once for each function it appears in
gfx/video_driver.c:3618:16: warning: variable 'last_frame_duped' set but not used [-Wunused-but-set-variable]
 3618 |    static bool last_frame_duped   = true;
      |                ^~~~~~~~~~~~~~~~
make: *** [Makefile:209: obj-unix/debug/gfx/video_driver.o] Error 1

@gouchi
Copy link
Member

gouchi commented Nov 13, 2024

@viachaslavic Indeed, I reproduce the issue using 2a56a82 with ./configure --disable-menu --disable-qt

@sonninnos It seems we need to add #if HAVE_MENU for gfx/video_driver.c:3765 ? Source commit

Thank you.

@sonninnos
Copy link
Collaborator

sonninnos commented Nov 13, 2024

Whoops, on it.

Edit: Luckily I tried testing the build, since found some other Windows-only instances that need similar fixing.

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

No branches or pull requests

4 participants