-
Notifications
You must be signed in to change notification settings - Fork 37
Add TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR environment variable to disable -Werror compilation option #656
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
Conversation
…to disable 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.
Thanks for the PR @traversaro . That's fine with me. @scotts , any concern? Do you know if there's a more obvious way of achieving this?
Oh, I missed this sorry. @traversaro , can you try to update the minimum version to 3.18 and use |
Also I noticed you were working on building torchcodec for conda-forge - thank you for this!! |
Yeah, I'm good with this in principle. If we can use CMake features to achieve this instead of environment variables, that would be good too. |
Thanks for working on the
Sorry for the confusion, the minimum version is now 3.18, and we need to increase it to 3.24 to use
Unfortunately as far as I know there is no CMake environment variable that controls the To avoid the need to add a specific environment variable for each option that may be propagated from
A possible option is to support some similar env variable also in torchcodec. |
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.
Thanks for the details @traversaro , I understand now that we'll need a new env variable regardless of the CMAKE_COMPILE_WARNING_AS_ERROR
option. So the PR LGTM as-is.
Good point on a potential catch-all CMAKE option env var, we can add it in the future if we end up having the parametrize the cmake build a lot.
The
-Werror
option is typically enabled automatically by library authors, so they ensure that all contributors to the library early fail if new code they write contain a warning, ensuring as soon as possible that no new warnings are added to the library. This is the reason (I guess) why-Werror
was added in ttps://github.com//pull/452 . On the other hand, people that package libraries for distributions prefer to disable the-Werror
option, as they may want to compile a given library with a new compilers or new ffmpeg versions (that may not have even existed when a given release of a library was tagged), that introduce new warnings, without having a failure. For a detailed discussion of this from the point of view of people packaging libraries, see https://youtu.be/_5weX5mx8hc?si=ZtiWaK7KPTfQ01_g&t=322 .For example,
torchcodec
0.3.0 currently fails with error:when compiled against ffmpeg >=7.1.0, as the
supported_samplerates
deprecation was added in 7.1.0 .This PR leaves the default behavior as it is, but adds a
TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR
environment variable (and corresponding CMake variable) to permit to disable the-Werror
option.CMake provides the built-in CMake variable
CMAKE_COMPILE_WARNING_AS_ERROR
since CMake 3.24, but as the CMake minimum required version is 3.18, using a custom CMake option seems the solution with minimal complexity.Similar to PickNikRobotics/RSL#117 and ros-misc-utilities/ffmpeg_encoder_decoder#2 .