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

`sphinx-build -n -W` doesn't treat nitpicky warnings as errors #3919

Closed
goosemania opened this issue Jul 10, 2017 · 8 comments
Labels
Milestone

Comments

@goosemania
Copy link
Contributor

@goosemania goosemania commented Jul 10, 2017

Problem

In sphinx 1.5 when -n (nitpicky mode) and -W (treat warnings as errors) are used together, all the warnings including the ones which come from nitpicky mode will throw an error and fail a build. That's the expected behavior.

It's no longer a case in 1.6, all the warnings for missing references are left as just warnings and they don't fail a build, even with -W flag.

Environment info

  • OS: Fedora 25
  • Python version: 3.5.3
  • Sphinx version: 1.6.3
@TimKam

This comment has been minimized.

Copy link
Member

@TimKam TimKam commented Aug 17, 2017

I tried to reproduce this, but couldn't. Can you point to/provide an example project?

@goosemania

This comment has been minimized.

Copy link
Contributor Author

@goosemania goosemania commented Aug 17, 2017

@TimKam , thanks for looking into it!
Right now I can provide a link to the project where the issue can be seen, I hope it's not too complicated for investigation. I can try to create a smaller reproducer but later (in several weeks). But with the following project it is easily reproducible, sphinx 1.5 works as expected, 1.6 - does not convert warnings to errors.

The affected project:
git clone -b 3.0-dev https://github.com/pulp/pulp.git

@TimKam

This comment has been minimized.

Copy link
Member

@TimKam TimKam commented Aug 19, 2017

The setup is fairly complex and ad-hoc I can't find any obvious issue.
If you provide a smaller docs example that doesn't require a full Django setup, I'll take another look asap.

@jschueller

This comment has been minimized.

Copy link
Contributor

@jschueller jschueller commented Aug 22, 2017

@goosemania maybe you could try to bisect the problem to find the commit that broke this.

@jschueller

This comment has been minimized.

Copy link
Contributor

@jschueller jschueller commented Aug 25, 2017

hello @goosemania,
I just tested your example, nitpick works well here in both 1.5.5 and 1.6.3, so I cannot reproduce the issue.

Here's the script to build it (ubuntu 16.04):

#!/bin/sh

cd /tmp
if ! test -d sphinx
then
  git clone https://github.com/sphinx-doc/sphinx.git
fi
cd sphinx
git checkout 1.5.6
# git checkout 1.6.3
rm -rf ~/.local/lib/python3.5/sphinx* ~/.local/lib/python3.5/Sphinx*
python3 setup.py install --user
cd ..

if ! test -d pulp
then
  git clone https://github.com/pulp/pulp.git
fi
cd pulp
cd docs
make html SPHINXBUILD=/usr/bin/sphinx-build3 SPHINXOPTS="-W -n"
@tsouvarev

This comment has been minimized.

Copy link

@tsouvarev tsouvarev commented Sep 22, 2017

Seems like Django somehow intercepting logging, thus creating this issue.

Project to reproduce: https://github.com/tsouvarev/sphinx-broken-nitpicky-example

If run make html standing on the latest commit, you won't get any errors, thou source/index.rst contains broken reference. If you comment lines 138-142 in nitpicky/settings.py, you will finally get compilation error.

@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Sep 26, 2017

@tsouvarev Thank you for your help. I understand the reason of this problem.

Since Sphinx-1.6, Sphinx uses standard logging module internally to show all messages including errors and warnings. But the settings of these apps retets its settings. So all messages are not shown and ignored.

I'll continue to investigate this.

@tk0miya tk0miya added this to the 1.6.5 milestone Sep 26, 2017
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 22, 2017
@tk0miya tk0miya modified the milestones: 1.6.5, 1.6.6 Oct 22, 2017
tk0miya added a commit that referenced this issue Oct 23, 2017
Fix #3919: become silent if logging settings are cleared
@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Oct 23, 2017

Fixed by #4180
Thank you for reporting

@tk0miya tk0miya closed this Oct 23, 2017
dparalen added a commit to dparalen/pulp that referenced this issue Jan 12, 2018
Sphinx in 1.6.6 fixed a regression that would allow doc build warnings to
pass unnoticed[1].  Thus having updated Sphinx would have broken one's
Pulp docs build.

This patch addresses the doc build warnings as well as fixes a broken link
here and there.

[1] sphinx-doc/sphinx#3919

closes: pulp#3275
https://pulp.plan.io/issues/3275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.