• [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken r

    From Hans de Graaff@21:1/5 to All on Fri Jul 15 12:20:01 2022
    Skip building documentation rather than generating an error when rdoc is missing but documentation is requested. rdoc should not be missing
    normally, but this is a common problem when updating from one ruby
    target straight to another one. There can be a gap when eselect has not
    been triggered again yet for rdoc and another core ruby package may
    require rdoc. This is commonly bundler since it has a +doc USE flag.

    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    ---
    eclass/ruby-fakegem.eclass | 9 +++++++--
    1 file changed, 7 insertions(+), 2 deletions(-)

    diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
    index 6f561f4f6a2f..64c285d70559 100644
    --- a/eclass/ruby-fakegem.eclass
    +++ b/eclass/ruby-fakegem.eclass
    @@ -458,8 +458,13 @@ all_fakegem_compile() {
    rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
    ;;
    rdoc)
    - rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
    - rm -f doc/js/*.gz || die "failed to remove duplicated compressed javascript files"
    + rdoc=$(type -p rdoc)
    + if [[ -x ${rdoc} ]]; then
    + ${rdoc} ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
    + rm -f doc/js/*.gz || die "failed to remove duplicated compressed javascript files"
    + else
    + ewarn "No executable rdoc found, skipping documentation"
    + fi
    ;;
    yard)
    yard doc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
    --
  • From Sam James@21:1/5 to All on Fri Jul 15 14:10:01 2022
    On 15 Jul 2022, at 11:17, Hans de Graaff <graaff@gentoo.org> wrote:

    Skip building documentation rather than generating an error when rdoc is missing but documentation is requested. rdoc should not be missing
    normally, but this is a common problem when updating from one ruby
    target straight to another one. There can be a gap when eselect has not
    been triggered again yet for rdoc and another core ruby package may
    require rdoc. This is commonly bundler since it has a +doc USE flag.


    I worry a bit about silently skipping given it can go further
    and lead to e.g. unpredictably broken binpkgs.

    I'd probably prefer not doing +doc but I assume it's there
    for a reason.

    Anyway, the situation is what it is until we get a ruby-exec
    or similar, so go for it. Thanks for figuring out a workaround,
    as this one is often a bit painful.

    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    ---

    Best,,
    sam

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

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCYtFXuF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kF+7AQCgdh9c8yVSzhcMdGtWiIkVEHYZP5IBlaF363A8EJr8uAD9GoBZeAICPvfl jgmE5stBa8uMhs5Psv2/y/nLosyMQA4=
    =UGnS
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans de Graaff@21:1/5 to Sam James on Mon Jul 18 15:40:01 2022
    On Fri, 2022-07-15 at 13:04 +0100, Sam James wrote:

    I worry a bit about silently skipping given it can go further
    and lead to e.g. unpredictably broken binpkgs.

    Yes, not really happy with that either, even though this only affects documentation files.

    I'd probably prefer not doing +doc but I assume it's there
    for a reason.

    Your question prompted me to investigate this again. +doc was added
    initially to ensure that the built-in documentation was generated which
    people expect to work as part of normal operations. Starting with
    bundler 2.2.0 this documentation is now bundled as part of the gem and
    does not need to be generated anymore, so for the 2.2 and 2.3 series
    the +doc can be dropped.

    I'll drop the patch since I expect that this is no longer needed (or at
    least, the drawbacks now outweight the benefits.

    Hans

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

    iQEzBAABCAAdFiEEIggVRmJzp0YePtgn2zR/k4ZU+jQFAmLVYcQACgkQ2zR/k4ZU +jQlpwgAgALzBhEUUNuTeIKhQvoBDECPtVeF2av+c6jAEdBLeLBO8LJvzolWeIbk 8J1n+lI34r3oUj/rUfROdEpv7+UorUlvS6YBsSs7T6LfSI+W/NU1fD8Uq3mfBwmV sscVke1WePVTt0Dpfjg+Q3UGWB7sY0LGruFVxFhAqJgdbHeZDK4SsUNe5oWWZV+y f2d5DDNAFATrPOHuAg0rZw8vDFADIIExYmagkNUIFukNG2K5t/LCXb01Cjhk3wlC vFaanSlQQ4H22gSN900gfrBizf3JYGUSgQ4SYv0MAIVY+UAuLC7dW1cfpAq6voO4 OIxEC6p3RxXhEu9GtYHZJl6mZS1Ufw==
    =YgEd
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)