• Bug#1064593: Bug#1066967: Bug#1064593: Bug#1066967: dh_sphinxdoc: repla

    From Dmitry Shachnev@21:1/5 to Holger Wansing on Fri Mar 22 14:10:02 2024
    XPost: linux.debian.policy

    On Fri, Mar 22, 2024 at 01:46:48PM +0100, Holger Wansing wrote:
    [...]
    Anyway, the symlink points to some path inside the package build path, here: /srv/debian-policy/debian-policy-4.6.2.1/debian/debian-policy/usr/share/sphinx_rtd_theme_static/css/theme.css

    and that path does not exist.
    Same in the debian-policy binary package.

    This is expected. The path in the build tree is relative in a way that when
    a package is built and installed, it becomes working.

    The symlink is generated relative per Policy 10.5. And I think that even if dh_sphinxdoc generated it as absolute, dh_link would later change it to relative.

    If you are trying to rely on something that is in the build directory, you
    have to turn relative symlinks into absolute ones on your own. Or just don't call dh_sphinxdoc, then you will get normal files.

    --
    Dmitry Shachnev

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEq2sdvrA0LydXHe1qsmYUtFL0RrYFAmX9gcsACgkQsmYUtFL0 RrYHkA/9HSJ6el+k/iQ8tXZ1+HLuGApJmTge+PZ8qnb6kP5FifdYMezMLRvYSlNQ zCInwCIAcP05OxgOVt8uz6S+/j/iMrBX7qSadKDXuLLGUMYAabv2zcTi86dMcpFB /U5EncQn6ZMkRocHK2iNh3ltP67QVCIx03KQF3KoQZ5cpZAG0cXxQlzXnmHFNuBr 5uhYUt5ElnMr2O0CINnTsjxA9AF65HZmh3Sj0L22Bx6TzlGsMWtJ7s1bo4vALVtL 1xHas0g97TvzKsUS59zTAS/ffsGk4Nfzjm3cnJOoCG0JqEOIQdBlyIiIfNVOCU9I wk0de2T9lP1f7CcLZhWeLOEYUQXwKNsoyjXaoNQ+PXOGV+hiN4beH0xR5D1S0t5X 7zITP5dAWyJXrJz8hEI7Oe6Cw1H8Vfou7JFCj5Lhbr8x9H8kkLre+kog3n6RNXsH EKllPuch3iGg/f0sVcv5ukQQ8BAqdmDDrpdiN3v+D/Pi/BTm9B9taaaRd+yfdycF 27GyKwPjhasTj8LUnmeU5y+dJm6q3+rjj4bG7okk/efIB8VLdy4e+CQaDnP3Wpqb dsdF01W7kakhlnP4YFTi1IuLLbsTePcINw6lQOhubpg6T8P6ZME38Xr7iqq0C+8l n7ZEMA+UwTjgiZCEFK9ukD4qIC70s3ugKikSAnCrpLycQOjbMAc=
    =+nRn
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Holger Wansing@21:1/5 to Dmitry Shachnev on Fri Mar 22 15:40:01 2024
    XPost: linux.debian.policy

    Hi,

    Dmitry Shachnev <mitya57@debian.org> wrote (Fri, 22 Mar 2024 16:04:14 +0300):
    On Fri, Mar 22, 2024 at 01:46:48PM +0100, Holger Wansing wrote:
    [...]
    Anyway, the symlink points to some path inside the package build path, here:
    /srv/debian-policy/debian-policy-4.6.2.1/debian/debian-policy/usr/share/sphinx_rtd_theme_static/css/theme.css

    and that path does not exist.
    Same in the debian-policy binary package.

    This is expected. The path in the build tree is relative in a way that when
    a package is built and installed, it becomes working.

    Ok, I see.
    So, we will need to get sphinx-rtd-theme-common installed on all debian.org website mirrors, and it will just work (?) ...

    The symlink is generated relative per Policy 10.5. And I think that even if dh_sphinxdoc generated it as absolute, dh_link would later change it to relative.

    If you are trying to rely on something that is in the build directory, you have to turn relative symlinks into absolute ones on your own. Or just don't call dh_sphinxdoc, then you will get normal files.

    ... or we switch away from dh_sphinxdoc.
    But there was already a hint, why this is a bad idea.
    Will need to be evaluated...



    Thanks for your time, guys!

    Holger


    --
    Holger Wansing <hwansing@mailbox.org>
    PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry Shachnev@21:1/5 to Holger Wansing on Fri Mar 22 17:00:02 2024
    XPost: linux.debian.policy

    Hi,

    On Fri, Mar 22, 2024 at 03:30:55PM +0100, Holger Wansing wrote:
    Ok, I see.
    So, we will need to get sphinx-rtd-theme-common installed on all debian.org website mirrors, and it will just work (?) ...

    From your earlier message it seemed to me like you are using the build
    tree in your deploy process, not the built package.

    That is why I suggested not running dh_sphinxdoc, however my suggestion
    applied only to your deploy procedure. The package which is being uploaded
    to Debian archive should still use dh_sphinxdoc.

    If you are using the built package and installing it on the remote server,
    then yes, install sphinx-rtd-theme-common and you should be good.

    Actually, I would move ${sphinxdoc:Depends} from Recommends to Depends,
    because the documentation is mostly unusable without the static files.

    --
    Dmitry Shachnev

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEq2sdvrA0LydXHe1qsmYUtFL0RrYFAmX9p84ACgkQsmYUtFL0 RrZfkBAAoJcBuOzenXAcJEfnLc0Hd8taF15OuvrvIiuWPGebtrkUWtXZcjVddk4d 3+QfWZXDldzekaJyTKtKBQ8wfHvQI4vm+ndRBzcLSk+Z1nU5nPEH62w/Q2nduvLL +MbS/V9sGIVb5Atrt4cqKD0JyVZGWPhT9IM56skjJnZRKHjqe4QHZblTgy16ZS/5 86hq8RBdGHH3JG0kx7mJ/FROVdPBYAyXeMFfnoFzbYvymz8HIsXMhvgspNemmyIk A3ecGGAL1oEBqlcsgzKjXcSnF+kkJ4O8OMqWn0d1CqYh7gZhQ+42O51rOuwpE303 8fHm9IVieTBxDiS9Ize3ayriaZ0e687WA/Ato8oBujaVxFPIPQf5TsDsC/k6IF9A LieiV6/M8GaFXqF9/PHGTPSo+1yvziRvSgFx+9rjKXm5vyg/jLcczs3ZemZrNgoi MhheU7GZn7QE4NqRkYFaQqgIcpZwsa2T5O0WQvZmkNhNe9zqVDVJlGyHGMAS0etZ IxajezO1E4PCYT/0ZQxr8sTPXEKkbMHReWceOor3ss+VRsPq9YFmFSMPcO9nuFya Gh3t3jpUnqeAIHGL2R1+rpW+vQ4yDbAjHsqq4BW6+0DQPWDYRsByUWu5g+rAIcGG AVl8nlZRdXYbHISJh2v1WExxGtfkL5Oc84HKtqb3WZqDL/AcXHI=
    =hNba
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Holger Wansing@21:1/5 to Dmitry Shachnev on Sat Mar 23 17:20:01 2024
    XPost: linux.debian.policy

    This is a multi-part message in MIME format.

    Hi,

    Dmitry Shachnev <mitya57@debian.org> wrote (Fri, 22 Mar 2024 18:46:25 +0300):
    On Fri, Mar 22, 2024 at 03:30:55PM +0100, Holger Wansing wrote:
    Ok, I see.
    So, we will need to get sphinx-rtd-theme-common installed on all debian.org website mirrors, and it will just work (?) ...

    From your earlier message it seemed to me like you are using the build
    tree in your deploy process, not the built package.

    That is why I suggested not running dh_sphinxdoc, however my suggestion applied only to your deploy procedure. The package which is being uploaded
    to Debian archive should still use dh_sphinxdoc.

    If you are using the built package and installing it on the remote server, then yes, install sphinx-rtd-theme-common and you should be good.

    While working on adapting the parts/7doc script (from Debian Webmaster
    Team's 'cron' repo), I realized that this is not going to work out of the
    box: while the concept of the symlinks mentioned above is working fine,
    when the debian-policy document is installed on a machine as usual
    (means it recides in the same path as in the binary deb package, aka /usr/share/doc/debian-policy/policy.html), we have the docs for the website
    on the debian.org website machine in another path. That is in /srv/www.debian.org/www/doc/debian-policy/.

    That means the (relative) symlinks will not resolve!
    Therefore I think the best solution here is, to change the relative
    symlinks into absolute ones, on the debian.org website machine.

    I have worked out the needed changes for cron/parts/7doc to deal with all
    this (it works fine here locally). The debian-policy package could stay unchanged.
    I attach the patch here just for reference; will apply it, as soon as sphinx-rtd-theme-common gets installed on wolkenstein
    (working on a bugreport to DSA to get this done).

    Closing #1066967 against sphinx-common/dh_sphinxdoc now.
    Thanks python people for your help!

    Actually, I would move ${sphinxdoc:Depends} from Recommends to Depends, because the documentation is mostly unusable without the static files.

    Ok. I will leave this mostly to Debian Policy maintainers.



    Greetings
    Holger

    --
    Holger Wansing <hwansing@mailbox.org>
    PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076

    diff --git a/parts/7doc b/parts/7doc
    index b079aea..5a358d7 100755
    --- a/parts/7doc
    +++ b/parts/7doc
    @@ -260,22 +260,24 @@ if [ "$lang" = "en" ]; then
    install -p -m 664 `readlink -f $page` $destdir/Common_Content/images/$(basename $page)
    fi
    done
    fi
    }

    #############################################################################

    mvhtml_sphinx()
    {
    -# Copy of mvhtml(), modified so it copies the _images and _static subfolders too
    -# This is needed by debian-policy since they moved to reStructuredText and Sphinx
    +# Copy of mvhtml(), modified so it copies the _images, _sources, _static, _static/css
    +# and _static/fonts subfolders too.
    +# This is needed by some manuals which moved to reStructuredText and Sphinx
    +# (like debian-policy and developers-reference) and use an html theme from read-the-docs.
    # This is probably uncomplete, since the _static folder contains symlinks to
    # some javascript that probably will not work.

    namedest=$1 # destdir directory: maint-guide
    basedir=$2 # binary package data dir.: usr/share/doc/maint-guide-f