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

Added build flag to disable pedantic builds #13256

Merged
merged 2 commits into from
Aug 13, 2022
Merged

Added build flag to disable pedantic builds #13256

merged 2 commits into from
Aug 13, 2022

Conversation

YuviTz1
Copy link
Contributor

@YuviTz1 YuviTz1 commented Jul 8, 2022

Added build flag DISABLE_WARNINGS which is OFF by default and disables warnings.

Potentially closes #13146

cameel
cameel previously requested changes Jul 18, 2022
Copy link
Member

@cameel cameel left a 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!

There are some things I'd change but overall this is going in a good direction.

CMakeLists.txt Outdated Show resolved Hide resolved
cmake/EthCompilerSettings.cmake Outdated Show resolved Hide resolved
cmake/EthCompilerSettings.cmake Show resolved Hide resolved
CMakeLists.txt Outdated
@@ -35,6 +35,7 @@ endif()
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
option(SOLC_STATIC_STDLIBS "Link solc against static versions of libgcc and libstdc++ on supported platforms" OFF)
option(STRICT_Z3_VERSION "Use the latest version of Z3" ON)
option(DISABLE_WARNINGS "Disable all warning flags, treating warnings as errors and all other pedantic build flags" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a note about this flag to the docs page about building from source.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@YuviTz1
Copy link
Contributor Author

YuviTz1 commented Jul 18, 2022

Thank you for the detailed review!
I'll do the necessary changes.

CMakeLists.txt Outdated
@@ -48,6 +49,9 @@ include_directories(SYSTEM ${JSONCPP_INCLUDE_DIR})

find_package(Threads)

if(NOT PEDANTIC)
message("-- Pedantic build flags turned off. Warnings will not make compilation fail. This is NOT recommended in development builds.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This is NOT recommended in development builds."

Shouldn't that NOT be recommended at all? It should probably say instead that this option should be only enabled when you know what you are doing - as in - "use with care!". What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it really only matters for development. These are warnings, not errors and on top of that only those that don't happen in most configurations (or we'd catch them in CI) so it's unlikely that they're harmful. The user building a release cannot do anything about them anyway.

Maybe we could just say that we recommend reporting warnings as issues in the repo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending to report an issue to us sounds good. Also unconditionally stating "This is NOT recommended." is ok with me, but also fine as is.
But we should at least make it a cmake warning, i.e. message(WARNING "....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to a warning.

@cameel
Copy link
Member

cameel commented Aug 5, 2022

The PR looks fine to me in the current form but the last thing that is missing is the extra bit of docs (#13256 (comment)). Other than that, we could merge it right away.

@cameel cameel dismissed their stale review August 5, 2022 16:05

Some stuff is missing but there are no issues to be fixed

@cameel cameel dismissed a stale review via b7847c9 August 11, 2022 13:44
@cameel
Copy link
Member

cameel commented Aug 11, 2022

I added a bit of docs about the new flag. The PR is complete now.

@cameel cameel self-assigned this Aug 11, 2022
@leonardoalt leonardoalt merged commit b175591 into ethereum:develop Aug 13, 2022
@cameel cameel mentioned this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake option to disable pedantic builds.
5 participants