Return-Path: X-Original-To: apmail-buildr-users-archive@www.apache.org Delivered-To: apmail-buildr-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A898A7FA7 for ; Fri, 11 Nov 2011 16:51:31 +0000 (UTC) Received: (qmail 69395 invoked by uid 500); 11 Nov 2011 16:51:31 -0000 Delivered-To: apmail-buildr-users-archive@buildr.apache.org Received: (qmail 69362 invoked by uid 500); 11 Nov 2011 16:51:31 -0000 Mailing-List: contact users-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@buildr.apache.org Delivered-To: mailing list users@buildr.apache.org Received: (qmail 69354 invoked by uid 99); 11 Nov 2011 16:51:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2011 16:51:31 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rteabeault@rallydev.com designates 74.125.149.155 as permitted sender) Received: from [74.125.149.155] (HELO na3sys009aog126.obsmtp.com) (74.125.149.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2011 16:51:25 +0000 Received: from mail-iy0-f174.google.com ([209.85.210.174]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKTr1SeDKJCAA7WaqinH0qPPIzLwE4oegx@postini.com; Fri, 11 Nov 2011 08:51:05 PST Received: by mail-iy0-f174.google.com with SMTP id e36so4315211iag.19 for ; Fri, 11 Nov 2011 08:51:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.150.135 with SMTP id a7mr13086608icw.53.1321030264282; Fri, 11 Nov 2011 08:51:04 -0800 (PST) Received: by 10.42.230.198 with HTTP; Fri, 11 Nov 2011 08:51:04 -0800 (PST) In-Reply-To: References: Date: Fri, 11 Nov 2011 09:51:04 -0700 Message-ID: Subject: Re: Problem using build.yaml to specify groups of dependencies From: Russ Teabeault To: users@buildr.apache.org Content-Type: multipart/alternative; boundary=90e6ba6e8ebca3dede04b1785329 --90e6ba6e8ebca3dede04b1785329 Content-Type: text/plain; charset=ISO-8859-1 Thanks for taking a look at this Alex. I tried adding your suggestion and it almost works but I think there might be another bug here. The problem is with specs that have a classifier. For example, consider net.sf.json-lib:json-lib:jar:jdk15:2.3 which has the 'jdk15' classifier. When this is listed under my compile dependencies it ends up raising the error "RuntimeError : Expecting a String, Hash or object that responds to to_spec" After looking at the code I see the following: When the build.yaml is loaded the ArtifactNamespace.use method determines that compile is a group and sets is_group to true. It then adds the each artifact in the group to the registry using the unversioned spec string "net.sf.json-lib:json-lib:jar:jdk15". It then calls the group method passing in 'compile' and all the spec names. The group method creates a lambda that when called will do a values_at using the spec names. The values_at method then generates a key using ArtifactRequirement.unversioned_spec(name). But name here is "net.sf.json-lib:json-lib:jar:jdk15" and so the key comes out as "net.sf.json-lib:json-lib:jar". So when it calls get on the registry using this key it returns false since the registry is using ""net.sf.json-lib:json-lib:jar:jdk15" key. And 'false' is passed to the satisfied_by method which ends up throwing the error. So in short it seems that unversioned_spec is called twice on the spec name. The first call leaves the spec name with the classifier dangling off the end. This is used as the key to the registry. The second call, used to find the artifact in the registry ends up chopping the classifier off because it thinks it is the version. Thoughts? Thanks, -russ On Fri, Nov 11, 2011 at 4:56 AM, Alex Boisvert wrote: > On Thu, Nov 10, 2011 at 7:26 PM, Russ Teabeault >wrote: > > > I am trying to use buildr.yaml to specify my dependencies > > > > artifacts: > > compile: > > - ant:ant:jar:1.6.5 > > - ant-contrib:ant-contrib:jar:1.0b2 > > - ... > > > > Based on everything I have read I should then be able to do > > > > compile.with artifact_ns[:compile] > > > > However, this fails in the artifacts method of artifact.rb since each > spec > > in the array is an ArtifactRequirement and there is no case handling that > > type. > > > > Is this a bug? Is there a better way to do this? What are other people > > doing? > > > > Yes, that is a bug. artifacts() doesn't correctly handle objects that > ActsLikeArtifact. Will be fixed in trunk in a few minutes. > > In the mean time or for previous versions, you can write, > > compile.with artifact_ns.compile.map(&:artifact) > > instead. > > alex > --90e6ba6e8ebca3dede04b1785329--