From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CJcVBWjLIWCXDwAA0tVLHw (envelope-from ) for ; Mon, 08 Feb 2021 23:38:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GPHmAGjLIWD+cQAA1q6Kng (envelope-from ) for ; Mon, 08 Feb 2021 23:38:16 +0000 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 4617894042A for ; Mon, 8 Feb 2021 23:38:15 +0000 (UTC) Received: from localhost ([::1]:48888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9G6f-0003On-OE for larch@yhetil.org; Mon, 08 Feb 2021 18:38:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9FJA-0003sb-5E for bug-guix@gnu.org; Mon, 08 Feb 2021 17:47:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9FJ8-0001Ec-Ip for bug-guix@gnu.org; Mon, 08 Feb 2021 17:47:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9FJ8-0002RD-Fn for bug-guix@gnu.org; Mon, 08 Feb 2021 17:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46390: =?UTF-8?Q?=E2=80=9Cguix?= lint -L relative/path =?UTF-8?Q?foo=E2=80=9C?= fails Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 08 Feb 2021 22:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46390 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 46390@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16128244199360 (code B ref -1); Mon, 08 Feb 2021 22:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Feb 2021 22:46:59 +0000 Received: from localhost ([127.0.0.1]:52096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9FJ4-0002Qu-NO for submit@debbugs.gnu.org; Mon, 08 Feb 2021 17:46:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:60932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9FJ2-0002Qm-Bl for submit@debbugs.gnu.org; Mon, 08 Feb 2021 17:46:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9FJ0-0003qf-L3 for bug-guix@gnu.org; Mon, 08 Feb 2021 17:46:56 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:33779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9FIr-00013J-SY for bug-guix@gnu.org; Mon, 08 Feb 2021 17:46:52 -0500 Received: by mail-wm1-x32d.google.com with SMTP id a16so733803wmm.0 for ; Mon, 08 Feb 2021 14:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mmAZG+hdamKhmjQ3IZJ/x8TPLLuRnFl75VpBVxBnJfQ=; b=BvZNeE3VetJ1jOuIuVgNLH4RPt2qsV1hIdoYmDHPQaAffDJQXJa1YUjSgnZFqKr8R0 gw4e8iiN6+ALq0kjNAaUlme3Wch94F6TVS04cNf3LvuNMkZcMQf84aypoxX0LHT1aBo8 T7di4LjZ/ogu6jWWN3hNpk9fomy3Z828CVDd2TQXbXoKfGja3islfM4IVkGAIIOWOPX+ r+dDtmJkOOObMusIMDICarH9KHuBq09dvoHL+qBZTcTGxONZkg8ve9xrw3UxFOIMmDhK tVxC8ibOcL6DX2JxAMgMn8abhyK2UGotAZ6yGxeg35EDvLTRUEvy9OF+9X2rhQnboIen xicQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mmAZG+hdamKhmjQ3IZJ/x8TPLLuRnFl75VpBVxBnJfQ=; b=DiAS7QscN8rVvu1IyR8cWQl+vsj1qVIY75Wh0EdsJPrxtPUUs7fBuBTdlaLH10OMik SEdR9A5z2S3VRxPcMNZiAUKqNXtorHtHRplqa1pWnmCDR8PSS0bUipXxl89oJEMnPyQy Za6z/1QTpIQgYeXkg7z7rOBScbIekYbsncRN0Ak4JOy4nyT6s354JZuqlgeWjyuu0qsC m83BVXNdAbntULgog4wnNJ5ZXnP+IB/Fo2TFJGSdhv9+lir4qfW6y+tc2HfsMxkXaqur M3cQphxwbyoPJQSwdQYU0mzLeNUDymOenbx2tueuiJAKsLk/u1eDJXeerDEgPT0XOGPE 3eKg== X-Gm-Message-State: AOAM531TS7y1FGTjiSey1TYGOMgn/Urxsg/82yD984ILY9JsCRN/+KZx 863r8XYCwgfe3PaW0ypEYYV2EokVQBw= X-Google-Smtp-Source: ABdhPJw//LWfo8b/gKG7/TeoFS/T4Q6fy9y2XKmS18cVhp5ywyF508qXITGaLBpv39ZPno2PeWXVag== X-Received: by 2002:a1c:1bc7:: with SMTP id b190mr801699wmb.115.1612824403653; Mon, 08 Feb 2021 14:46:43 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id q6sm29609210wrw.43.2021.02.08.14.46.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 14:46:42 -0800 (PST) From: zimoun Date: Mon, 08 Feb 2021 23:39:05 +0100 Message-ID: <86a6sekwvq.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32d.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=BvZNeE3V; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 4617894042A X-Spam-Score: -1.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: R4oMh4G/ElaN Hi, Here an example to reproduce. Everything is fine with the full path=E2=80= =A6 --8<---------------cut here---------------start------------->8--- $ cat /tmp/example/hello.scm (define-module (hello) #:use-module (guix packages) #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module (guix licenses)) (define-public hi (package (name "hi") (version "2.10") (source (origin (method git-fetch) (uri (git-reference (url "https://example.org/hello-example.git") (commit "e1eefd033b8a2c4c81babc6fde08ebb116c6abb8"))) (sha256 (base32 "1im1gglfm4k10bh4mdaqzmx3lm3kivnsmxrvl6vyvmfqqzljq75l")))) (build-system gnu-build-system) (synopsis "Hello, GNU world: An example GNU package") (description "GNU Hello prints the message \"Hello, world!\" and then exits. It serves as an example of standard GNU coding practices. As such, it supports command-line arguments, multiple languages, and so on.") (home-page "https://www.gnu.org/software/hello/") (license gpl3+))) $ guix lint -L /tmp/example hi -c source-file-name /tmp/example/hello.scm:11:12: hi@2.10 : le nom du fichier source devrait co= ntenir le nom du paquet --8<---------------cut here---------------end--------------->8--- =E2=80=A6but breaks with relative path: --8<---------------cut here---------------start------------->8--- $ cd /tmp/ $ guix lint -L example hi -c source-file-name Backtrace: 13 (primitive-load "/home/sitour/.config/guix/current/bin/guix") In guix/ui.scm: 2150:12 12 (run-guix-command _ . _) In ice-9/boot-9.scm: 1736:10 11 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) 1731:15 10 (with-exception-handler # _ #:unwind? _ #:unwind-for-type _) In srfi/srfi-1.scm: 634:9 9 (for-each # ("hi")) In guix/scripts/lint.scm: 65:4 8 (run-checkers # (#< name: source-file-name descripti=E2=80=A6>) =E2=80=A6) In srfi/srfi-1.scm: 634:9 7 (for-each # (#< name: source-file-name=E2=80=A6>)) In guix/scripts/lint.scm: 74:21 6 (_ _) In guix/lint.scm: 897:9 5 (check-source-file-name _) 148:18 4 (%make-warning # "the source file name should contain the package n=E2=80=A6" =E2=80=A6) In ice-9/boot-9.scm: 1731:15 3 (with-exception-handler # _ #:unwind? _ #:unwind-for-type _) In ice-9/ports.scm: 440:11 2 (call-with-input-file #f # #:binary _ #:encoding _ # _) In unknown file: 1 (open-file #f "r" #:encoding #f #:guess-encoding #f) In ice-9/boot-9.scm: 1669:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1669:16: In procedure raise-exception: Wrong type (expecting string): #f --8<---------------cut here---------------end--------------->8--- The reason is from =E2=80=99package-field-location=E2=80=99 in (guix packag= es): --8<---------------cut here---------------start------------->8--- (catch 'system-error (lambda () ;; In general we want to keep relative file names for modules. (call-with-input-file (search-path %load-path file) --8<---------------cut here---------------end--------------->8--- the =E2=80=99search-path=E2=80=99 returns #f. Somehow, the %load-path shou= ld only contain absolute paths and here it is not the case. Therefore, the fix should be in (guix build): --8<---------------cut here---------------start------------->8--- (define %standard-build-options ;; List of standard command-line options for tools that build something. (list (option '(#\L "load-path") #t #f (lambda (opt name arg result . rest) ;; XXX: Imperatively modify the search paths. (%package-module-path (cons arg (%package-module-path))) (%patch-path (cons arg (%patch-path))) (set! %load-path (cons arg %load-path)) (set! %load-compiled-path (cons arg %load-compiled-path)) --8<---------------cut here---------------end--------------->8--- For instance using =E2=80=99canonicalize-path=E2=80=99. All the best, simon