Re: [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc

2022-07-18 Thread Hans de Graaff
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


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc

2022-07-15 Thread Sam James


> On 15 Jul 2022, at 11:17, Hans de Graaff  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 
> ---

Best,,
sam


signature.asc
Description: Message signed with OpenPGP


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

2022-07-15 Thread Hans de Graaff
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 
---
 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"
-- 
2.35.1