-
Notifications
You must be signed in to change notification settings - Fork 321
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
Remove -Werror from autotools/darwin build, enable it on CI for all platforms #636
Conversation
I don't think there's any good reason to remove this upstream. If packagers are annoyed by it, I think that's their problem and they can remove it if they want. |
@Be-ing Would you accept a patch that adds -Werror for autotools on linux and for cmake builds? |
Thank you for noticing that inconsistency in the build system, which is one more argument for removing autotools. I think we should use |
We definitely want -Werror somewhere in our CI to catch warnings. @veprbl - Do you have more details on the problems -Werror causes for packagers? |
Werror is good to enable for development, but unless your CI checks every possible compiler out there, warnings can always sneak by. For example, Nixpkgs ran into some new warnings with gcc 10. I think the recommended approach is to keep Werror off by default, and enable it on the CI using CPPFLAGS. |
The compilation errors caused by
That is understandable. How about adding it in the CI workflows? |
I am in favor of merging this after we add -Werror to the CI. |
Note that the Werror broke the MSVC CI. |
Correct. After using /WX it is still broken:
Any thoughts? |
I think this is heading in the right direction. It's OK to limit |
@@ -19,6 +19,7 @@ jobs: | |||
cmake_generator: "Unix Makefiles" | |||
cmake_options: | |||
-DOSS=ON | |||
werror_flags: "-Werror" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done in CMakeLists.txt for ${CMAKE_BUILD_TYPE} STREQUAL "Debug"
and change the cmake_build_type
variable in this GH Actions workflow file to Debug
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI builds should use -Werror
for both debug and release builds.
Please update the title of the pull request to reflect what it is actually doing now. |
Ross and I discussed this and we are both OK with removing -Werror from configure and cmake. @veprbl - Would you like to make those changes and get this merged? |
The CI currently fails on GCC due to PortAudio using deprecated API's Build log/home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c: In function ‘BuildDeviceList’: 27 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:637:17: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 28 637 | jack_port_get_latency( p ) / globalSampleRate; 29 | ^~~~~~~~~~~~~~~~~~~~~ 30 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 31 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 32 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 33 | ^~~~~~~~~~~~~~~~~~~~~ 34 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:658:17: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 35 658 | jack_port_get_latency( p ) / globalSampleRate; 36 | ^~~~~~~~~~~~~~~~~~~~~ 37 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 38 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 39 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 40 | ^~~~~~~~~~~~~~~~~~~~~ 41 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c: In function ‘OpenStream’: 42 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:1354:9: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 43 1354 | stream->streamRepresentation.streamInfo.inputLatency = (jack_port_get_latency( stream->remote_output_ports[0] ) 44 | ^~~~~~ 45 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 46 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 47 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 48 | ^~~~~~~~~~~~~~~~~~~~~ 49 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:1358:9: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 50 1358 | stream->streamRepresentation.streamInfo.outputLatency = (jack_port_get_latency( stream->remote_input_ports[0] ) 51 | ^~~~~~ 52 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 53 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 54 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 55 | ^~~~~~~~~~~~~~~~~~~~~ 56 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c: In function ‘RealProcess’: 57 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:1420:9: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 58 1420 | timeInfo.inputBufferAdcTime = timeInfo.currentTime - jack_port_get_latency( stream->remote_output_ports[0] ) 59 | ^~~~~~~~ 60 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 61 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 62 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 63 | ^~~~~~~~~~~~~~~~~~~~~ 64 /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:1423:9: error: ‘jack_port_get_latency’ is deprecated [-Werror=deprecated-declarations] 65 1423 | timeInfo.outputBufferDacTime = timeInfo.currentTime + jack_port_get_latency( stream->remote_input_ports[0] ) 66 | ^~~~~~~~ 67 In file included from /home/runner/work/portaudio/portaudio/src/hostapi/jack/pa_jack.c:63: 68 /home/runner/work/portaudio/portaudio/build/vcpkg_installed/x64-linux/include/jack/jack.h:1233:16: note: declared here 69 1233 | jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; 70 | ^~~~~~~~~~~~~~~~~~~~~ 71 [ 10%] Building C object CMakeFiles/PortAudio.dir/src/os/unix/pa_unix_hostapis.c.o 72 [ 10%] Building C object CMakeFiles/PortAudio.dir/src/os/unix/pa_unix_util.c.o 73 [ 11%] Building C object CMakeFiles/PortAudio.dir/src/hostapi/alsa/pa_linux_alsa.c.o 74 /home/runner/work/portaudio/portaudio/src/hostapi/alsa/pa_linux_alsa.c:183:1: error: ‘snd_pcm_sw_params_set_xfer_align’ is deprecated [-Werror=deprecated-declarations] 75 183 | _PA_DEFINE_FUNC(snd_pcm_sw_params_set_xfer_align); 76 | ^~~~~~~~~~~~~~~ 77 In file included from /usr/include/alsa/asoundlib.h:54, 78 from /home/runner/work/portaudio/portaudio/src/hostapi/alsa/pa_linux_alsa.c:52: 79 /usr/include/alsa/pcm.h:1331:5: note: declared here 80 1331 | int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated)); 81 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 82 /home/runner/work/portaudio/portaudio/src/hostapi/alsa/pa_linux_alsa.c: In function ‘PaAlsa_LoadLibrary’: 83 /home/runner/work/portaudio/portaudio/src/hostapi/alsa/pa_linux_alsa.c:467:5: error: ‘snd_pcm_sw_params_set_xfer_align’ is deprecated [-Werror=deprecated-declarations] 84 467 | _PA_LOAD_FUNC(snd_pcm_sw_params_set_xfer_align); 85 | ^~~~~~~~~~~~~ 86 In file included from /usr/include/alsa/asoundlib.h:54, 87 from /home/runner/work/portaudio/portaudio/src/hostapi/alsa/pa_linux_alsa.c:52: 88 /usr/include/alsa/pcm.h:1331:5: note: declared here 89 1331 | int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated)); 90 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 cc1: all warnings being treated as errors 92 make[2]: *** [CMakeFiles/PortAudio.dir/build.make:230: CMakeFiles/PortAudio.dir/src/hostapi/jack/pa_jack.c.o] Error 1 93 make[2]: *** Waiting for unfinished jobs.... 94 cc1: all warnings being treated as errors 95 make[2]: *** [CMakeFiles/PortAudio.dir/build.make:272: CMakeFiles/PortAudio.dir/src/hostapi/alsa/pa_linux_alsa.c.o] Error 1 96 make[1]: *** [CMakeFiles/Makefile2:254: CMakeFiles/PortAudio.dir/all] Error 2 97 make: *** [Makefile:136: all] Error 2 98 Error: Process completed with exit code 2. |
Thanks for adding the -Werror to the CI. They caused CI to fail on the deprecated functions, which is good. We should fix the deprecated functions before we merge this PR. |
FYI I am proposing a slightly different approach in #780. |
The
-Werror
was added very long time ago: c1e1d06This flag is more suitable for running on CI or during development, but encumbers downstream packaging.
cc NixOS/nixpkgs#136060