public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc
@ 2022-07-15 10:17 Hans de Graaff
  2022-07-15 12:04 ` Sam James
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Graaff @ 2022-07-15 10:17 UTC (permalink / raw
  To: gentoo-dev; +Cc: 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 <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"
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc
  2022-07-15 10:17 [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc Hans de Graaff
@ 2022-07-15 12:04 ` Sam James
  2022-07-18 13:36   ` Hans de Graaff
  0 siblings, 1 reply; 3+ messages in thread
From: Sam James @ 2022-07-15 12:04 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]



> 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

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc
  2022-07-15 12:04 ` Sam James
@ 2022-07-18 13:36   ` Hans de Graaff
  0 siblings, 0 replies; 3+ messages in thread
From: Hans de Graaff @ 2022-07-18 13:36 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-18 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15 10:17 [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc Hans de Graaff
2022-07-15 12:04 ` Sam James
2022-07-18 13:36   ` Hans de Graaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox