Discussion:
Bug#908078: should detect when 'nodoc' is active, then --with sphinxdoc should do nil
(too old to reply)
Nicholas D Steeves
2018-09-05 21:40:01 UTC
Permalink
Package: sphinx-common
Version: 1.7.8-1
Severity: normal

Part of the purpose of building with 'nodoc' is the omission of
build-deps. dh_sphinxdoc should detect when 'nodoc' is active, then
--with sphinxdoc should not attempt to do anything, other than print
that it is doing nothing, because 'nodoc' is active.

Steps to reproduce:

--- a/debian/control
+++ b/debian/control
, python3-mock <!nocheck>
, python3-nose <!nocheck>
, python3-pip <!nocheck>
- , python3-sphinx
- , texinfo
+ , python3-sphinx <!nodoc>
+ , texinfo <!nodoc>
Standards-Version: 4.2.1
Vcs-Browser: https://salsa.debian.org/emacsen-team/elpy
Vcs-Git: https://salsa.debian.org/emacsen-team/elpy.git

--- a/debian/rules
+++ b/debian/rules
# docs are not generated without this override
override_dh_auto_build:
dh_auto_build
- PYTHONPATH=. sphinx-build -N -bman docs/ build/man # Manpage generator
+# support the nodoc build profile
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+ echo -e "\nnodoc build profile enabled, therefor not building docs.\n"
+else
+ PYTHONPATH=. sphinx-build -N -bman docs/ build/man
PYTHONPATH=. sphinx-build -N -btexinfo docs/ build/info
makeinfo --no-split build/info/Elpy.texi -o build/info/elpy.info
cat NEWS.rst debian/local-var-snippet > build/NEWS
+endif


At this point dpkg-buildpackage will fail, because python3-sphinx is
not installed. Python3-sphinx is only installed when <!nodoc> is
true, which is part of the purpose of building with 'nodoc'. Of
course I was able to work around this issue by adding the following:

--- a/debian/rules
+++ b/debian/rules
export LC_ALL

%:
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+ echo -e "\nnodoc profile enabled, building without sphinxdoc..\n"
+ dh $@ --with elpa,python3 --buildsystem=pybuild
+else
dh $@ --with elpa,python3,sphinxdoc --buildsystem=pybuild
+endif


It would be best if dh_sphinxdoc had its own 'ifneq ($(filter
nodoc,$(DEB_BUILD_PROFILES)),)' logic. I suspect this is a trivially
easy fix that could even be tagged 'newcomer'.


Cheers,
Nicholas
Dmitry Shachnev
2018-09-06 10:10:01 UTC
Permalink
Control: reassign -1 debhelper 9.20160814
Control: severity -1 wishlist
Control: merge 836699 -1

Hi Nicholas!
Post by Nicholas D Steeves
Package: sphinx-common
Version: 1.7.8-1
Severity: normal
Part of the purpose of building with 'nodoc' is the omission of
build-deps. dh_sphinxdoc should detect when 'nodoc' is active, then
--with sphinxdoc should not attempt to do anything, other than print
that it is doing nothing, because 'nodoc' is active.
[...]
It would be best if dh_sphinxdoc had its own 'ifneq ($(filter
nodoc,$(DEB_BUILD_PROFILES)),)' logic. I suspect this is a trivially
easy fix that could even be tagged 'newcomer'.
dh_sphinxdoc already exits with status 0 (and a warning) when there is no
Sphinx documentation built.

I suppose what you really want is a dh sequencer option to not call
dh_sphinxdoc when the nodoc profile is active. It is absolutely out of
our control, as sphinx packages cannot change debhelper behavior when
they are not even installed.

Therefore I am reassigning this bug to debhelper. I am also merging it
with #836699 because if the proposed idea [1] for fixing it is implemented,
you will be able to control activation of dh_sphinxdoc using only build
dependencies.

[1]: https://nthykier.wordpress.com/2018/03/04/prototyping-a-new-packaging-papercut-fix-dry-debhelper-compat-level/

--
Dmitry Shachnev
Nicholas D Steeves
2019-08-11 22:50:01 UTC
Permalink
Hi Dmitry,

So sorry for my extremely belated reply! This one fell through the
cracks.
Post by Dmitry Shachnev
Control: reassign -1 debhelper 9.20160814
Control: severity -1 wishlist
Control: merge 836699 -1
Hi Nicholas!
Post by Nicholas D Steeves
Package: sphinx-common
Version: 1.7.8-1
Severity: normal
Part of the purpose of building with 'nodoc' is the omission of
build-deps. dh_sphinxdoc should detect when 'nodoc' is active, then
--with sphinxdoc should not attempt to do anything, other than print
that it is doing nothing, because 'nodoc' is active.
[...]
It would be best if dh_sphinxdoc had its own 'ifneq ($(filter
nodoc,$(DEB_BUILD_PROFILES)),)' logic. I suspect this is a trivially
easy fix that could even be tagged 'newcomer'.
dh_sphinxdoc already exits with status 0 (and a warning) when there is no
Sphinx documentation built.
I suppose what you really want is a dh sequencer option to not call
dh_sphinxdoc when the nodoc profile is active. It is absolutely out of
our control, as sphinx packages cannot change debhelper behavior when
they are not even installed.
Yes, that's what I'm overriding in d/rules. Thank you for identifying
and triaging to the appropriate package :-)
Post by Dmitry Shachnev
Therefore I am reassigning this bug to debhelper. I am also merging it
with #836699 because if the proposed idea [1] for fixing it is implemented,
you will be able to control activation of dh_sphinxdoc using only build
dependencies.
[1]: https://nthykier.wordpress.com/2018/03/04/prototyping-a-new-packaging-papercut-fix-dry-debhelper-compat-level/
Dear debhelper maintainers, RFC please?


Regards,
Nicholas
Dmitry Shachnev
2019-08-12 13:10:03 UTC
Permalink
Hi Nicholas!
Post by Nicholas D Steeves
Post by Dmitry Shachnev
Therefore I am reassigning this bug to debhelper. I am also merging it
with #836699 because if the proposed idea [1] for fixing it is implemented,
you will be able to control activation of dh_sphinxdoc using only build
dependencies.
[1]: https://nthykier.wordpress.com/2018/03/04/prototyping-a-new-packaging-papercut-fix-dry-debhelper-compat-level/
Dear debhelper maintainers, RFC please?
The idea mentioned in the bottom of that post was implemented, *however*
it did not make the situation better. As dh(1) says:

| A Build-Depends relation on the package dh-sequence-addon implies a --with
| addon. [...] Build-Depends-Indep and Build-Depends-Arch are deliberately
| unsupported.

So for now your options are:

1) Running dh_sphinxdoc manually (e.g. in override_dh_installdocs).
2) Build-Depending on sphinx-common so that dh_sphinxdoc is always available.
3) Using tricks like https://bugs.debian.org/836699#12.

--
Dmitry Shachnev

Loading...