-
Notifications
You must be signed in to change notification settings - Fork 168
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
Checking compiler warnings as errors on CI #626
Comments
I would close this ticket for now. When I am ready to send the pull-request for this feature, I reopen this ticket. |
Reopened this feature ticket, as I am almost ready to send the pull-request. I am working on the branch, https://github.com/junaruga/openssl/tree/wip/check-compiler-warnings. |
The issue #628 was found related to the |
Note #603 (comment) . |
I'm sure the benefits of 1. will outweigh the risk of 2. Trivial C errors slipping through a review have happened many times! 👍 |
I am happy to see that you are positive about this feature. :) I want to consider a logic to turn off of checking the compiler warnings on the GitHub Actions yaml file. It's useful when we see new compiler warnings from new compiler or new OpenSSL or etc, and if we cannot fix the warnings soon, and these warning checks block the CI pipelines. |
I am thinking how to check compiler warnings as errors on CI in a better way. It can be possible by adding the
-Werror
flag to compiler flags. My intention is that this issue ticket manages a feature to check compiler warnings on CI in some way.My motivation is ..
It's difficult to avoid the 2 completely. However, I believe that we can reduce the effort by only adding the
-Werror
except the*head
(head
andtrufflerruby-head
) Ruby on CI.Proof of concept: Set via
MAKEFLAGS
My first proof of concept is to add
-Werror
via environment variableMAKEFLAGS
.You can check the
mkmf.rb
and the generatedMakefile
. Right now every variables are reserved for the specific purposes.Right now I experimented by setting
ARCH_FLAG=-Werror
. Note theARCH_FLAG
is already used for such as-m64
flag. So, I think we shouldn't use the variable in the real case. Below is the modification. And the CI result is here. You see the macOS Ruby 2.6 and trufflerruby-head cases are failing due to the compiler warnings.Right now the
mkmf.rb
has 3 methodsappend_cflags
,append_cppflags
,append_ldflags
.So, perhaps we can modify the
mkmf.rb
like this.A challenge of this idea is that
MAKEFLAGS
is the specification of (GNU?) make. I see this way doesn't work in GitHub Actions Windows cases.Set via `ruby /path/to/extconf.rb -- with-someting
We can implement the following extra options to the
ruby /path/to/extconf.rb
. Right now themkmf.rb
has 3 methodsappend_cflags
,append_cppflags
,append_ldflags
. And the 3 extra options are same with the 3 methods.--with-append-cflags="something"
--with-append-cppflags="something"
--with-append-ldflags="something"
We can use
ruby /path/to/extconf.rb -- --with-append-cflags="-Werror"
to append the-Werror
to the existing cflags.There is a similar implementation for the
--with-cflags
that overrides the CFLAGS.Maybe here is the code that sets the value of the
--with-cflags
.https://github.com/ruby/ruby/blob/6d976eb5348098a346d82065621e37925acae8b8/lib/mkmf.rb#L2604
The text was updated successfully, but these errors were encountered: