solidity icon indicating copy to clipboard operation
solidity copied to clipboard

CMake option to disable pedantic builds.

Open ekpyron opened this issue 2 years ago • 7 comments

We add a lot of compiler flags that make the builds as strict and pedantic as possible.

While that's very good for our development and CI, this can be annoying for end users and for dependent projects. We should add a CMake option that disables all warning flags, treating warnings as errors and all other pedantic build flags in cmake/EthCompilerSettings.cmake.

The flag should be off by default (i.e. the build should be strict and pedantic by default) and should maybe even explicitly emit a "use at your own risk" warning when switched on, but we should still have it.

ekpyron avatar Jun 15 '22 09:06 ekpyron

Yeah. This would have helped with #12408, where an option to locally disable -Werror was requested.

cameel avatar Jun 15 '22 09:06 cameel

While that's very good for our development and CI, this can be annoying for end users and for dependent projects. We should add a CMake option that disables all warning flags, treating warnings as errors and all other pedantic build flags in cmake/EthCompilerSettings.cmake.

But the source code is not integrated by other projects, so in what context is this happening?

axic avatar Jul 11 '22 11:07 axic

Some projects do depend on the compiler binary and build it themselves. Fe is an example.

cameel avatar Jul 11 '22 12:07 cameel

What is the reason to build it themselves, and what reasonable compiler would fail on it?

axic avatar Jul 11 '22 12:07 axic

I just checked and their build instructions say that Fe depends on cburgdorf/solc-rust, which seems to be a fork of your lib. So it seems like they're not really building solc executable as I thought but just a crate with bindings. I suppose they can't just use our release binaries for that.

And as for failing on these warnings - our CI does not cover 100% of all possible configurations. We don't build with all boost versions, we don't build on 32-bit, we don't build on FreeBSD, etc. And these are just things for which we've had recent reports about breakage due to warnings treated as errors.

cameel avatar Jul 11 '22 18:07 cameel

It happens a lot on compiler updates and it's better to be able to tell people who then file issues about it (after looking at the situation) that it's safe to disable the pedantic option rather than having them manually mess with the build system or tell them to wait for a fix or even a new release...

ekpyron avatar Aug 05 '22 12:08 ekpyron

And if pedantic checks are enabled by default and in CI, this entails no safety loss. So I say we can go ahead with this.

ekpyron avatar Aug 05 '22 12:08 ekpyron