From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id dSBxMVCqvGDKKwAAgWs5BA (envelope-from ) for ; Sun, 06 Jun 2021 12:58:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SCIULFCqvGBKeQAAbx9fmQ (envelope-from ) for ; Sun, 06 Jun 2021 10:58:24 +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 B3D7E8A2C for ; Sun, 6 Jun 2021 12:58:22 +0200 (CEST) Received: from localhost ([::1]:42898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpqU1-00074m-M0 for larch@yhetil.org; Sun, 06 Jun 2021 06:58:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpqTf-00074a-U4 for guix-devel@gnu.org; Sun, 06 Jun 2021 06:58:00 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:26429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpqTb-00068E-LR for guix-devel@gnu.org; Sun, 06 Jun 2021 06:57:59 -0400 Received: from nijino.local (62-116-34-49.adsl.highway.telekom.at [62.116.34.49]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4FyYPT6z3gz3wXB; Sun, 6 Jun 2021 12:57:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1622977070; bh=ERz+JycSA5NfePXTkrZQhvgy8nLghlGjSFW9axdVij8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VOpDmldU1fCT89ZGHsCx95kRp6eoDRiQXwSbLUBHk8plH4XRTc8FY8Tw5C84HcoxE tgQ5MJrcLHA9gVk2beBO1AGV5UQaBUwS4vYqyap1E42CLJwXgssbTd1bKrPznE4LZH 47LmnTnaM84oZU3Iu4eOML+7DXpWmqaitSveYGdk= Message-ID: <955f2236d9af54c450e988d32c48690cca8be08c.camel@student.tugraz.at> Subject: Re: Question: wrap-program without #:sh can be ok even when cross-compiling? From: Leo Prikler To: Maxime Devos Date: Sun, 06 Jun 2021 12:57:49 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622977103; 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=ERz+JycSA5NfePXTkrZQhvgy8nLghlGjSFW9axdVij8=; b=pAFMl8T763lFm20UwXM1MlAtA6JCZ2H3i4OTNy5soWvGaj1x4tQ3u7Y2lSidcWTVtjE6x1 gwiJRprbbRg/KunAtc+I3i0pJ+Pel4T6o7XlAY9v0c4RWf/RYDg/kht/0Zh0BFfoJJukDE 2SIQmZ2uN/sTby3T1F8bUMgYfT8/WduFppiKfpx9jk7XR0It2joKOKTbsnN9nxZ2WzEQUl WWyV4hbi3Ak2R8ARtwoyDsDxAJo1HV+NxGL5Bo2vuQej9582SrOLfLWLUUpm9rJbZbFisd 0opMj/G19yizi5gYhrg4vlf+THyy27SOwSJsOwMPhXGTGQUpPzvKH7cUQtocZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622977103; a=rsa-sha256; cv=none; b=NFwejjeXmK9v/j4NSNiVXLb54QuiUCjs7QZNw0BPlB5yKZZBlVz+Yir2oXv7WLt4P4Y5FG l+eaIJUrkwyKxujRaLO7LBSVhaVS8wimdKZtUTwwRDYuRZCAyYJbs7iDolNtudUatGtEm3 A15h67BqEEhk99kNuZBz1lrKXyRe4XngBTdmyugp9GSX8F1/IQietqLeYwBmut/prt/iB3 9+GIw/gCt5w7G720oZVkkts+wi6aXgBN19Xyn6QayscY9gFjdrLd6wQdt52jK9UPUC/49D rvyMAyQJb8t62qxPukrdZO2WmVlRmOOnMwKINS61N+8eOxWfjyeCUrdOJ0JUHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=tugraz.at header.s=mailrelay header.b=VOpDmldU; dmarc=pass (policy=none) header.from=student.tugraz.at; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=tugraz.at header.s=mailrelay header.b=VOpDmldU; dmarc=pass (policy=none) header.from=student.tugraz.at; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: B3D7E8A2C X-Spam-Score: -1.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: L7wguwf623Wm Am Sonntag, den 06.06.2021, 12:14 +0200 schrieb Maxime Devos: > Leo Prikler schreef op zo 06-06-2021 om 09:39 [+0200]: > > I think we might want to export a utility procedure > > (patch-shebangs files inputs) > > This procedure already exists, but is undocumented and > unexported. It is in (guix build gnu-build-system). > > (define* (patch-shebangs #:key inputs outputs (patch-shebangs? #t) > #:allow-other-keys) > [...]) This patch-shebangs doesn't take a list of files as arguments, it instead just iterates over all the files. I don't think this is particularly helpful in a cross-compiling context, where you want some files (most notably scripts, that don't get wrapped) to have its shebang drawn from inputs rather than native-inputs. You could use the patch-shebang primitive from (guix build utils), but you'd have to wrap it in something like (let ((path (search-path-as-list '("bin" "sbin") (map cdr INPUTS)))) (for-each (cute patch-shebang <> path) (find-files ...))) where INPUTS are inputs or native-inputs, whichever you want. Not very friendly imo. > > so that files used during build (e.g. configure, Makefile, etc.) > > can do > > (patch-shebangs build-stuff native-inputs) and the rest implicitly > > gets > > (patch-shebangs files inputs) during the patch-shebangs > > phase. WDYT? > > Looking at %standard-phases, we have > > (define %standard-phases > ;; Standard build phases, as a list of symbol/procedure pairs. > [...] > (phases [...] unpack bootstrap patch-usr-bin-file > patch-source-shebangs configure patch-generated-file- > shebangs > build check install > patch-shebangs [...])) > > Here, patch-source-shebangs calls patch-shebang for every file > in the source code. As #:path is not set, $PATH is used. Thus, > when cross-compiling, native-inputs (+ some implicit inputs) is used, > and when compiling natively, the union of native-inputs and inputs (+ > some implicit inputs) is used (*). > > Thus, the files used during build (configure, Makefile, ...) already > get a ‘good’ interpreter. (Unless I'm mistaken, I didn't test this.) I agree, that's the status quo. We want that to be retained, but we also want our cross-compilation story to be better. Hence imo allowing to pass files, constructing path from inputs and exporting this procedure might make sense. > (*) I looked into separating 'native-inputs' and 'inputs' even when > compiling > natively but it turned out to be more complicated than first > expected. Fair enough, nobody expects you to do everything at once. Regards, Leo