From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cDtkGJGSDWUDHQAAauVa8A:P1 (envelope-from ) for ; Fri, 22 Sep 2023 15:11:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cDtkGJGSDWUDHQAAauVa8A (envelope-from ) for ; Fri, 22 Sep 2023 15:11:45 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0CE0E3D9C2 for ; Fri, 22 Sep 2023 15:11:45 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=dSfh64jy; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=autistici.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695388305; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=apCdHsvuGODBP8zJWrr9fM1YFPs8GYiAkQt9zlYYAGs=; b=XYs/hGrBFRybMO4f9j774O/pk+tv9paQci1mL81F5fc6Cym0wfl9MSBgfYH83DWHBzJ3p6 /3gPvtxbh89EKU44+S57eIDdID+Lezhz7/BraAzoGAjtNpOKfUZsOe8nVChJFzArfVWlJA VO0ERjMQI2LAbqAqQMriYZEGdnQ02pBA6lekr01s9YzEruvAYeuzb5ahIz/qhr780mi2OW 2D6j6ARjK75B9F+LWiyWksmMYRpDLAe9KnwG05RdETv+Y4d2smZHP48KWvQcBm5mmjNeGI yWjAusOmu6FxfMOQU9LQUzfxVepuAc2WRjS37qPWYkd0iu+sVyJlWLnkzJ3dSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=autistici.org header.s=stigmate header.b=dSfh64jy; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=autistici.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695388305; a=rsa-sha256; cv=none; b=s+s3diN2fH7hCcb2O38VD0c6j/VbnwkT9e/fLG+vxBg4mnc4vmgm/g4iY3dLbd1R9Mp+l5 1YAhZRnWMZUHvZiasq9WVBZ4g57lwbauu9bbfKC4eSfPssF8an1V8ISQlmj7CFPePcX3yW DsOuVGIxlJwsCO88Dd/l9jrfvh6lNNfA/u/pttNBiThdG7lcxCsYyKTu3sWjpQES9GgUwo yZudE9VOeq7MP9igrhrcFHNOQYeImm9F+x8akbsnt2RGiR6QDMc0DxuNWNYFb5A46kz0dM q09RbHEPr/tujoNVYmJeAJlDulhw1MQth29CyfgD6VimnuLUY08S2sS66PnBJA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjfwA-0003kb-BQ; Fri, 22 Sep 2023 09:11:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjfw8-0003jG-70 for guix-devel@gnu.org; Fri, 22 Sep 2023 09:11:12 -0400 Received: from confino.investici.org ([2a11:7980:1::2:0]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjfw6-0003d2-1c for guix-devel@gnu.org; Fri, 22 Sep 2023 09:11:11 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4RsXhW0wVGz113P; Fri, 22 Sep 2023 13:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1695388267; bh=apCdHsvuGODBP8zJWrr9fM1YFPs8GYiAkQt9zlYYAGs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=dSfh64jySK2cD4Pui7UptP+YV2UQLGE1RnqQX1K3p/PFbC7dShnfzcbdngmHm2wLT MGuhM5UTt6ROHPfFEKL9W5UOE035ysAKyAtHU4k3cro1BPwBoQ5zWMVUSpHpSOGDVt cwS/C19/14UtqHsBB7ZmPt03pjov9UgpEYczPBs8= Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4RsXhW0JHVz112t; Fri, 22 Sep 2023 13:11:07 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------ToYbQGa8xD8PJgIep36pNpX5" Message-ID: <44d579dd-652b-a2d2-6714-ff1c45c45300@autistici.org> Date: Fri, 22 Sep 2023 15:11:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: Version from file in a package Content-Language: en-US To: Reza Housseini , guix-devel@gnu.org References: <1d2a4522-3844-403b-1c09-aeb423bf4d28@gmail.com> From: paul In-Reply-To: <1d2a4522-3844-403b-1c09-aeb423bf4d28@gmail.com> Received-SPF: pass client-ip=2a11:7980:1::2:0; envelope-from=goodoldpaul@autistici.org; helo=confino.investici.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-1.473, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.72 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: 0CE0E3D9C2 X-Spam-Score: -9.72 X-TUID: lFA+qhMzcgTD This is a multi-part message in MIME format. --------------ToYbQGa8xD8PJgIep36pNpX5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Reza, I believe local-file should import (guix utils) and use current-source-directory. Something like: (define %cwd (current-source-directory)) (let ([...] (version-file (string-append %cwd "/VERSION")) [...] (source (local-file (string-append %cwd "/../..") "my-package-checkout" [...] The current directory may not be where the VERSION file is. giacomo --------------ToYbQGa8xD8PJgIep36pNpX5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi Reza,

I believe local-file should import (guix utils) and use current-source-directory. Something like:

(define %cwd (current-source-directory))

(let ([...]
      (version-file (string-append %cwd "/VERSION"))

  [...]

   (source (local-file (string-append %cwd "/../..") "my-package-checkout"
  
  [...]

The current directory may not be where the VERSION file is.

giacomo

--------------ToYbQGa8xD8PJgIep36pNpX5--