Bug 213085 - www/redmine: depends on net-ldap twice, with different version numbers.
Summary: www/redmine: depends on net-ldap twice, with different version numbers.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-29 14:25 UTC by Johannes Jost Meixner
Modified: 2018-06-15 13:13 UTC (History)
4 users (show)

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


Attachments
redmine ldap fix (2.02 KB, patch)
2018-06-01 19:02 UTC, Mark Felder
no flags Details | Diff
redmine ldap fix (1.62 KB, patch)
2018-06-13 14:40 UTC, Mark Felder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Jost Meixner freebsd_committer freebsd_triage 2016-09-29 14:25:00 UTC
The recent update introduced some changes that lead bundler (executed e.g. to generate secret tokens or some such) to fail, like so:





[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: net-ldap (>= 0) and net-ldap (>= 0.12.0). Bundler cannot continue.

 #  from /usr/local/www/redmine/Gemfile:94
 #  -------------------------------------------
 #  Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle|
 >    self.instance_eval(Bundler.read_file(bundle))
 #  end
 #  -------------------------------------------


This is because the net-ldap dependency introduced in the Gemfile in line 29, https://svnweb.freebsd.org/ports/head/www/redmine/files/patch-Gemfile?view=markup#l29,

and the one introduced through code in line 84 of that Gemfile, plus 
https://svnweb.freebsd.org/ports/head/www/redmine/files/ldap.rb?view=markup
being moved into bundler.d/

have conflicting version numbers and confuse bundler.

It might be a good idea to patch out the optional dependency on net-ldap
Comment 1 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2016-09-29 14:50:08 UTC
This seems to be a duplicate of:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211276

By the way: can you test the attached patch/update in the other PR? I need some feedback ;)
Comment 2 Steve Wills freebsd_committer freebsd_triage 2016-09-29 15:34:54 UTC
Fix committed in r422934 (typod the PR number).
Comment 3 Mark Felder freebsd_committer freebsd_triage 2018-06-01 18:53:09 UTC
This problem is occurring again.

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: net-ldap (~> 0.12) and net-ldap (>= 0.12.0). Bundler cannot continue.
Comment 4 Mark Felder freebsd_committer freebsd_triage 2018-06-01 19:02:04 UTC
Created attachment 193897 [details]
redmine ldap fix

What is the point of having the ldap gem listed in Gemfile if it's also included by the ldap.rb that gets installed when you choose the LDAP option? I think this patch should fix it which is what I have to do on my Redmine server: remove ldap gem from Gemfile completely.
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-06-01 21:28:57 UTC
(In reply to Mark Felder from comment #4)

ldap was re-added to Gemfile in r430439.
https://svnweb.freebsd.org/ports/head/www/redmine/files/patch-Gemfile?r1=423958&r2=430439

The patch looks good to me.
Comment 6 Steve Wills freebsd_committer freebsd_triage 2018-06-09 22:34:09 UTC
This breaks the port:

[ E 2018-06-09 22:22:27.5941 84452/T15 age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /usr/local/www/redmine: The application encountered the following error: No such file to load -- net/ldap (LoadError)

This is because of lines 18 and 19 of /usr/local/www/redmine/app/models/auth_source_ldap.rb:

require 'net/ldap'
require 'net/ldap/dn'

You want to either patch that file when disabling LDAP or remove the option to disable LDAP. I don't really see the need to disable LDAP, it's under 3mb.
Comment 7 Mark Felder freebsd_committer freebsd_triage 2018-06-11 15:51:21 UTC
(In reply to Steve Wills from comment #6)

Ok, so this breaks it when LDAP is disabled only? I didn't test that scenario. I'd be OK with including this patch and enabling LDAP by default which means removing it as a port option entirely.
Comment 8 Steve Wills freebsd_committer freebsd_triage 2018-06-12 12:15:00 UTC
(In reply to Mark Felder from comment #7)
Works for me.
Comment 9 Mark Felder freebsd_committer freebsd_triage 2018-06-13 14:40:50 UTC
Created attachment 194226 [details]
redmine ldap fix

I believe the patch should look like this then, correct? We leave the standard ldap declaration in Gemfile and stop dropping a file in bundler.d ?
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-06-14 22:33:51 UTC
A commit references this bug:

Author: swills
Date: Thu Jun 14 22:33:11 UTC 2018
New revision: 472402
URL: https://svnweb.freebsd.org/changeset/ports/472402

Log:
  www/redmine: remove ldap option

  This fixes the issues with redmine depending on net-ldap twice.

  PR:		213085
  Submitted by:	feld
  Reported by:	xmj

Changes:
  head/www/redmine/Makefile
  head/www/redmine/files/ldap.rb
  head/www/redmine/pkg-plist
Comment 11 Steve Wills freebsd_committer freebsd_triage 2018-06-14 22:34:22 UTC
Committed, thanks!
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-06-15 13:13:17 UTC
A commit references this bug:

Author: feld
Date: Fri Jun 15 13:13:07 UTC 2018
New revision: 472444
URL: https://svnweb.freebsd.org/changeset/ports/472444

Log:
  MFH: r472402

  www/redmine: remove ldap option

  This fixes the issues with redmine depending on net-ldap twice.

  PR:		213085
  Submitted by:	feld
  Reported by:	xmj

Changes:
_U  branches/2018Q2/
  branches/2018Q2/www/redmine/Makefile
  branches/2018Q2/www/redmine/files/ldap.rb
  branches/2018Q2/www/redmine/pkg-plist