solidity
solidity copied to clipboard
CMake option to disable pedantic builds.
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.
Yeah. This would have helped with #12408, where an option to locally disable -Werror
was requested.
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?
Some projects do depend on the compiler binary and build it themselves. Fe is an example.
What is the reason to build it themselves, and what reasonable compiler would fail on it?
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.
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...
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.