From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uMfIEV7OcmOKDwAAbAwnHQ (envelope-from ) for ; Tue, 15 Nov 2022 00:25:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id OEfZEF7OcmMHcQEAG6o9tA (envelope-from ) for ; Tue, 15 Nov 2022 00:25:18 +0100 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 372DB3B386 for ; Tue, 15 Nov 2022 00:25:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouioV-0000S8-Tb; Mon, 14 Nov 2022 18:24:27 -0500 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 1ouifT-00061f-Kj for help-guix@gnu.org; Mon, 14 Nov 2022 18:15:09 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ouYsd-0004cX-B7 for help-guix@gnu.org; Mon, 14 Nov 2022 07:48:05 -0500 Received: by mail-ed1-x52b.google.com with SMTP id z18so17105627edb.9 for ; Mon, 14 Nov 2022 04:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=N67yqgMYLV8EzM+4FlcbMGgxzqx/cyvk2D8hn/ZeW6M=; b=KQ7EFSuvbX81n/s+XCZRQ9zgv+juCE1UZuQqF/JnBedU5Z/BXcTlndLFcpx0j8wvVj IuLp1KMYUoIuHd+DHUMjEY9flqdVGhdKYElbI7dWXGPgWEK5GFsUEAg0jjRUEdz0Blap GKbiUaocFcipiVkDM2yai/MqWqjEo6pMQppVLallWl0td6tzlkHRWLeykq5yKjRAnzSp QBtO13iEoyqHB33ACu1cOlvot/uHHHK2IR+WahxUiNQvyTQJkLlo5RKVXR2bTJdPluFZ YWW1sN439zGPf07/hv9n/mHbko0NhO0JiK5yxM7X5u2mfv5dH71UEBjxJ1L5557kKMr9 6fMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N67yqgMYLV8EzM+4FlcbMGgxzqx/cyvk2D8hn/ZeW6M=; b=DAXsHIK0nsfpxsdAtxoRYMBZqO7ihhq3QxycNXVsiWuvUmjW1V3zvehffaYSQqK00k RtzXzoq10JtSFi78D6fcfxNRBpqKtXd74koBT1FRLSOAL/ppYobZHEmgMpqb+KWo9uS3 UTB8NneSDHH7R8knvMR/MwFf2FuOKMIsWHedVN1/EQyCViXnchcaEo57OwQMVRWze50u NhGFqVget+qnp7WhM4Npb7DznknrO8CzlJ9DtHH3bRHJLuUSh+t9NnSNHP0aHhfpYApN 70Jeft4nKMt9oC/W1kiTw+orWaNlo5swAWQ/88R44ltxCWeYjASbYtpwXsdC3M9fSIip DqkQ== X-Gm-Message-State: ANoB5plmmeYbL8Eiqo+fCM53k6EwwRKmrA/QmcXTlJVdcr45YLX0surW HLhfg2EmxXbny6LzVyL9pQSZL4QD81o= X-Google-Smtp-Source: AA0mqf7MsVNBjEdZxyRqx9BCz2MuwTeXGm7pejYVnAeULUo1KYB0VTPzNt4TCKitAbwzehTkHYPELg== X-Received: by 2002:a50:ee01:0:b0:459:dff1:e145 with SMTP id g1-20020a50ee01000000b00459dff1e145mr11240251eds.134.1668430081114; Mon, 14 Nov 2022 04:48:01 -0800 (PST) Received: from localhost ([141.226.13.150]) by smtp.gmail.com with ESMTPSA id es21-20020a056402381500b0045ce419ecffsm4789330edb.58.2022.11.14.04.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 04:48:00 -0800 (PST) Date: Mon, 14 Nov 2022 14:47:58 +0200 From: Efraim Flashner To: Tom Willemse Cc: help-guix@gnu.org Subject: Re: SCSH libraries search path Message-ID: Mail-Followup-To: Tom Willemse , help-guix@gnu.org References: <871qqoxxyd.fsf@ryuslash.org> <87k03ymkce.fsf@ryuslash.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DCZVLzKgOUGWv0vJ" Content-Disposition: inline In-Reply-To: <87k03ymkce.fsf@ryuslash.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=efraim.flashner@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668468318; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=N67yqgMYLV8EzM+4FlcbMGgxzqx/cyvk2D8hn/ZeW6M=; b=q4yZ0sHFlkZxgRzqz5+IUxChR8v7sftagNXBlWV10HFaFEPjlnjnkr7/vEshBldbqGeCmn fhO0nUQlQPgTNQO1vDhgckbPyZq3S+VWUm0VE824dMzUKZVByQgJiheUZ/3Q7zholXHXEb Mrufz0woTR3/KBZ8vIPoQNVv1SX1l/75X5oDY7k3/WYfFrvdnGjxNEan+P1l/LsybOaMST m+dEBx0k7QP+b1j9rmQOIdxnQWe/awb8YoJtj9NY9YVBS/3BKSPT4/MBMs5OKXPHGCT7kH xahmzzUQ2gAsl2Y7d//ReEhEOhsA+kJyZkaY13ZFO04xGzUuJfvGa2v8DQdsaw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668468318; a=rsa-sha256; cv=none; b=X27/lAi53KbJlqrkucSnsd75VCwUbxo1Xy6IM+IqzOOeHg7FdYZP5LJJJyjOdG5i8+vyTg H2pKadaEJlN338pskna2DkITkLgdUF3wvxG5aYhbCRim/uxke8HSMDgfTyrRQmb+ilk50K nbQN7gwF68ZyDKrQK8n2j4csVZaqq8BHlupGKDFX2eScmjg11yVTadnqaaALNy+CC7kMDF 9lSeORWCun/njBIIh+LEWTrTzMQtzs0y9uz3JEWNyus9sxZpmTz79MFh6/3HmINwvzXHxI n1z+q+By7hP1uz66E4Pgn2ugEY7O0Kc2+gyNmMIVBaQSHcmDT41lxr4xsd+wSw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KQ7EFSuv; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KQ7EFSuv; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 372DB3B386 X-Spam-Score: -0.44 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8LOsDTsC5Krt --DCZVLzKgOUGWv0vJ Content-Type: multipart/mixed; boundary="36pb2doUjxKwafea" Content-Disposition: inline --36pb2doUjxKwafea Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 13, 2022 at 04:49:05PM -0800, Tom Willemse wrote: > Hey Efraim, >=20 > Efraim Flashner writes: >=20 > > On Mon, Oct 31, 2022 at 12:18:50AM -0700, Tom Willemse wrote: > >> Hey Guix \o/ > >>=20 > >> I've been wanting to package one of my little scripts in Guix Home and > >> it uses a little library I wrote for SCSH. I've been looking at how > >> Search Paths work and I'm having trouble figuring out how to make this > >> work. > >>=20 > >> Search paths seem easy enough generally, I was able to add a simple > >> addition to my configuration by just adding this to the scsh package > >> definition: > >>=20 > >> (native-search-paths > >> (list (search-path-specification > >> (variable "SCSH_LIB_DIRS") > >> (files '("share/scsh/site"))))) > > > > Try adding the 'separator' field, so it would look like this: > > > > (native-search-paths > > (list (search-path-specification > > (variable "SCSH_LIB_DIRS") > > (separator " ") > > (files '("share/scsh/site"))))) >=20 > Thanks for the suggestion! Unfortunately this gets me a value of > `SCSH_LIB_DIRS' like >=20 > /home/chelys/.guix-home/profile/share/scsh-0.7 >=20 > which, when I try the command `scsh -ll mpd.scm -o mpd' causes the > following error to appear: >=20 > error: Illegal path element in $SCSH_LIB_DIRS > $SCSH_LIB_DIRS: /home/chelys/.guix-home/profile/share/scsh-0.7 > The following element is not a string or #f: /home/chelys/.guix-home/= profile/share/scsh-0.7 >=20 > It's because SCSH treats the contents of `SCSH_LIB_DIRS' as "a sequence > of of s-expressions, which are `read' from the string"[1] and supports > either string values or the value #f. So `SCSH_LIB_DIRS' would have to > be in this case: >=20 > "/home/chelys/.guix-home/profile/share/scsh-0.7" >=20 > I guess this just isn't supported as yet in Guix? >=20 I played around with a bunch of different options, and I wasn't able to get the search-path-specification to pass the directories as strings. If we change the file-type to 'string then it looks for strings, but it really means it's looking for individual files or for directories, so that's not the right change. IMO the easiest way to work around it (from scsh, not from guix) would be to use 'stringify' from (scheme utilities) in (scheme lib-dirs) (for the syntactic sugar around symbol->string) to make all the items in the search path into strings if they aren't already. Actually I have a simple diff I'll send upstream that should take care of it. If you could help test it that'd be great. I haven't been able to create a scenario where I had more than one path in the SCSH_LIB_DIRS. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --36pb2doUjxKwafea Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="scsh-nonstring-search-path.patch" Content-Transfer-Encoding: quoted-printable diff --git a/scheme/lib-dirs.scm b/scheme/lib-dirs.scm index a1fc009..c630fb4 100644 --- a/scheme/lib-dirs.scm +++ b/scheme/lib-dirs.scm @@ -75,6 +75,7 @@ (let ((val (read))) (cond ((eof-object? val) '()) ((string? val) (cons val (recur))) + ((symbol? val) (cons (symbol->string val) (recur))) ((not val) (append default-lib-dirs (recur))) (else=20 (error=20 --36pb2doUjxKwafea Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="guix-scsh-with-search-paths.diff" Content-Transfer-Encoding: quoted-printable diff --git a/gnu/local.mk b/gnu/local.mk index bda6df1280..56727769df 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1833,6 +1833,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/sbcl-clml-fix-types.patch \ %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \ %D%/packages/patches/scalapack-gcc-10-compilation.patch \ + %D%/packages/patches/scsh-nonstring-search-path.patch \ %D%/packages/patches/scheme48-tests.patch \ %D%/packages/patches/scons-test-environment.patch \ %D%/packages/patches/screen-hurd-path-max.patch \ diff --git a/gnu/packages/patches/scsh-nonstring-search-path.patch b/gnu/pa= ckages/patches/scsh-nonstring-search-path.patch new file mode 100644 index 0000000000..c79e6cc51e --- /dev/null +++ b/gnu/packages/patches/scsh-nonstring-search-path.patch @@ -0,0 +1,12 @@ +diff --git a/scheme/lib-dirs.scm b/scheme/lib-dirs.scm +index a1fc009..c630fb4 100644 +--- a/scheme/lib-dirs.scm ++++ b/scheme/lib-dirs.scm +@@ -75,6 +75,7 @@ + (let ((val (read))) + (cond ((eof-object? val) '()) + ((string? val) (cons val (recur))) ++ ((symbol? val) (cons (symbol->string val) (recur))) + ((not val) (append default-lib-dirs (recur))) + (else=20 + (error=20 diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index cc34f0a0a0..c5ceb3192b 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -613,7 +613,8 @@ (define-public scsh (file-name (string-append name "-" version "-checkout")) (sha256 (base32 - "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q")))) + "1ghk08akiz7hff1pndi8rmgamgcrn2mv9asbss9l79d3c2iaav3q")) + (patches (search-patches "scsh-nonstring-search-path.patch")))) (build-system gnu-build-system) (arguments `(#:test-target "test" @@ -632,6 +633,11 @@ (define-public scsh (list scheme48 scheme48-rx)) (native-inputs (list autoconf automake)) + (native-search-paths + (list (search-path-specification + (variable "SCSH_LIB_DIRS") + (separator " ") + (files '("share/scsh-0.7"))))) (home-page "https://github.com/scheme/scsh") (synopsis "Unix shell embedded in Scheme") (description --36pb2doUjxKwafea-- --DCZVLzKgOUGWv0vJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmNyOPoACgkQQarn3Mo9 g1G1MA//X3bJOIjf2nZTYvYdxF3FEHdEKqCXwh3PtNDThSlAXXSAocqgFDcrmEfg R0vfJGV6dVOfFYy2BiZi7oVGqWAdMdI0pd8VTkxEJXs5uyCCiYvtmrKbULvjrETi X9hTSjwJW2eB5hycFSM8Y8PFyGPBmb6hKWtfwkuP8ipYnwM9NqIaVF4QTV1mkkOK edJLbEbcRp7La1IOcx/UIHdThVMT0XvJgpkO7b8se6ZE05ZNseePCb6VgThASMYm bYbLZGlxdMLVdCeod9VnmhbeJr4Hjn1sDeWgFwzWGm/c5kMhLqvewL+CygfOYL1E 6a8Qpuvom8nD1uSevvMRRke/B7n/MrYuUrNaJUfnfxhn6w4I8VqrG8X/WwLYqS/n LRw7xVruB0wWT9Kq0lnVP98vzER2HdCLIgVOkbqnB2Kc6zfF0vARNdi17kt8NDTF dIsnqrxmbLuJOKiS7eZOU4SXFj8absWILrwP1c/rY3mtmnRL9Yylwb8LKkQhnjmM 0PTxz9ryXeIuZuKNOm9eAmO2e8G7n3Qz+XkAJEs0vUSWZMcGF+eqgJIpoZ83T//c Rqd6zyF3HjYUwqXsNWvy/Xx1okdaNUMDvyWEHgAvB0PQxRapKYFR59tAvXpxACRv SimTxqOPP+MFF6euV0HOuHbdDBu4OpxG/vSoHRVV20gC7/6yqyw= =8OXe -----END PGP SIGNATURE----- --DCZVLzKgOUGWv0vJ--