-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Treat warnings as errors #379
Conversation
f608b1f
to
e2eb270
Compare
build_extra/flatbuffers/BUILD.gn
Outdated
@@ -13,6 +13,7 @@ config("flatbuffers_config") { | |||
cflags = [ | |||
"-Wno-exit-time-destructors", | |||
"-Wno-header-hygiene", | |||
"-Wno-return-type", # TODO: rust branch of flatbuffers has this warning. this should be removed when the branch fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap at 80 characters. ./tools/format.py
should take care of this.
build_extra/rust/rust.gni
Outdated
@@ -40,6 +40,7 @@ template("run_rustc") { | |||
|
|||
args = [ | |||
rebase_path(source_root, root_build_dir), | |||
"-Dwarnings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Can you add this conditionally based on treat_warnings_as_errors ?
build_extra/rust/BUILD.gn
Outdated
# suppress some warnings | ||
"-Aunused-imports", | ||
"-Adeprecated", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this module have these warnings? Do the authors not care (seems unlikely) or are we compiling it with the wrong cfg? Can you investigate further? If it's their issue, please open an issue with them and link to the issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They seem caused by the line use std::ascii::AsciiExt;
. The module seems deprecated at recent version of rust. Their build of master branch also shows the same warnings. So I think it's not a problem of our configuration.
I think this should be fixed in their repository. I filed an issue there. servo/rust-url#455
@@ -102,6 +103,10 @@ template("run_rustc") { | |||
} | |||
} | |||
|
|||
if (defined(invoker.args)) { | |||
args += invoker.args | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to add this... but it's fine if you can't fix the warnings in percent_encoding
Great! Thank you! |
68b4a3e
to
6321063
Compare
.gn
Outdated
@@ -25,7 +25,7 @@ default_args = { | |||
|
|||
is_component_build = false | |||
symbol_level = 1 | |||
treat_warnings_as_errors = false | |||
treat_warnings_as_errors = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line?
build_extra/rust/BUILD.gn
Outdated
# TODO: Suppress some warnings at this moment | ||
# This should be removed when it's fixed in servo/rust-url repository | ||
"-Aunused-imports", | ||
"-Adeprecated", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to the issue you created here
I reverted the following part because it doesn't seem working. if (defined(treat_warnings_as_errors) && treat_warnings_as_errors) {
args += [ "-Dwarnings" ]
} ( |
LGTM @piscisaureus please check this works for you. |
It doesn't work for me. On linux I get a lot of errors like this:
On windows it breaks here:
|
@piscisaureus |
@kt3k I have to warn you, I do get a lot more warning, especially on linux.
|
@kt3k if it gets difficult to keep up with rebases we can land a partial fix now with these changes but without turning on |
The build args in I'm going to try some more variations for a while. |
@ry @piscisaureus When I set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This resolves #374.
This PR depends on #371. I'm going to rebase it if #371 gets merged.