From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam McCartney Newsgroups: gmane.lisp.guile.user Subject: Setting Date: Sat, 2 Nov 2024 16:25:51 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2700"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Nov 02 16:26:49 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t7G1Z-0000Z6-2i for guile-user@m.gmane-mx.org; Sat, 02 Nov 2024 16:26:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7G0x-0005Tr-TZ; Sat, 02 Nov 2024 11:26:11 -0400 Original-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 1t7G0v-0005TO-FH for guile-user@gnu.org; Sat, 02 Nov 2024 11:26:09 -0400 Original-Received: from efeu.mur.at ([89.106.208.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7G0r-0002bn-An for guile-user@gnu.org; Sat, 02 Nov 2024 11:26:09 -0400 Original-Received: from localhost (2a02-8388-1886-ea00-a030-1454-1b47-0ac7.cable.dynamic.v6.surfer.at [IPv6:2a02:8388:1886:ea00:a030:1454:1b47:ac7]) by efeu.mur.at (Postfix) with ESMTPSA id 9A53445F24 for ; Sat, 2 Nov 2024 16:25:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mur.at; s=dkim2; t=1730561152; bh=EkQJs/6hsK8wERIqpgBStg2g6SthZtQzz99KSf0GKMg=; h=Date:From:To:Subject:From; b=MAPE/Xo+UoRK4cvuHkcSg5TBBZ5nF7u8fvqWg480jRO1+/CwYwalbeSwgzNw/JoD7 RPUEs0CjGecFqqk0hD95ANsezHmMm/sqksGL6egMTxkQkWOZYknUKKQzR09L4xR+5H eJ9ST9sstWCLPNyt6gIhLqT3aA3mTkSLxzxt5u4TJKA97ffknyOJIV/jXonMz9fT5p 4HLTroEbvcYfY3qWkvYfXvw73z4hxheMrmxMyTNh8Z1dQywnmL/2ZDYDZzflPmPO2R +INj3UjzScas9GehIS0SCwuClB5r0/bOUqwHQKaD05uX6d97QOaTcn7/ynlPR8oxt7 F2obLK1EVKBKO2jne0XzoUrZ9WXFlpGWwABSwNqFY/epaP3WE6TaL2/XIsa1k5WqSY AnH2GlB0NtxRi9Bh00mdYkHp8u3JEPrh6z3Psv7VX43lZcUSdoTQqlyv+sIRqNuWe3 1up24XQc94xIr59xXBFQxtsTHowIkO7bA2h11bB+nIL7/jRtcp0 Content-Disposition: inline Received-SPF: pass client-ip=89.106.208.42; envelope-from=adam@mur.at; helo=efeu.mur.at X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19871 Archived-At: Dear Guile Users! I wonder if one of you might be able to help me understand how GUILE_EXTENSIONS_PATH is supposed to find shared libraries. My understanding from reading the docs is that using the GUILE_EXTENSIONS_PATH variable is the preferred way to do this as of guile 3.0.6 From the docs: > Unless library denotes an absolute file name or otherwise contains a directory > separator (/, and also \ on Windows), Guile will search for the library in the > directories listed in search-paths. The default search path has three > components, which can all be overridden by colon-delimited (semicolon on > Windows) environment variables: I'm using `guile-3.0.9` from `guix` and my program doesn't seem to be able to locate the shared library. Initially I thought it might have to do with guile not picking up the GUILE_EXTENSION_PATH variable correctly from the environment. At the moment, I'm just trying to run a very simple program: (use-modules (system foreign-library)) (load-foreign-library "libpd") To be clear, it seems to work fine if I set the variable and start an interactive bash session and from there launch guile. However, I'd like to be able to run the program directly like the following: guix shell -m manifest -- guile -s src/main.scm This seems to _not_ pick up the GUILE_EXTENSION_PATH variable as expected. Probably I'm missing something obvious about how guile starts up from within a guix shell. I tried the invocation: guix shell -m manifest -- \ env GUILE_EXTENSION_PATH=$GUIX_ENVIRONMENT/lib \ guile -s src/main.scm And was surprised to see that it doesn't pick up GUIX_ENVIRONMENT - I guess this makes sense as the environment probably hasn't been loaded yet? So back in guile land, I tried to set the GUILE_EXTENSION_PATH variable from an interactive guile session: scheme@(guile-user)> (setenv "GUILE_EXTENSIONS_PATH" (string-append (getenv "GUIX_ENVIRONMENT") "/lib")) And tried to load the libary: scheme@(guile-user)> (use-modules (system foreign-library)) scheme@(guile-user)> (load-foreign-library "libpd") ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure dlopen: file "libpd.so", message "libpd.so: cannot open shared object file: No such file or directory" But it's definitely there: scheme@(guile-user)> (load-foreign-library (string-append (getenv "GUILE_EXTENSIONS_PATH") "/libpd")) $3 = #< filename: "/gnu/store/25m9fzb29dqi5r3pvigpcdvv2hrz8w8b-profile/lib/libpd" handle: #> Anyway, I can probably find a workaround for this, but I'm just wondering if I miss something? Any help would be much appreciated! Regards, Adam -- Adam McCartney - https://admccartney.mur.at /