From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112989 invoked by alias); 8 Feb 2017 18:37:02 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 112970 invoked by uid 89); 8 Feb 2017 18:37:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL,BAYES_50,KAM_INFOUSMEBIZ autolearn=no version=3.3.2 spammy=H*M:info, locates, H*Ad:U*kawa, H*r:sk:kawa@so X-HELO: duck.birch.relay.mailchannels.net Received: from duck.birch.relay.mailchannels.net (HELO duck.birch.relay.mailchannels.net) (23.83.209.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Feb 2017 18:36:51 +0000 X-Sender-Id: hostpapa|x-authuser|peter@peterlane.info Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E3E9122767 for ; Wed, 8 Feb 2017 18:36:48 +0000 (UTC) Received: from hp114.hostpapa.com (unknown [100.96.13.40]) by relay.mailchannels.net (Postfix) with ESMTPA id E5C0A222E8 for ; Wed, 8 Feb 2017 18:36:47 +0000 (UTC) X-Sender-Id: hostpapa|x-authuser|peter@peterlane.info Received: from hp114.hostpapa.com ([TEMPUNAVAIL]. [172.20.103.196]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.18); Wed, 08 Feb 2017 18:36:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: hostpapa|x-authuser|peter@peterlane.info X-MailChannels-Auth-Id: hostpapa X-MC-Loop-Signature: 1486579008188:664873672 X-MC-Ingress-Time: 1486579008188 Received: from host86-137-207-130.range86-137.btcentralplus.com ([86.137.207.130]:54170 helo=[192.168.1.64]) by hp114.hostpapa.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cbX6d-004GZO-DS for kawa@sourceware.org; Wed, 08 Feb 2017 18:36:40 +0000 From: Peter Lane Subject: import path vs CLASSPATH To: kawa@sourceware.org Message-ID: <4f61b6b2-78f7-a327-6eb3-7778eab00233@peterlane.info> Date: Wed, 08 Feb 2017 18:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=0.6 X-AuthUser: peter@peterlane.info X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00049.txt.bz2 (This is not really a question, but more an observation - perhaps a curious query.) I found there's a difference between import path and CLASSPATH, with respect to how kawa locates libraries: "import path" seems to be relative to the input program, whereas CLASSPATH is relative to the caller. The Kawa documentation says "The default search path is |"."| - i.e. just search relative to the current root"; I was expecting the current root to be the directory where I ran kawa, but it appears to be the location of the program. e.g. if I use -Dkawa.import.path="./*.sld", library files are found only in the same directory as the program I run: > kawa --r7rs -Dkawa.import.path="./*.sld" dir/program.sps only finds libraries within dir, and fails if the required library is in the current (caller's) directory. (If the libraries are in 'dir' the import is unnecessary: kawa --r7rs dir/program.sps will find dir/mylibrary.sld.) However, if I compile the library: > kawa -C mylibrary.sld, and set CLASSPATH=. then the .class file for the library will be found relative to the caller's directory. I came across this because I'm working with a Java library and writing lots of scripts for different tasks. Some common functions are bundled up in a library, for them all to use. The library sits in the directory I run kawa from, and child directories hold the scripts. I've set my run script to use the import path: -Dkawa.import.path="$(cd "$(dirname "$0")" ; pwd)/*.sld" which finds the script's path and sets up an absolute path to the import location. Now I'm aware of this, it's not a problem, but it did confuse me for a bit. -- Peter Lane http://peterlane.info/scheme.html