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

Debug build is broken: 'plan' undeclared #2455

Closed
encbar5 opened this issue Sep 2, 2023 · 6 comments · Fixed by #2623
Closed

Debug build is broken: 'plan' undeclared #2455

encbar5 opened this issue Sep 2, 2023 · 6 comments · Fixed by #2623

Comments

@encbar5
Copy link
Contributor

encbar5 commented Sep 2, 2023

Running meson --buildtype=debug build then ninja -C build shows a broken build, even though the release build works fine.
I just ran this on master, commit 8eb614f.

[6/335] Compiling C object subprojects/cava-0.8.5/libcava.so.p/src_output_common.c.o
FAILED: subprojects/cava-0.8.5/libcava.so.p/src_output_common.c.o 
cc -Isubprojects/cava-0.8.5/libcava.so.p -Isubprojects/cava-0.8.5 -I../subprojects/cava-0.8.5 -I../subprojects/cava-0.8.5/include -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -I/usr/include/SDL2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -O0 -g '-DPACKAGE="cava"' '-DVERSION="0.8.5"' '-DFONTDIR="/usr/local/share/consolefonts"' -DHAVE_ALLOCA_H -DNCURSES -DALSA -DPORTAUDIO -DPULSE -DSNDIO -DPIPEWIRE -DSDL -DSDL_GLSL -fPIC -D_REENTRANT -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -pthread -Wall -Wextra -Wno-unused-result -Wno-maybe-uninitialized -Wno-vla-parameter -MD -MQ subprojects/cava-0.8.5/libcava.so.p/src_output_common.c.o -MF subprojects/cava-0.8.5/libcava.so.p/src_output_common.c.o.d -o subprojects/cava-0.8.5/libcava.so.p/src_output_common.c.o -c ../subprojects/cava-0.8.5/src/output/common.c
In file included from ../subprojects/cava-0.8.5/src/output/common.c:3:
../subprojects/cava-0.8.5/src/output/common.c: In function ‘monstercat_filter’:
../subprojects/cava-0.8.5/include/cava/util.h:5:5: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
    5 |     ({                                                                                             \
      |     ^
../subprojects/cava-0.8.5/src/output/common.c:18:29: note: in expansion of macro ‘max’
   18 |                 bars[m_y] = max(bars[z] - pow(de, 2), bars[m_y]);
      |                             ^~~
../subprojects/cava-0.8.5/include/cava/util.h:5:5: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
    5 |     ({                                                                                             \
      |     ^
../subprojects/cava-0.8.5/src/output/common.c:22:29: note: in expansion of macro ‘max’
   22 |                 bars[m_y] = max(bars[z] - pow(de, 2), bars[m_y]);
      |                             ^~~
../subprojects/cava-0.8.5/include/cava/util.h:5:5: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
    5 |     ({                                                                                             \
      |     ^
../subprojects/cava-0.8.5/src/output/common.c:30:29: note: in expansion of macro ‘max’
   30 |                 bars[m_y] = max(bars[z] / pow(monstercat * 1.5, de), bars[m_y]);
      |                             ^~~
../subprojects/cava-0.8.5/include/cava/util.h:5:5: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
    5 |     ({                                                                                             \
      |     ^
../subprojects/cava-0.8.5/src/output/common.c:34:29: note: in expansion of macro ‘max’
   34 |                 bars[m_y] = max(bars[z] / pow(monstercat * 1.5, de), bars[m_y]);
      |                             ^~~
../subprojects/cava-0.8.5/src/output/common.c: In function ‘audio_raw_fetch’:
../subprojects/cava-0.8.5/src/output/common.c:431:73: error: ‘plan’ undeclared (first use in this function)
  431 |         mvprintw(n, 0, "%d: f:%f->%f (%d->%d), eq:%15e, peak:%d \n", n, plan->cut_off_frequency[n],
      |                                                                         ^~~~
@encbar5 encbar5 changed the title Debug build is broken: 'plan' Debug build is broken: 'plan' undeclared Sep 3, 2023
@taminob
Copy link
Contributor

taminob commented Oct 22, 2023

I also ran into this issue and was wondering about the reason why waybar is using https://github.com/LukashonakV/cava instead of https://github.com/karlstav/cava.

Changing to the original repository with a newer release in subprojects/cava.wrap would fix the issue. E.g.:

[wrap-file]
directory = cava-0.9.1
source_url = https://github.com/karlstav/cava/archive/refs/tags/0.9.1.tar.gz
source_filename = cava-0.9.1.tar.gz
[provide]
cava = cava_dep

Alternatively, it is pretty simple to manually resolve the issue by simply deleting the lines subprojects/cava-0.8.5/src/output/common.c:431-433.
However, that is quite inconvenient and I think the best solution would be to upgrade cava.

@LukashonakV
Copy link
Contributor

@taminob about the reason you can read https://github.com/Alexays/Waybar/wiki/Module:-Cava

@LukashonakV
Copy link
Contributor

@encbar5, which gcc do you use to build waybar?

@taminob
Copy link
Contributor

taminob commented Oct 24, 2023

@taminob about the reason you can read https://github.com/Alexays/Waybar/wiki/Module:-Cava

Thank you!
I guess you already tried to contribute the change to link the sources in upstream to a shared lib?

@encbar5, which gcc do you use to build waybar?

For me, it doesn't work with GCC 13.2.1, but looking at https://github.com/LukashonakV/cava/blob/master/src/output/common.c#L431 I don't think the compiler version matters. plan simply isn't defined in this context and it probably wasn't noticed before because of the #ifndef NDEBUG in the line above.

@LukashonakV
Copy link
Contributor

Will try to check this issue today. About cava mainstream, yes. I created a merge request to provide an ability to compile cava as a standalone library. But the maintainer was afraid about it and declined MR. He suggested making a fork. What exactly was done.

@LukashonakV
Copy link
Contributor

Ok. I found the root cause. But need to think how to solve.

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