From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8PIkB2AudGKOkQAAbAwnHQ (envelope-from ) for ; Thu, 05 May 2022 22:06:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YK9OBmAudGKL9wAAG6o9tA (envelope-from ) for ; Thu, 05 May 2022 22:06:56 +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 5E5FB293FD for ; Thu, 5 May 2022 22:06:55 +0200 (CEST) Received: from localhost ([::1]:42974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmhkU-0000SV-GM for larch@yhetil.org; Thu, 05 May 2022 16:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmgbz-00080K-0P for guix-patches@gnu.org; Thu, 05 May 2022 14:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nmgby-0005JN-L8 for guix-patches@gnu.org; Thu, 05 May 2022 14:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nmgby-0004x7-Gm for guix-patches@gnu.org; Thu, 05 May 2022 14:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55248] [PATCH 2/7] gnu: racket: Fix out-of-source build. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 May 2022 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55248 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 55248@debbugs.gnu.org, Liliana Marie Prikler , Liliana Marie Prikler Received: via spool by 55248-submit@debbugs.gnu.org id=B55248.165177681619003 (code B ref 55248); Thu, 05 May 2022 18:54:02 +0000 Received: (at 55248) by debbugs.gnu.org; 5 May 2022 18:53:36 +0000 Received: from localhost ([127.0.0.1]:46479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmgbY-0004wP-6W for submit@debbugs.gnu.org; Thu, 05 May 2022 14:53:36 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:52375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmgbV-0004wA-Es for 55248@debbugs.gnu.org; Thu, 05 May 2022 14:53:34 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 08438320085B; Thu, 5 May 2022 14:53:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 05 May 2022 14:53:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm1; t=1651776806; x=1651863206; bh=VyM/sAv0yx0hzvwrg7Mnku5Ug GqjvSaAbeOkjfpBu7w=; b=WEp1LMLPd01P2S9uOL3dYTEmrXlw+CFbgk0T0Dw+N 2LK9JISL1H+8ehKk+pWwhgZ6GbPYi63vWWOO8PyuwHnkj5GW8dO2K9yS3Jt0hwkT tI2sdbV3tMYiujAzDjI3yXd4VgmPHEf5qcuVP7dUJ5MXCPOwZ9BID1+5w4SjICy2 TSqDqMy8VBYgSCU0JLc4aSiwbIfUWK0H1jKTlJ+MxZaOCQSMKKNkvTvV+UWQ42la 63uEfrxDnMqzTJ8IrwOzOJch1ziZBg7/m5quoj0jE3WTGgIOV7krNPIfDCuPVsC2 L+oDQ50rdw7BPD4hWWJz5D5D/HH//KbWzukwF5qGx9sfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1651776806; x=1651863206; bh=VyM/sAv0yx0hzvwrg7Mnku5UgGqj vSaAbeOkjfpBu7w=; b=rXmrNBYkR9MDqtx7L8AeRUDsFj8lkhk+x3tJKcLDHigT rZprucAbK3Xar2CcdQ5r6wbkzEI1dlVpjI/eDH3SDHgI2CpDNercqSiz3yBuTKbc V7pwdF8MkGtmnl3Kv6H96scXfhnT8vuouQ798oVefBsgG2RXXg7KkzT0r5nZP3f7 O69PBFYuUYYkMmKEj4SSnFovIL7Pz3vW8Lbv9lkVoRAuhsVEpEzPNhqcDmc0SylN 5TFDBXQlbYaIDz6mNq3+W2LE2ibhSNHp+/izOgx6kUDZ8z2wzShTIdFEQENVNEt7 AYHJt0OcKMej925R045ZlmoR6Q1kNaIE6p3vU8q0WA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheprfhhihhl ihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hmqeenucggtffrrghtthgvrhhnpedvjeeuudelhedvgfevudetvdduteevudegvdeuvdef lefhgeeiteefvdeukeetieenucffohhmrghinheprhgvuhhsvgdrshhofhhtfigrrhgvpd hgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 May 2022 14:53:25 -0400 (EDT) Message-ID: Date: Thu, 5 May 2022 14:53:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US References: From: Philip McGrath In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651781215; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VyM/sAv0yx0hzvwrg7Mnku5UgGqjvSaAbeOkjfpBu7w=; b=j64vu+N9CTO5dDHPmTB4WAb5KuUDiMpxuzM4xCV6ArT9hAV4ER+H+l+E3wrBb9YAjb883Z Zd4ukXMLwJG6oAyszGVVNyWKi87q767K/eZ4GqxEqjUa+vm75GmNDw6jUDH37QsEIih61r k4x4udsZI+USMfsRm1QZsf64kRu0UEN4HRT64qBTU7bkvxFIDc/JdFaQHPOyw4K7m6RJ8M RFWYHLMqsWW6c/zn0vBMAKxD0f7LBSkGNfSMhqGnpYSXL6nMdEqL9X37rFFAXTZ+C8K9Z9 q9IHqQZ4L/g9r8O6OwVbOULT0nJJluqAllacim/EypB+QSh0nmKw1NaV5pa27Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651781215; a=rsa-sha256; cv=none; b=IUuw/CSWWCgTNh2QPNZ7LuUwnohRfSJLMxNAyH4qXYeQCmcNJ4pkZacT05C3/dh1wV0MW1 A/R8sDrE7UEaA8wHA7qN9v+HfPrzA1yCmX5qNRYG6XRWGCap9C4dQQ8lemYcJScUlm8Trk EC3UNdNQKyjrUWUjtudUUlmStvHqsSGELGPEPi+lGRrroPA4NGnoiKhVL/WkL+w1KS2jeT 4oy8jBk2XYZAAP9xqeL40RUw3xdu0XUa9pw2DVmQmphMXAB6BfcjDfUPjbYcE7GazqCSVV A3F7g/3mdQ+cAG0wKZquKp39caKZQ/YeFVrXG45IqGK0HH5x55JJHGDjXsPtuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=WEp1LMLP; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=rXmrNBYk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=WEp1LMLP; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=rXmrNBYk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5E5FB293FD X-Spam-Score: 2.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: u79z2Xy6Tdzc Hi, On 5/4/22 05:29, Maxime Devos wrote: > Philip McGrath schreef op di 03-05-2022 om 14:33 [-0400]: >> -       ;; help with debugging, but it confuses `install-license-files`. > [...] >> +             ;; workaround for install-license-files >> +             (lambda* (#:key out-of-source? #:allow-other-keys) >> +               (when out-of-source? >> +                 (with-directory-excursion ".." >> +                   (symlink "src" >> +                            (package-name->name+version >> +                             (strip-store-file-name #$output)))))))))) > > Surely we could fix this bug/limitation of install-license-files > upstream (in this case, upstream=Guix)? > I'd certainly be in favor of that! I've never edited '(guix build gnu-build-system)' but I assume that would be a 'core-updates' change. I'm also not sure what the best solution would be in general. In Racket's specific case, the source directory for the Racket VM is (relative to the repository root), "racket/src/", where other notable directories present include "racket/collects/" and "pkgs/". An out-of-source build ends up happening in "racket/build/". The license files are in the source directory, which is what install-license-files expects, but the find-source-directory helper function fails to guess the location of the source directory: > (define (find-source-directory package) > ;; For an out-of-source build, guess the source directory location > ;; relative to the current directory. Return #f on failure. > (match (scandir ".." > (lambda (file) > (and (not (member file '("." ".." "build"))) > (file-is-directory? > (string-append "../" file))))) > (() ;hmm, no source > #f) > ((source) ;only one other file > (string-append "../" source)) > ((directories ...) ;pick the most likely one > ;; This happens for example with libstdc++, which lives within the GCC > ;; source tree. > (any (lambda (directory) > (and (string-prefix? package directory) > (string-append "../" directory))) > directories)))) Some possibilities I can imagine: * We could add a case to find-source-directory specifically for "src". * We could change configure to communicate the location of the source directory, e.g. via an environment variable, rather than trying to guess. * We could change install-license-files to do more searching in general, e.g. trying multiple directories or preferring a directory that contains at least one match for #:license-file-regexp. We'd have to consider the potential for false positives, too (e.g. sibling directories with projects under different licenses.) * We could add an argument to install-license-files to specify the directory explicitly, as a complement to #:license-file-regexp. Another scenario that might be worth considering is projects that follow the REUSE specification[1], which I don't think would be handled by the current install-license-files. But actually, for Racket, I forgot that a patch I'd sent upstream to handle this in `make install` should be in 8.5, so we may not need this patch at all: I'll confirm before I send v2. -Philip [1]: https://reuse.software/ [2]: https://github.com/racket/racket/pull/4127