From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 YFZZGB0Yf2M4owAAbAwnHQ (envelope-from ) for ; Thu, 24 Nov 2022 08:07:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QAhZGB0Yf2McXwAAauVa8A (envelope-from ) for ; Thu, 24 Nov 2022 08:07:09 +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 2E8F1CCA8 for ; Thu, 24 Nov 2022 08:07:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oy5ty-0002vD-36; Thu, 24 Nov 2022 01:40:02 -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 1oy5ts-0002ue-Ao for help-guix@gnu.org; Thu, 24 Nov 2022 01:39:57 -0500 Received: from r0-2.smtpout1.paris1.alwaysdata.com ([2a00:b6e0:1:40:1:0:10:6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oy5tp-0005uO-R7 for help-guix@gnu.org; Thu, 24 Nov 2022 01:39:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QRuSgIiqKAgqhgaH3qqBTfwcjmm9fv1aijppQ3eWsRM=; b=btUs3ny/saVXBPZd7ORPMFtvA HkCHY6rIHOhdtEJPVrruFgjAKkyrwjIN5eH+MU5yuNtzFAh7mewGZj5dlTnYStMFR+KnpiUClBHgA QKkudmzuq69em9S8bklLjrYz5NfxsBTNof9HjZshRcWdlwMl3s8DzGDU+RlCFSJUOj6rQ=; Received: from node-1w7jr9pql4sl12vllf8pnk2zz.ipv6.telus.net ([2001:569:5854:a00:d390:e431:f82d:72f] helo=localhost) by smtpout1.paris1.alwaysdata.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oy5tf-0002hj-Kw; Thu, 24 Nov 2022 07:39:43 +0100 From: Tom Willemse To: Efraim Flashner Cc: help-guix@gnu.org Subject: Re: SCSH libraries search path In-Reply-To: References: <871qqoxxyd.fsf@ryuslash.org> <87k03ymkce.fsf@ryuslash.org> Date: Wed, 23 Nov 2022 22:39:35 -0800 Message-ID: <87leo06el4.fsf@ryuslash.org> MIME-Version: 1.0 Content-Type: text/plain X-alwaysdata-ID: 162588445 Received-SPF: pass client-ip=2a00:b6e0:1:40:1:0:10:6; envelope-from=tom@ryuslash.org; helo=r0-2.smtpout1.paris1.alwaysdata.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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=1669273629; 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=QRuSgIiqKAgqhgaH3qqBTfwcjmm9fv1aijppQ3eWsRM=; b=W9sLXHQ+OXdzaH2swo+QTzhV77bUaJgp/5KL+42g8x+G9DeG+vfCFqYh8exjeuILtATQrH j9NfMc5HUuKGRKNnrSYwCDVm2Wz/GzHbkYwVIodsQ5Xj8cl0V03OIxSsNRm2JykVUqyZVy v/Z54WuSN1mUW6bKuyrvy7FNw/6Npfw5dDthWP9zKIrxi4HOtD0x15d2mvDz/AKE+JZBWk RKGAPn+guLvcy5U0AStfWiD6jcONLJGr8GwiXdY9Lh7y7ox36Wt5eAnMvr1+PEAqvi6HVL NxctAdWX4/b+zOTJoHA5lbdR9nh7Y5dVW6JVJ+71nYmtHymkM/pKTUO85nnbBQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669273629; a=rsa-sha256; cv=none; b=caNROFbs2z7MD2mbFViTETs2ZCvuAL38hzl5Vy6OUvxHEf/P7XoLpkGs8Y4atzmRAtLZq1 9zarU1yBA3woXLq5SaWxW4Y623zgRTBXxkavjuKtJ/bi3904eM+PEnHDr4mPCEIEgHL3pc QFsODNlchJkJr9/E2lYDXbguCsPtb/bDu6mkPZPTvMzlK0A6TX+8HOg5VXpOJn5Dxf2L9o jQSAHrFfgHNLE8swkq4ND5SfFkMa7eclh6/U6r/aQxSDq1KWBXlz7M65A3bVmmTYgS+hHw waUh+NpUeAVdgcZ1GSw7wgre3s7Vev4Xsg+JHejtKXx4ZgV5/KoSk+DITWea1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=alwaysdata.net header.s=default header.b="btUs3ny/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=ryuslash.org (policy=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: 6.50 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=alwaysdata.net header.s=default header.b="btUs3ny/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=ryuslash.org (policy=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: 2E8F1CCA8 X-Spam-Score: 6.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4TrEvdo+I6Vk Hey Efraim, Efraim Flashner writes: > On Sun, Nov 13, 2022 at 04:49:05PM -0800, Tom Willemse wrote: >> Hey Efraim, >> >> Efraim Flashner writes: >> >> > On Mon, Oct 31, 2022 at 12:18:50AM -0700, Tom Willemse wrote: >> >> Hey Guix \o/ >> >> >> >> 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. >> >> >> >> 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: >> >> >> >> (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"))))) >> >> Thanks for the suggestion! Unfortunately this gets me a value of >> `SCSH_LIB_DIRS' like >> >> /home/chelys/.guix-home/profile/share/scsh-0.7 >> >> which, when I try the command `scsh -ll mpd.scm -o mpd' causes the >> following error to appear: >> >> 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 >> >> 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: >> >> "/home/chelys/.guix-home/profile/share/scsh-0.7" >> >> I guess this just isn't supported as yet in Guix? >> > > 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. I've tried out your changes and it seems to work just great for my little module so far, thank you! > 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. I don't know how I would get more than one value in there with Guix, but manually adding another path in there works fine: > 22:36 ~ [1]> export SCSH_LIB_DIRS="\"${HOME}/usr/share/scsh/\" ${SCSH_LIB_DIRS}" > 22:37 ~ [130]> echo $SCSH_LIB_DIRS > "/home/chelys/usr/share/scsh/" /home/chelys/.guix-home/profile/share/scsh-0.7 > 22:37 ~ > scsh -ll mpd.scm -o mpd -ll herbstluft.scm -o herbstluft > Welcome to scsh 0.7 > Type ,? for help. > > (query (and (= artist "Danko Jones") (= album "Garage Rock"))) > "((artist == \"Danko Jones\") AND (album == \"Garage Rock\"))" > > (hc get_attr "my_wallpaper") > /home/chelys/pictures/wallpaper/5120x1440/nfbq2nw3rsm81.jpg > 0