From owner-freebsd-ports@FreeBSD.ORG Thu Nov 8 20:39:07 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 437824ED; Thu, 8 Nov 2012 20:39:07 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (mail1.sourcehosting.net [74.205.51.45]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE878FC0A; Thu, 8 Nov 2012 20:39:06 +0000 (UTC) Received: from 24-181-237-39.dhcp.oxfr.ma.charter.com ([24.181.237.39] helo=Gregory-Larkins-iMac.local) by mail1.sourcehosting.net with esmtp (Exim 4.73 (FreeBSD)) (envelope-from ) id 1TWYsK-000G0e-2y; Thu, 08 Nov 2012 15:39:00 -0500 Received: from Gregory-Larkins-iMac.local (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by Gregory-Larkins-iMac.local (Postfix) with ESMTPS id 9EB55179BF2C; Thu, 8 Nov 2012 15:38:55 -0500 (EST) Message-ID: <509C185F.3070509@FreeBSD.org> Date: Thu, 08 Nov 2012 15:38:55 -0500 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Christopher J. Ruwe" References: <20121106220059.7de9f176@dijkstra.cruwe.de> <50999622.6080306@FreeBSD.org> <20121107224622.2b8f081f@dijkstra.cruwe.de> In-Reply-To: <20121107224622.2b8f081f@dijkstra.cruwe.de> X-Enigmail-Version: 1.4.5 X-SA-Exim-Connect-IP: 24.181.237.39 X-SA-Exim-Mail-From: glarkin@FreeBSD.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail1.sourcehosting.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,TVD_RCVD_IP autolearn=no version=3.3.1 Subject: Re: trying to build a port for vagrant and failing Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail1.sourcehosting.net) Cc: freebsd-questions@freebsd.org, freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 20:39:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/7/12 4:46 PM, Christopher J. Ruwe wrote: > On Tue, 06 Nov 2012 17:58:42 -0500 Greg Larkin > wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > >> On 11/6/12 4:00 PM, Christopher J. Ruwe wrote: >>> Currently, I am trying to write up a port for vagrant, a >>> VirtualBox managment thing (http://vagrantup.com/). I am >>> failing with the dependencies and would be grateful for some >>> help. >>> >>> I have >>> >>> BUILD_DEPENDS= >>> minitar:${PORTSDIR}/archivers/rubygem-archive-tar-minitar \ >>> >>> RUN_DEPENDS= erubis:${PORTSDIR}/www/rubygem-erubis \ >>> rubygem-childprocess>=0.3.1:${PORTSDIR}/devel/rubygem-childprocess >>> >>> >>> \ rubygem-i18n>=0.6.0:${PORTSDIR}/devel/rubygem-i18n \ >>> rubygem-json>=1.5.1:${PORTSDIR}/devel/rubygem-json \ >>> rubygem-log4r>=1.1.9:${PORTSDIR}/sysutils/rubygem-log4r \ >>> rubygem-net-ssh>=2.2.2:${PORTSDIR}/security/rubygem-net-ssh \ >>> rubygem-net-scp>=1.0.4:${PORTSDIR}/security/rubygem-net-scp >>> >>> in the makefile. >>> >>> From the build log (I am using poudriere for testing) I get >>> >>> >>> =======================>> run-depends>========================== ===> >>> rubygem-vagrant-1.0.5 depends on executable: erubis - not found >>> ===> Verifying install for erubis in >>> /usr/ports/www/rubygem-erubis ===> Installing existing >>> package /usr/ports/packages/All/rubygem-erubis-2.7.0.tbz ===> >>> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: >>> rubygem-childprocess>=0.3.1 - not found ===> Verifying install >>> for rubygem-childprocess>=0.3.1 in >>> /usr/ports/devel/rubygem-childprocess ===> Installing >>> existing package >>> /usr/ports/packages/All/rubygem-childprocess-0.3.5.tbz ===> >>> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: rubygem-i18n>=0.6.0 - >>> not found ===> Verifying install for rubygem-i18n>=0.6.0 in >>> /usr/ports/devel/rubygem-i18n ===> Installing existing >>> package /usr/ports/packages/All/rubygem-i18n-0.6.0,2.tbz ===> >>> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: rubygem-json>=1.5.1 >>> - not found ===> Verifying install for rubygem-json>=1.5.1 in >>> /usr/ports/devel/rubygem-json ===> Installing existing >>> package /usr/ports/packages/All/rubygem-json-1.7.5.tbz ===> >>> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: rubygem-log4r>=1.1.9 >>> - not found ===> Verifying install for rubygem-log4r>=1.1.9 in >>> /usr/ports/sysutils/rubygem-log4r ===> Installing existing >>> package /usr/ports/packages/All/rubygem-log4r-1.1.10.tbz ===> >>> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: >>> rubygem-net-ssh>=2.2.2 - not found ===> Verifying install >>> for rubygem-net-ssh>=2.2.2 in >>> /usr/ports/security/rubygem-net-ssh ===> Installing existing >>> package /usr/ports/packages/All/rubygem-net-ssh-2.1.4,2.tbz >>> ===> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on package: >>> rubygem-net-scp>=1.0.4 - not found ===> Verifying install >>> for rubygem-net-scp>=1.0.4 in >>> /usr/ports/security/rubygem-net-scp ===> Installing existing >>> package /usr/ports/packages/All/rubygem-net-scp-1.0.4_1.tbz >>> ===> Returning to build of rubygem-vagrant-1.0.5 ===> >>> rubygem-vagrant-1.0.5 depends on file: /usr/local/bin/gem18 - >>> found ===> rubygem-vagrant-1.0.5 depends on file: >>> /usr/local/bin/ruby18 - found >>> =================================================================== >>> >>> >>> >> >>> >>> So far so good. I noticed that rubygem-net-ssh-2.1.4.2 is supposed >>> to satisfy >=rubygem-net-ssh-2.2.2, which I ignore for the >>> while. >>> >>> Now, building yields >>> >>> =======================>>> ========================== ===> Installing for >>> rubygem-vagrant-1.0.5 ===> rubygem-vagrant-1.0.5 depends on >>> executable: erubis - found ===> rubygem-vagrant-1.0.5 >>> depends on package: rubygem-childprocess>=0.3.1 - found ===> >>> rubygem-vagrant-1.0.5 depends on package: rubygem-i18n>=0.6.0 - >>> found ===> rubygem-vagrant-1.0.5 depends on package: >>> rubygem-json>=1.5.1 - found ===> rubygem-vagrant-1.0.5 >>> depends on package: rubygem-log4r>=1.1.9 - found ===> >>> rubygem-vagrant-1.0.5 depends on package: >>> rubygem-net-ssh>=2.2.2 - found ===> rubygem-vagrant-1.0.5 >>> depends on package: rubygem-net-scp>=1.0.4 - found ===> >>> rubygem-vagrant-1.0.5 depends on file: /usr/local/bin/gem18 - >>> found ===> rubygem-vagrant-1.0.5 depends on file: >>> /usr/local/bin/ruby18 - found ===> Generating temporary >>> packing list ===> Checking if emulators/rubygem-vagrant >>> already installed /usr/bin/env /usr/local/bin/gem18 install -l >>> --no-update-sources --no-ri --install-dir /usr/local/lib/r\ >>> uby/gems/1.8 /usr/ports/distfiles/rubygem/vagrant-1.0.5.gem -- >>> --build-args ERROR: While executing gem ... >>> (Gem::DependencyError) Unable to resolve dependencies: vagrant >>> requires json (~> 1.5.1), net-ssh (~> 2.2.2) *** Error code 1 >>> >>> The installation is right about net-ssh (confer above), but >>> definitely not on json (1.7.5 > 1.5.1). >>> >>> Can anybody hint me on a path to pursue to resolve that error? >>> >>> Many thanks, cheers, > >> Hi Chris, > >> You've run into a problem we have with the ports system and >> Rubygem ports specifically. > >> I also worked on porting vagrant a few months ago. I ran into >> this issue, too, and it's caused by the fact that Ruby has the >> "~>" version dependency operator. Check this thread for some >> details: >> http://stackoverflow.com/questions/5170547/what-does-tilde-greater-than-mean-in-ruby-gem-dependencies > >> >> The ports tree has the devel/rubygem-json and the >> devel/rubygem-json146, but neither of these satisfy the "~> >> 1.5.1" version dependency for vagrant. In order to do that, >> you'll have to create a new port (devel/rubygem-json15) and >> install the 1.5.4 JSON gem >> (http://rubygems.org/gems/json/versions/1.5.4). > >> Hope that helps, Greg - -- Greg Larkin > Hi Greg, > > thank you for your extensive clarification. > > From your reply I infer that having vagrant in ports would > necessitate another port, thereby somewhat cluttering ports with > various rubygems. Is this the reason why you aborted the attempt > and what is your advise on that matter: Continue ports-integration > using two ports or abolishing the attempt (and have some "private" > ports instead)? > > Thanks anyways, at least it helps understanding that I have not > "terribly messed up" ;-) > Hi Christopher, I don't think it's a terrible problem to have various Rubygem ports in the tree in order to satisfy dependencies for other ports. However, I would be in favor of coming up with a cleaner solution than registering a bunch of version-specific Rubygem port directories before the situation gets too out of hand. I didn't finish the Vagrant port because I ran out of time, and I would encourage you to continue with it. I think it's a useful tool, and I also worked on porting veewee (https://github.com/jedi4ever/veewee) to layer on top of it. I didn't finish that either, but it shouldn't be terribly difficult. Because I'm interested in preventing an explosion of Rubygem version-specific port directories, I played around with the idea of a single port directory having the ability to install any version of its gem. So far, the results are encouraging, and I can install multiple gem versions like so: portsdev# pwd /root/Ports/head/devel/rubygem-childprocess portsdev# make install-0.3.1 clean-0.3.1 install-0.3.2 clean-0.3.2 install-0.3.5 clean-0.3.5 ... ===> Registering installation for rubygem-childprocess035-0.3.1 ===> Cleaning for rubygem-childprocess031-0.3.1 ... ===> Registering installation for rubygem-childprocess035-0.3.2 ===> Cleaning for rubygem-childprocess032-0.3.2 ... ===> Registering installation for rubygem-childprocess035-0.3.5 ===> Cleaning for rubygem-childprocess035-0.3.5 portsdev# pkg_info | grep childproc rubygem-childprocess031-0.3.1 External background process controller rubygem-childprocess032-0.3.2 External background process controller rubygem-childprocess035-0.3.5 External background process controller I had to add the package name suffix (e.g. 031), even though it's redundant, to avoid package naming conflicts. This idea needs to be generalized more and moved into bsd.ruby.mk. In particular, handling the *_DEPENDS variables is tricky, especially when different gem versions need different versions of their dependencies. Eventually, I want you to be able to do something like (using the vagrant port as an example): RUN_DEPENDS= erubis:${PORTSDIR}/www/rubygem-erubis \ rubygem-childprocess>=0.3.1:${PORTSDIR}/devel/rubygem-childprocess:install-0.3-latest \ rubygem-i18n>=0.6.0:${PORTSDIR}/devel/rubygem-i18n:install-0.6-latest \ rubygem-json>=1.5.1:${PORTSDIR}/devel/rubygem-json:install-1.5-latest \ rubygem-log4r>=1.1.9:${PORTSDIR}/sysutils/rubygem-log4r:install-1.1-latest \ rubygem-net-ssh>=2.2.2:${PORTSDIR}/security/rubygem-net-ssh:install-2.2-latest \ rubygem-net-scp>=1.0.4:${PORTSDIR}/security/rubygem-net-scp:install-1.0-latest The special "install-X.Y-latest" targets above would make sure that the most recent available version of the dependency gem is installed. Stay tuned! Regards, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/cpucycle/ - Follow you, follow me -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Darwin) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCcGF4ACgkQ0sRouByUApCQzQCgjaFca7zNj1QLudtHFftXq9UP 5iAAn0SVlaIKFlCyModMlisbPM1UD3CY =tJMJ -----END PGP SIGNATURE-----