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

Pass --warn-error to Odoc #3018

Closed
wants to merge 11 commits into from
Closed

Conversation

Julow
Copy link
Contributor

@Julow Julow commented Jan 9, 2020

Hi !

The --warn-error option has been added to Odoc to turn warnings into errors (not yet released).
This PR add support for it in Dune.

By default the flag is not passed to Odoc, this can be changed with this in dune-project:

(odoc_warn_error true)

This flag is never passed in release mode.

Enabling this option and having an Odoc version that doesn't support it is an error. (no attempt is made to catch this)

@nojb
Copy link
Collaborator

nojb commented Jan 9, 2020

Why not handle this as we do for ocamlc_flags, ocamlopt_flags and now also menhir_flags ? That is, why not add odoc_flags to the environment as well?

@Julow
Copy link
Contributor Author

Julow commented Jan 9, 2020

Not all Odoc commands take the --warn-error flag (this is probably a mistake) and Odoc commands have very few common options (so we would need at least odoc_compile_flags and odoc_html_flags).
Not exposing Odoc flags to the user allows Dune to change if they should be passed by default in the future.

@Julow Julow force-pushed the odoc_warn_error_project branch from 33f88b6 to f6a19e8 Compare January 9, 2020 14:36
Signed-off-by: Jules Aguillon <juloo.dsi@gmail.com>
@ghost
Copy link

ghost commented Jan 13, 2020

This feels like more like a field for (env ...) than for the dune-project file though. In particular, so that we can choose different settings based on the build profile. The default could follow the default for ocaml compilation: warnings are errors only in dev mode

@Julow
Copy link
Contributor Author

Julow commented Jan 13, 2020

I opened an other PR for using (env ..): #3029
This PR can be closed.

@Julow Julow closed this Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants