From patchwork Wed May 7 19:26:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 346779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id DD2EF140184 for ; Thu, 8 May 2014 05:26:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B7FA787A04; Wed, 7 May 2014 19:26:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4GQBLpn5RdMf; Wed, 7 May 2014 19:26:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 20D4286826; Wed, 7 May 2014 19:26:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 03A681BF831 for ; Wed, 7 May 2014 19:26:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CD6288144E for ; Wed, 7 May 2014 19:26:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id djv4qGXuQilA for ; Wed, 7 May 2014 19:26:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0D4AF80ADD for ; Wed, 7 May 2014 19:26:21 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id x13so1658920qcv.16 for ; Wed, 07 May 2014 12:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jTjJZC0qHVwnVc2IjFnbsep2OzpjqYFtyqc60xdzoAs=; b=LFf9v8LJWcOQFyvGKvcVV18KMuopcJKY7LuuSA0fgT1p7IWNoWTSf2RV0pFxuOXIZw vB6RVPJI08Waqxnyqilum+zcfrG8rNa5RJikPqgqS6OfSZM8uUXJXosygYnvLDLcA1Wu DHW86B63sczr2olDGygMYcn3jou6lZf94KC6pwF9leVt5Hwluyj99j4lqzqV14tW5TgR M4wDTojNcnDZTiMMz5AB3sTtJosTdVfz62cT5u0TSWoMYM97a3zGptYCgct4zQsLL6YP cYf7MPYGZh/22khKquIUutf3l/B9SMQZ7FZmRoEQnxlvuFWNz/fG+jTNKOeDmA+v3EJz 3niQ== X-Received: by 10.229.54.201 with SMTP id r9mr66812993qcg.6.1399490780946; Wed, 07 May 2014 12:26:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.97.65 with HTTP; Wed, 7 May 2014 12:26:00 -0700 (PDT) In-Reply-To: <3dba42f3-d595-4415-bd38-3220738fe4b6@email.android.com> References: <0533846efc9952901283.1399373479@argentina> <20140506140745.1b072d2c@skate> <3dba42f3-d595-4415-bd38-3220738fe4b6@email.android.com> From: Thomas De Schampheleire Date: Wed, 7 May 2014 21:26:00 +0200 Message-ID: To: Thomas Petazzoni , "Yann E. MORIN" Cc: buildroot Subject: Re: [Buildroot] [PATCH] toolchain package: set version as 'virtual' instead of 'undefined' X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Hi, On Tue, May 6, 2014 at 10:05 PM, Thomas De Schampheleire wrote: > Thomas Petazzoni schreef: >>Dear Thomas De Schampheleire, >> >>On Tue, 06 May 2014 12:51:19 +0200, Thomas De Schampheleire wrote: >>> This patch causes the log messages to change from: >>> >>> >>> toolchain-external undefined Downloading >>> >>> toolchain-external undefined Extracting >>> ... >>> >>> to >>> >>> >>> toolchain-external virtual Downloading >>> >>> toolchain-external virtual Extracting >>> ... >>> >>> and similar for 'toolchain' and 'toolchain-buildroot', simply because it >>> looks nicer. >>> At the same time, the directory names also become toolchain-virtual, >>> toolchain-buildroot-virtual, toolchain-external-virtual instead of the >>> corresponding 'undefined' variants. >>> >>> Signed-off-by: Thomas De Schampheleire >> >>Shouldn't we instead migrate these to use the virtual package >>infrastructure, and make this infrastructure define this magic 'virtual' >>version? > > I tried using virtual-package in toolchain/toolchain/toolchain.mk, but TOOLCHAIN_VERSION becomes empty, while HOST_TOOLCHAIN_VERSION is virtual. > Quick update: - Yann mentioned on IRC a comment he wrote in a mail when the virtual string was introduced. I think the below is the comment Yann refers to: http://lists.busybox.net/pipermail/buildroot/2014-April/093670.html " - the version string is strange. This does not work: $(2)_VERSION = virtual so I had to come up with the solution in patch 20. " that solution in patch 20 is: +# Fake a version string, so it looks nicer in the build log +$(3)_VERSION = virtual +HOST_$(3)_VERSION = virtual + The code I was using originally is: In this case of using virtual-package, the output of 'make foo' is: TOOLCHAIN_VERSION = HOST_TOOLCHAIN_VERSION = virtual And if I change the code to use host-virtual-package iso virtual-package, the output is (surprisingly): TOOLCHAIN_VERSION = virtual HOST_TOOLCHAIN_VERSION = So there is definitely something odd going on here. If I print the parameters to the infra: (for virtual and host-virtual respectively): 1=toolchain 2=TOOLCHAIN 3=TOOLCHAIN 4=target 1=host-toolchain 2=HOST_TOOLCHAIN 3=TOOLCHAIN 4=host so the code $(3)_VERSION = virtual HOST_$(3)_VERSION = virtual is supposed to work fine in either case, as would the original $(2)_VERSION by the way. Looking at printvars doesn't tell much more: virtual-package: HOST_TOOLCHAIN_VERSION=virtual (virtual) TOOLCHAIN_BASE_NAME=toolchain- (toolchain-$(TOOLCHAIN_VERSION)) TOOLCHAIN_VERSION= () host-virtual-package: HOST_TOOLCHAIN_BASE_NAME=host-toolchain- (host-toolchain-$(HOST_TOOLCHAIN_VERSION)) HOST_TOOLCHAIN_VERSION= () TOOLCHAIN_VERSION=virtual (virtual) I'm a little puzzled at the moment on how to proceed... Best regards, Thomas diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk --- a/toolchain/toolchain/toolchain.mk +++ b/toolchain/toolchain/toolchain.mk @@ -4,8 +4,6 @@ # ################################################################################ -TOOLCHAIN_SOURCE = - ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) TOOLCHAIN_DEPENDENCIES += toolchain-buildroot else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) @@ -14,6 +12,10 @@ endif TOOLCHAIN_ADD_TOOLCHAIN_DEPENDENCY = NO -$(eval $(generic-package)) +$(eval $(virtual-package)) toolchain: $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake + +foo: + @echo TOOLCHAIN_VERSION = $(TOOLCHAIN_VERSION) + @echo HOST_TOOLCHAIN_VERSION = $(HOST_TOOLCHAIN_VERSION)