Bug 189646 - [PATCH] lang/ruby19, lang/ruby20, lang/ruby21: fix RDOC options handling and etc.
[PATCH] lang/ruby19, lang/ruby20, lang/ruby21: fix RDOC options handling and ...
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Some People
Assigned To: Steve Wills
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-11 06:30 UTC by Yasuhiro KIMURA
Modified: 2014-08-30 21:10 UTC (History)
2 users (show)

See Also:


Attachments
patch-lang_ruby (58.88 KB, text/plain)
2014-05-11 06:30 UTC, Yasuhiro KIMURA
no flags Details
Update patch to fit current port tree. (59.29 KB, patch)
2014-06-10 09:05 UTC, Yasuhiro KIMURA
no flags Details | Diff
Updated patch to use stattic plist, with 1 new problem described in comment. (354.09 KB, application/x-gzip)
2014-06-12 23:12 UTC, Yasuhiro KIMURA
no flags Details
Updated patch to use dynamic plist for C API documents. (262.54 KB, application/x-gzip)
2014-06-16 09:55 UTC, Yasuhiro KIMURA
no flags Details
updated patch for ruby 1.9 only (139.34 KB, application/gzip)
2014-07-29 21:04 UTC, Steve Wills
no flags Details
second updated patch for ruby 1.9 only, fixes plist issues (139.56 KB, application/gzip)
2014-08-03 04:19 UTC, Steve Wills
no flags Details
third updated patch for ruby 1.9, 2.0 and 2.1 (372.55 KB, application/gzip)
2014-08-12 01:12 UTC, Steve Wills
no flags Details
fix pkg-plist for orphaned capi docs files of lang/ruby{20,21}. (382.73 KB, application/x-gzip)
2014-08-14 08:17 UTC, Yasuhiro KIMURA
no flags Details
fourth updated patch (416.17 KB, patch)
2014-08-21 03:54 UTC, Steve Wills
no flags Details | Diff
Fifth updated patch to fix ruby docs issues (416.29 KB, patch)
2014-08-21 03:58 UTC, Steve Wills
no flags Details | Diff
Sixth updated patch to fix ruby rdoc and capidoc issues (404.20 KB, patch)
2014-08-23 14:11 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro KIMURA 2014-05-11 06:30:00 UTC
	
	- Fix handling of RDOC option and make it ON by default.
	- I seems there shoule be DOCS option but there isn't, so add it to OPTIONS_DEFINE.
	- Add EXAMPLES option because portlint warns combination of '%%PORTDOCS%%" and "%%RUBY_EXAMPLESDIR%%" is bad manner.
	- Add CAPIDOCS option which installs C API documents generated by doxygen.
	- Convert '@unexec rmdir ... || true' to '@dirrmtry'.
	- Convert USE_BZIP2 to 'USES=tar:bzip2'.
	- Remove unnecessary '.if ${PORT_OPTIONS:MDOCS} ... .endif' and '${CAT} ${PKGMESSAGE}' from post-install target.
Comment 1 Edwin Groothuis freebsd_committer 2014-05-11 06:30:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Yasuhiro KIMURA 2014-06-10 09:05:55 UTC
Created attachment 143608 [details]
Update patch to fit current port tree.
Comment 3 Steve Wills freebsd_committer 2014-06-10 13:19:46 UTC
I like this change, but would prefer to keep the list of files in the plist. Would you consider doing this without the find outputting to the tmp plist?
Comment 4 Yasuhiro KIMURA 2014-06-12 23:12:53 UTC
Created attachment 143724 [details]
Updated patch to use stattic plist, with 1 new problem described in comment.

(In reply to Steve Wills from comment #3)
> I like this change, but would prefer to keep the list of files in the plist.
> Would you consider doing this without the find outputting to the tmp plist?

I tried it and faced 2 problems.

* Generated RDoc files/directories tree changes according to locale setting
* Generated C API Docs files/directories tree changes depending on whether the port is already installed or not.

I fixed the former by adding 'LC_ALL=C' to CONFIGURE_ENV and MAKE_ENV, but I couldn't fix the latter. So with attached patch build of 3 ports works fine on 'clean' environment such as redports, but if they are build on system on which they are already installed, build produces a lot of oraphaned files/directories in stage directory.
Comment 5 Yasuhiro KIMURA 2014-06-16 09:55:13 UTC
Created attachment 143828 [details]
Updated patch to use dynamic plist for C API documents.

After doxygen port is updated files/directories tree of C API document changed. So I conclude static plist is not suitable for C API document and switch back to dynamic plist about it.
Comment 6 Steve Wills freebsd_committer 2014-07-29 21:03:16 UTC
(In reply to Yasuhiro KIMURA from comment #5)
> Created attachment 143828 [details]
> Updated patch to use dynamic plist for C API documents.
> 
> After doxygen port is updated files/directories tree of C API document
> changed. So I conclude static plist is not suitable for C API document and
> switch back to dynamic plist about it.

I wasn't able to reproduce that issue with the static plist. I think it will be OK with the static plist. I'll add an attachment with my updated patch that I think will work for this. Let me know your thoughts. (Note my patch is only for 1.9 right now, but I'll update for 2.0 and 2.1 soon.)
Comment 7 Steve Wills freebsd_committer 2014-07-29 21:04:21 UTC
Created attachment 145129 [details]
updated patch for ruby 1.9 only

Needs to be updated to include 2.0 and 2.1 as well.
Comment 8 Steve Wills freebsd_committer 2014-08-03 04:19:59 UTC
Created attachment 145290 [details]
second updated patch for ruby 1.9 only, fixes plist issues

Here's an updated patch that's still just for 1.9 but fixes some plist and other issues. Still need to extend this for 2.0 and 2.1. Please test.
Comment 9 Steve Wills freebsd_committer 2014-08-12 01:12:07 UTC
Created attachment 145692 [details]
third updated patch for ruby 1.9, 2.0 and 2.1

Here's an updated copy which fixes the plist issues for 1.9, 2.0 and 2.1. I've tested this pretty extensively in poudriere, building with lots of different combinations of options, though I haven't checked the docs contents yet. So far, it seems fine to me.

Note I did have to updated it a bit after the recent doxygen update, so that will probably be an issue for future updaters of doxygen, but should be fine for us.

(I also had a bit of an issue with it not always generating the same docs if MAKE_JOBS_UNSAFE wasn't set, so added that to lang/ruby20. There will have to be further work done in the future to make the lang/ruby* ports more consistent and otherwise improved, but I don't want to mix those changes up with these which should only add the necessary docs/rdocs/capi docs options and fix the plist with those.)
Comment 10 Yasuhiro KIMURA 2014-08-14 08:17:02 UTC
Created attachment 145768 [details]
fix pkg-plist for orphaned capi docs files of lang/ruby{20,21}.
Comment 11 Yasuhiro KIMURA 2014-08-14 09:07:22 UTC
(In reply to Steve Wills from comment #9)
> Created attachment 145692 [details]
> third updated patch for ruby 1.9, 2.0 and 2.1

I tried this patch on my local 10.0R/9.3R/8.4R environment with r364754 of port tree.
lang/ruby19 works fine but lang/ruby20 and lang/ruby21 resulted in a lot of orphaned capi docs files (about 5-6 hundreds).
Attachment 145768 [details] is modified one so that capi docs are not orphaned on my local system, but it cause a lot of missing files on "pure" environment such as redports.
Obviously something is wrong. But I couldn'n find what is a source of problem. 
If there is any suggestion about how to investigate it, please let me know.

Best Regards.
Comment 12 Steve Wills freebsd_committer 2014-08-14 13:56:06 UTC
(In reply to Yasuhiro KIMURA from comment #11)
> (In reply to Steve Wills from comment #9)
> > Created attachment 145692 [details]
> > third updated patch for ruby 1.9, 2.0 and 2.1
> 
> I tried this patch on my local 10.0R/9.3R/8.4R environment with r364754 of
> port tree.
> lang/ruby19 works fine but lang/ruby20 and lang/ruby21 resulted in a lot of
> orphaned capi docs files (about 5-6 hundreds).
> Attachment 145768 [details] is modified one so that capi docs are not
> orphaned on my local system, but it cause a lot of missing files on "pure"
> environment such as redports.
> Obviously something is wrong. But I couldn'n find what is a source of
> problem. 
> If there is any suggestion about how to investigate it, please let me know.
> 
> Best Regards.

I think part of what is wrong is the lack of MAKE_JOBS_UNSAFE in Ruby 2.0. Another part of the issue is that tinderbox, which is used by redports, doesn't completely check the plists properly.

Could you test in poudriere? I've spent the last days testing this patch with every combination of port options, including libedit/readline as well as different default versions of ruby and so far haven't found any issues with the patch I posted. In particular, I didn't see the plist issues you were seeing. But, my testing is with poudriere, so I'm wondering if you could set that up and test as well. The testing with poudriere should be more reliable.
Comment 13 Steve Wills freebsd_committer 2014-08-21 03:54:01 UTC
Created attachment 146104 [details]
fourth updated patch

Ignore my previous comment. The lack of MAKE_JOBS_UNSAFE is an issue with the docs, but the main issue here is that 2.0 and 2.1 seem to not want to use miniruby when generating the docs and instead use the host installed ruby if available, failing otherwise. I think this is due to upstream rev 35431. I've patched it for now and will file a bug with upstream. I've also added a dependency on graphviz. So, with this, you should get the complete C API docs generated both in poudriere and outside. Please test. Thanks!
Comment 14 Steve Wills freebsd_committer 2014-08-21 03:58:41 UTC
Created attachment 146105 [details]
Fifth updated patch to fix ruby docs issues

Oops, that patch failed to include the patch to Mk/bsd.ruby.mk. Please use this updated version. This patch is likely what will be committed.
Comment 15 Steve Wills freebsd_committer 2014-08-21 15:17:50 UTC
Upstream bug 10161 has been filed on this issue.
Comment 16 Yasuhiro KIMURA 2014-08-23 03:58:40 UTC
(In reply to Steve Wills from comment #14)
> Created attachment 146105 [details]
> Fifth updated patch to fix ruby docs issues
> 
> Oops, that patch failed to include the patch to Mk/bsd.ruby.mk. Please use
> this updated version. This patch is likely what will be committed.

Thank you for updating patch. I tried latest one with CAPIDOCS option enabled and now ruby19 and ruby20 works fine on my real environment. But there is no diff for ruby21 included in it. Is it forgotten?
Comment 17 Steve Wills freebsd_committer 2014-08-23 14:09:53 UTC
(In reply to Yasuhiro KIMURA from comment #16)
> (In reply to Steve Wills from comment #14)
> > Created attachment 146105 [details]
> > Fifth updated patch to fix ruby docs issues
> > 
> > Oops, that patch failed to include the patch to Mk/bsd.ruby.mk. Please use
> > this updated version. This patch is likely what will be committed.
> 
> Thank you for updating patch. I tried latest one with CAPIDOCS option
> enabled and now ruby19 and ruby20 works fine on my real environment. But
> there is no diff for ruby21 included in it. Is it forgotten?

Sorry, typo'd and included the ruby20 diff twice. Also, upstream closed the bug with a slightly better fix, so I've updated the patch with that. I'll post a new patch in a second.
Comment 18 Steve Wills freebsd_committer 2014-08-23 14:11:02 UTC
Created attachment 146177 [details]
Sixth updated patch to fix ruby rdoc and capidoc issues

Here's the updated patch, including ruby19, ruby20, ruby21 and using upstreams patch.
Comment 19 commit-hook freebsd_committer 2014-08-30 21:09:31 UTC
A commit references this bug:

Author: swills
Date: Sat Aug 30 21:09:11 UTC 2014
New revision: 366678
URL: http://svnweb.freebsd.org/changeset/ports/366678

Log:
  lang/ruby*: fix docs handling

  - Fix handling of RDOC option and make it ON by default
  - Add DOCS option to OPTIONS_DEFINE
  - Add EXAMPLES option
  - Add CAPIDOCS option which installs C API documents generated by doxygen
  - Other cleanups while here

  PR:		189646
  Submitted by:	Yasuhiro KIMURA <yasu@utahime.org> (based on)

Changes:
  head/Mk/bsd.ruby.mk
  head/lang/ruby19/Makefile
  head/lang/ruby19/pkg-plist
  head/lang/ruby20/Makefile
  head/lang/ruby20/files/patch-common.mk
  head/lang/ruby20/pkg-plist
  head/lang/ruby21/Makefile
  head/lang/ruby21/files/patch-common.mk
  head/lang/ruby21/pkg-plist
Comment 20 Steve Wills freebsd_committer 2014-08-30 21:10:11 UTC
Fix committed, thanks!