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

Fail build if compiling extensions raises warnings #1953

Closed
nateberkopec opened this issue Sep 9, 2019 · 1 comment · Fixed by #2494
Closed

Fail build if compiling extensions raises warnings #1953

nateberkopec opened this issue Sep 9, 2019 · 1 comment · Fixed by #2494

Comments

@nateberkopec
Copy link
Member

No description provided.

@hahmed
Copy link
Contributor

hahmed commented Nov 2, 2019

Had a look at ragel options that we can pass to the Rakefile in but nothing there for failing on warnings, any ideas on what other approach we can use?

puma master % ragel --help
usage: ragel [options] file
general:
   -h, -H, -?, --help   Print this usage and exit
   -v, --version        Print version information and exit
   -o <file>            Write output to <file>
   -s                   Print some statistics on stderr
   -d                   Do not remove duplicates from action lists
   -I <dir>             Add <dir> to the list of directories to search
                        for included an imported files
error reporting format:
   --error-format=gnu   file:line:column: message (default)
   --error-format=msvc  file(line,column): message
fsm minimization:
   -n                   Do not perform minimization
   -m                   Minimize at the end of the compilation
   -l                   Minimize after most operations (default)
   -e                   Minimize after every operation
visualization:
   -x                   Run the frontend only: emit XML intermediate format
   -V                   Generate a dot file for Graphviz
   -p                   Display printable characters on labels
   -S <spec>            FSM specification to output (for graphviz output)
   -M <machine>         Machine definition/instantiation to output (for graphviz output)
host language:
   -C                   The host language is C, C++, Obj-C or Obj-C++ (default)
   -D                   The host language is D
   -Z                   The host language is Go
   -J                   The host language is Java
   -R                   The host language is Ruby
   -A                   The host language is C#
   -O                   The host language is OCaml
line directives: (C/D/Ruby/C#/OCaml)
   -L                   Inhibit writing of #line directives
code style: (C/D/Java/Ruby/C#/OCaml)
   -T0                  Table driven FSM (default)
code style: (C/D/Ruby/C#/OCaml)
   -T1                  Faster table driven FSM
   -F0                  Flat table driven FSM
   -F1                  Faster flat table-driven FSM
code style: (C/D/C#/OCaml)
   -G0                  Goto-driven FSM
   -G1                  Faster goto-driven FSM
code style: (C/D)
   -G2                  Really fast goto-driven FSM
   -P<N>                N-Way Split really fast goto-driven FSM

btw I noticed when compiling via bundle exec rake compile we have a warning;

puma master % bundle exec rake compile
cd tmp/x86_64-darwin18/puma_http11/2.5.0
/usr/bin/make
compiling ../../../../ext/puma_http11/http11_parser.c
compiling ../../../../ext/puma_http11/io_buffer.c
compiling ../../../../ext/puma_http11/mini_ssl.c
compiling ../../../../ext/puma_http11/puma_http11.c
../../../../ext/puma_http11/puma_http11.c:203:22: warning: implicitly declaring library function 'isspace' with type 'int (int)'
      [-Wimplicit-function-declaration]
  while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
                     ^
../../../../ext/puma_http11/puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 warning generated.
linking shared-object puma/puma_http11.bundle
cd -
cp History.md tmp/x86_64-darwin18/stage/History.md
cp README.md tmp/x86_64-darwin18/stage/README.md
cp ext/puma_http11/http11_parser.c tmp/x86_64-darwin18/stage/ext/puma_http11/http11_parser.c
cp lib/puma/configuration.rb tmp/x86_64-darwin18/stage/lib/puma/configuration.rb
cp lib/puma/launcher.rb tmp/x86_64-darwin18/stage/lib/puma/launcher.rb
install -c tmp/x86_64-darwin18/puma_http11/2.5.0/puma_http11.bundle lib/puma/puma_http11.bundle
cp tmp/x86_64-darwin18/puma_http11/2.5.0/puma_http11.bundle tmp/x86_64-darwin18/stage/lib/puma/puma_http11.bundle

Which can be fixed by adding the header file <ctype.h> into ext/puma_http11/puma_http11.c shall I fix that warning?

With the header file here is the output;

puma master % bundle exec rake compile
cd tmp/x86_64-darwin18/puma_http11/2.5.0
/usr/bin/make
compiling ../../../../ext/puma_http11/puma_http11.c
linking shared-object puma/puma_http11.bundle
cd -
cp ext/puma_http11/puma_http11.c tmp/x86_64-darwin18/stage/ext/puma_http11/puma_http11.c
install -c tmp/x86_64-darwin18/puma_http11/2.5.0/puma_http11.bundle lib/puma/puma_http11.bundle
cp tmp/x86_64-darwin18/puma_http11/2.5.0/puma_http11.bundle tmp/x86_64-darwin18/stage/lib/puma/puma_http11.bundle

rubenochiavone added a commit to rubenochiavone/puma that referenced this issue Nov 25, 2020
Make warning into errors and also fix all compiler warnings reported in
mini_ssl source code.
rubenochiavone added a commit to rubenochiavone/puma that referenced this issue Dec 1, 2020
Make warning into errors and also fix all compiler warnings reported in
mini_ssl source code.
nateberkopec pushed a commit that referenced this issue Dec 1, 2020
* Fail build if compiling extensions raises warnings (#1953)

Make warning into errors and also fix all compiler warnings reported in
mini_ssl source code.

* Fix some compiler warnings and errors reported by checks

* Add MAKE_WARNINGS_INTO_ERRORS env variable

MAKE_WARNINGS_INTO_ERRORS environment variable toggles whether a build should
treat all warnings into errors or not.

Move appending WERRORFLAG to cflags after OpenSSL methods verification because
on some specifics builds this causes mkmf to wrongly detect methods in OpenSSL
headers.

* Add noentry to write date to avoid unused variables

* Ignore implicit-fallthrough warnings

Those warnings are related to ragel state machine generated code.

* Enforce no warnings on GH Actions

* Update History.md file reflecting latest changes
JuanitoFatas pushed a commit to JuanitoFatas/puma that referenced this issue Sep 9, 2022
…2494)

* Fail build if compiling extensions raises warnings (puma#1953)

Make warning into errors and also fix all compiler warnings reported in
mini_ssl source code.

* Fix some compiler warnings and errors reported by checks

* Add MAKE_WARNINGS_INTO_ERRORS env variable

MAKE_WARNINGS_INTO_ERRORS environment variable toggles whether a build should
treat all warnings into errors or not.

Move appending WERRORFLAG to cflags after OpenSSL methods verification because
on some specifics builds this causes mkmf to wrongly detect methods in OpenSSL
headers.

* Add noentry to write date to avoid unused variables

* Ignore implicit-fallthrough warnings

Those warnings are related to ragel state machine generated code.

* Enforce no warnings on GH Actions

* Update History.md file reflecting latest changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants