public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* chasing symlinks during import
@ 2014-11-29 18:14 Seth Alves
  2014-12-01 22:37 ` Per Bothner
  0 siblings, 1 reply; 5+ messages in thread
From: Seth Alves @ 2014-11-29 18:14 UTC (permalink / raw)
  To: kawa

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]


I'm confused about why the attached doesn't work.

Maybe what I actually want is for the "." in kawa.import.path to refer 
to the directory containing the toplevel (program) file rather than the 
file doing the importing?

If the symlinks are replaced with the actual files, it does work.

     -seth


[-- Attachment #2: kawa-symlinked-imports.tar.gz --]
[-- Type: application/gzip, Size: 567 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chasing symlinks during import
  2014-11-29 18:14 chasing symlinks during import Seth Alves
@ 2014-12-01 22:37 ` Per Bothner
       [not found]   ` <54958681.7080604@hungry.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Per Bothner @ 2014-12-01 22:37 UTC (permalink / raw)
  To: kawa



On 11/29/2014 10:14 AM, Seth Alves wrote:
>
> I'm confused about why the attached doesn't work.
>
> Maybe what I actually want is for the "." in kawa.import.path to
> refer to the directory containing the toplevel (program) file rather
> than the file doing the importing?
>
> If the symlinks are replaced with the actual files, it does work.

The problem was that Kawa would calculate paths relative to the
*canonical" name of the importing file, rather than the requested name.
Not clear what is best, but probably most of the time using the
canonical name is probably not desirable.

I checked in a change to do that, so yur example should now work.

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chasing symlinks during import
       [not found]   ` <54958681.7080604@hungry.com>
@ 2014-12-20 20:11     ` Seth Alves
  2014-12-21 20:27       ` Per Bothner
  0 siblings, 1 reply; 5+ messages in thread
From: Seth Alves @ 2014-12-20 20:11 UTC (permalink / raw)
  To: kawa


You probably guessed this, but this is the change that made the 
symlinked-libs example fail again.

     -seth

Index: kawa/standard/ImportFromLibrary.java
===================================================================
--- kawa/standard/ImportFromLibrary.java        (revision 8235)
+++ kawa/standard/ImportFromLibrary.java        (working copy)
@@ -253,9 +253,9 @@
...
-        Path currentSource = currentFileName == null ? null
-            : Path.valueOf(currentFileName).getAbsolute();
+        Path currentSource = curinfo.getSourceAbsPath();




On 12/20/2014 06:24 AM, Seth Alves wrote:
> This was fixed, but I think there has been a regression.  I see it 
> attempting to load
>
>   ./libs/../.././a/b/blerg.sld
>
> where
>
>   ./libs/.././a/b/blerg.sld
>
> might have worked.
>
>     -seth
>
>
> On 12/01/2014 02:37 PM, Per Bothner wrote:
>>
>>
>> On 11/29/2014 10:14 AM, Seth Alves wrote:
>>>
>>> I'm confused about why the attached doesn't work.
>>>
>>> Maybe what I actually want is for the "." in kawa.import.path to
>>> refer to the directory containing the toplevel (program) file rather
>>> than the file doing the importing?
>>>
>>> If the symlinks are replaced with the actual files, it does work.
>>
>> The problem was that Kawa would calculate paths relative to the
>> *canonical" name of the importing file, rather than the requested name.
>> Not clear what is best, but probably most of the time using the
>> canonical name is probably not desirable.
>>
>> I checked in a change to do that, so yur example should now work.
>>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chasing symlinks during import
  2014-12-20 20:11     ` Seth Alves
@ 2014-12-21 20:27       ` Per Bothner
  2014-12-22 14:38         ` Seth Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Per Bothner @ 2014-12-21 20:27 UTC (permalink / raw)
  To: kawa



On 12/20/2014 12:10 PM, Seth Alves wrote:
>
> You probably guessed this, but this is the change that made the symlinked-libs example fail again.
>
>      -seth
>
> Index: kawa/standard/ImportFromLibrary.java
> ===================================================================
> --- kawa/standard/ImportFromLibrary.java        (revision 8235)
> +++ kawa/standard/ImportFromLibrary.java        (working copy)
> @@ -253,9 +253,9 @@
> ...
> -        Path currentSource = currentFileName == null ? null
> -            : Path.valueOf(currentFileName).getAbsolute();
> +        Path currentSource = curinfo.getSourceAbsPath();

Please try now.

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: chasing symlinks during import
  2014-12-21 20:27       ` Per Bothner
@ 2014-12-22 14:38         ` Seth Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Seth Alves @ 2014-12-22 14:38 UTC (permalink / raw)
  To: kawa

The latest works for my use-cases.

     -seth

On 12/21/2014 12:27 PM, Per Bothner wrote:
>
>
> On 12/20/2014 12:10 PM, Seth Alves wrote:
>>
>> You probably guessed this, but this is the change that made the 
>> symlinked-libs example fail again.
>>
>>      -seth
>>
>> Index: kawa/standard/ImportFromLibrary.java
>> ===================================================================
>> --- kawa/standard/ImportFromLibrary.java        (revision 8235)
>> +++ kawa/standard/ImportFromLibrary.java        (working copy)
>> @@ -253,9 +253,9 @@
>> ...
>> -        Path currentSource = currentFileName == null ? null
>> -            : Path.valueOf(currentFileName).getAbsolute();
>> +        Path currentSource = curinfo.getSourceAbsPath();
>
> Please try now.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-22 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-29 18:14 chasing symlinks during import Seth Alves
2014-12-01 22:37 ` Per Bothner
     [not found]   ` <54958681.7080604@hungry.com>
2014-12-20 20:11     ` Seth Alves
2014-12-21 20:27       ` Per Bothner
2014-12-22 14:38         ` Seth Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).