Bug 233900 - Ports that depend on lang/jruby should use jgem
Summary: Ports that depend on lang/jruby should use jgem
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-09 21:43 UTC by Pedro F. Giffuni
Modified: 2019-01-01 22:30 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments
svn diff to use jgem (2.81 KB, patch)
2018-12-09 21:43 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer freebsd_triage 2018-12-09 21:43:44 UTC
Created attachment 199994 [details]
svn diff to use jgem

Modern versions of jruby support the 2.5.0 version of the language, which is currently ahead the default C version of Ruby in ports (this should be updated as 2.5 is already the LTS version).

It is unclear if this causes any problems but for consistency we should use jgem for ports that depend on jruby. This has already been done in devel/rubygem-jruby-jars. The attached patch does a similar change for:

    databases/rubygem-activerecord-jdbc-adapter
    databases/rubygem-activerecord-jdbcmysql-adapter
    databases/rubygem-jdbc-mysql
    devel/rubygem-warbler
    sysutils/puppetserver6
    www/rubygem-jruby-rack

Also per portlint while here (concerning the order of USES)
Comment 1 Steve Wills freebsd_committer freebsd_triage 2018-12-09 23:15:48 UTC
I compared the packages produced without and with this patch and the contents are identical. I agree it would be more consistent, but even the deps don't change, so it seems to have no effect.

FWIW, I've asked for the exp-run for making 2.5 default.
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2018-12-10 03:10:14 UTC
(In reply to Steve Wills from comment #1)
> I compared the packages produced without and with this patch and the contents
> are identical. I agree it would be more consistent, but even the deps don't 
> change, so it seems to have no effect.

Hmm ... I see: Mk/Uses/gem.mk will override the value:

RUBYGEMBIN=     ${LOCALBASE}/bin/gem${RUBY_VER:S/.//}

We need to use ?= in line 66.

> FWIW, I've asked for the exp-run for making 2.5 default.

I am sure the change will cause some trouble in running systems with rails.
I did an update on another paktform and fortunately it was just a matter of
updating the Gemfile and running "bundle update" or something similar.
Comment 3 Steve Wills freebsd_committer freebsd_triage 2018-12-10 15:58:44 UTC
(In reply to Pedro F. Giffuni from comment #2)

Just changing RUBYGEMBIN won't be sufficient. I think we probably want to add support for USES=gem:jgem and the BUILD_DEPENDS, RUN_DEPENDS and EXTRACT_DEPENDS on lines 24, 25 and 32 will also have to be changed based on that.
Comment 4 Pedro F. Giffuni freebsd_committer freebsd_triage 2018-12-10 23:32:54 UTC
(In reply to Steve Wills from comment #3)

Ugh, yes ... lets close this PR for now, it's obviously more work than I thought.
Comment 5 Pedro F. Giffuni freebsd_committer freebsd_triage 2018-12-10 23:33:57 UTC
Comment on attachment 199994 [details]
svn diff to use jgem

Obsolete patch: we will need a new option altogether.
Comment 6 Pedro F. Giffuni freebsd_committer freebsd_triage 2018-12-11 15:05:39 UTC
Reopen, we have a problem here:

If I try to install rails with jgem, I get:

 % jgem install rails
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/share/jruby/lib/ruby/gems/shared

(This matches my experience with another platform where each version of ruby has its own installation dir.)

OTOH, the rubygem-jruby-jars are being installed in
%%GEM_LIB_DIR%
so they are currently misplaced in /usr/local/lib/ruby/gems/2.4/gems

It doesn't seem to me like jars meant to be used with jruby are operational.