From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id QNOrHa7YDmU5IwEA9RJhRA:P1 (envelope-from ) for ; Sat, 23 Sep 2023 14:23:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QNOrHa7YDmU5IwEA9RJhRA (envelope-from ) for ; Sat, 23 Sep 2023 14:23:10 +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 2AFA058128 for ; Sat, 23 Sep 2023 14:23:10 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail3 header.b=gFmphFb0; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695471790; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=npMI7PSzdzr8qEFOfpcJ/kLozUz3M5kHW1RqIxVsa04=; b=JKhJgJlpAfcNy6/jxFQN3Z/qpX4YTn0N6kB9xlZKthd8E0xjNnPT2BEY4AMJkscMIHr7bM 61rHCKQKHmPCp6J3jQLMihm6KxPDJ1ysxUHUKWCZ49tOkD0UpUfQHamh7rCGc+9Hy66reO NIB699Is0wUtG8GnD2Ld+wd97GBxXuLVSCcLmAmjQA7SKffXESCobB2HP58bq58t59+cq/ ZuXWP7TZw+Zmg7QDxY4DywYGKnz83tvWFGqvNnymjAJk7chDk+2B+4RXPJQQV641siG2xM pn8VeDbgPoR3+RSCMl5W7QM0ms3idIli64BKl1D2GBm51DFNi2TC+9nXj4igRQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695471790; a=rsa-sha256; cv=none; b=GeMebxEHMSkySORBIEAGBfy1PMaWExn2Yeh20MdTTYnvPWz70ixtt3E1QajPwlnR3jpnVw 5Z+pABLjjb3Tl6Gzfk9cXWUGzJ6PgWGsg6fUZ0lfPaupsTSC5KLevheDY4yxXVnljTUAbs CaT93Ysx6diEYHuxZgV4VuNvpr1sbXyTjw8KV6HzjvayuOMv+/cOoye8WTVIjz+9Tu6e1X wxf/wDpHS6I1fSc8mm+fbz/qJn2Kqzv6mw5se8uf2yVDhhR2+5xMWO8ilp7orVlX/wSgbm 2rDykDa0UL/oc7vBYHrPCBp/IES1irwgKBepMC3MWW8z520jgn/yIHSYzwYEdA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail3 header.b=gFmphFb0; 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=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qk1ee-0001Fn-6n; Sat, 23 Sep 2023 08:22:36 -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 1qk1ec-0001Fe-Oz for guix-devel@gnu.org; Sat, 23 Sep 2023 08:22:34 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qk1eY-0002cT-Vy for guix-devel@gnu.org; Sat, 23 Sep 2023 08:22:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1695471740; x=1695730940; bh=npMI7PSzdzr8qEFOfpcJ/kLozUz3M5kHW1RqIxVsa04=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=gFmphFb0klTAjDRHmi8SnV0SqVsTNCL8Bw1szbW5DgcriE6wnRSMYUVVSRFfZKi/P 4r3MWNDQvv2tO+hoyU/WgDsIFqsoiwb/CgokXfMWV1UNx2WLWe46/PM+5VC3SoLBro Stn/z6p3Lda0/sVORWTGCBcwFmt4o+EjdV90iw2bVYSF4krGL9EQb0aMYNuRxrCAFt X4txY14qN+7WSwU4Qyp8uyGGusQURtdHxIZ47H+dbsm9QaCL41KTdjLyWicq/qh53f 2qHKyvx0bMNkhLzxPPi/Yu3Emf+3Ea3Atgb70oDD8r61ew/7m+OfVjXu63DazPeK9v TKA6oZ9f4Wmzw== Date: Sat, 23 Sep 2023 12:22:15 +0000 To: Reza Housseini From: Attila Lendvai Cc: guix-devel@gnu.org Subject: Re: Version from file in a package Message-ID: In-Reply-To: <1d2a4522-3844-403b-1c09-aeb423bf4d28@gmail.com> References: <1d2a4522-3844-403b-1c09-aeb423bf4d28@gmail.com> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.23; envelope-from=attila@lendvai.name; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.94 X-Spam-Score: -6.94 X-Migadu-Queue-Id: 2AFA058128 X-TUID: MZqnnFl2EwqI this may be related (also see the discussion): (current-filename) is #f when guix pull'ing https://issues.guix.gnu.org/55464 i haven't yet double-checked Ludo's recommendation to use INCLUDE, which sh= ould work, but it didn't for me. my current solution is this: (define (%read-module-relative-file module filename) (with-input-from-file (or (search-path %load-path (string-append (dirname (module-filename module)) "/" filename)) (error "%read-module-relative-file failed for" filename)) (lambda _ (values (read) ; version (read))))) ; hashes (define-syntax read-hashes-file (lambda (syn) (syntax-case syn () ((_ filename) (with-syntax ;; Reads the file at compile time and macroexpands to the first = form in it. ((form (call-with-values (lambda _ (%read-module-relative-file (current-module) (string-append "hashes/= " (syntax-= >datum #'filename) ".hashes= "))) (lambda (version hashes) #`(values '#,version '#,hashes))))) #'form))))) HTH, --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CNever argue with someone whose TV is bigger than their bookshelf.= =E2=80=9D =09=E2=80=94 Emilia Clarke