Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searching for files is over enthusiastic #1993

Open
nbriggs opened this issue Jan 29, 2025 · 12 comments
Open

searching for files is over enthusiastic #1993

nbriggs opened this issue Jan 29, 2025 · 12 comments

Comments

@nbriggs
Copy link
Contributor

nbriggs commented Jan 29, 2025

During startup, in the Maiko code that converts a Lisp version syntax name (file.ext;version) to a Unix version syntax (file.ext.~version~) I see the following sequence of calls (with the input and output, or if it doesn't match the required syntax, just the input):

in LVTUV: home>briggs>medley-main>greetfiles>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>greetfiles>BACKGROUND>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>greetfiles>BACKGROUND-YIELD.LCOM
in LVTUV: home>briggs>medley-main>greetfiles>BACKGROUND>BACKGROUND-YIELD.LCOM
in LVTUV: ~>BACKGROUND-YIELD.DFASL                        * where did this come from? *
in LVTUV: BACKGROUND>BACKGROUND-YIELD.DFASL
in LVTUV: ~>BACKGROUND-YIELD.LCOM                        * and this? *
in LVTUV: BACKGROUND>BACKGROUND-YIELD.LCOM
in LVTUV: home>briggs>medley-main>library>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>library>BACKGROUND>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>library>BACKGROUND-YIELD.LCOM
in LVTUV: home>briggs>medley-main>library>BACKGROUND>BACKGROUND-YIELD.LCOM
in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND>BACKGROUND-YIELD.DFASL
in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM

in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM;1
out LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM.~1~

in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM;1>     * and this? *

in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM;1
out LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM.~1~

in LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM;1
out LVTUV: home>briggs>medley-main>lispusers>BACKGROUND-YIELD.LCOM.~1~

It's too bad that it has to go probing for subdirectories if there's a hyphen in the file name.

When I accidentally had a scroll meta-character hit the Exec window, it went looking for a font (that it wasn't going to find):

in LVTUV: c2>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: c2>HELVETICA10>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: c2>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: c2>HELVETICA10>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: home>briggs>medley-main>fonts>displayfonts>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: home>briggs>medley-main>fonts>altofonts>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: home>briggs>medley-main>fonts>adobe>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: home>briggs>medley-main>fonts>big>c2>HELVETICA10-BRR-C2.DISPLAYFONT
in LVTUV: home>briggs>medley-main>fonts>other>c2>HELVETICA10-BRR-C2.DISPLAYFONT

For sure, LISPUSERSDIRECTORIES should not contain

({DSK}<home>briggs>medley-main>library> {DSK}<home>briggs>medley-main>lispusers> 
{DSK}<home>briggs>medley-main>internal> {DSK}<home>briggs>medley-main>greetfiles> 
{DSK}<home>briggs>medley-main>doctools>)

Doing (LOAD 'MEDLEYDIR-INIT 'ALLPROP) generated this sequence of version conversions:

in LVTUV: home>briggs>MEDLEYDIR-INIT
in LVTUV: home>briggs>MEDLEYDIR-INIT
in LVTUV: home>briggs>MEDLEYDIR>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>library>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>library>MEDLEYDIR>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>lispusers>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>lispusers>MEDLEYDIR>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>internal>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>internal>MEDLEYDIR>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT
in LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT.;1
out LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT..~1~
in LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT.;1>
in LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT.;1
out LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT..~1~
in LVTUV: home>briggs>medley-main>sources>MEDLEYDIR.LCOM
in LVTUV: home>briggs>medley-main
in LVTUV: home>briggs>medley-main>
in LVTUV: home>briggs>medley-main>library>
in LVTUV: home>briggs>medley-main>lispusers>
in LVTUV: home>briggs>medley-main>internal>
in LVTUV: home>briggs>medley-main>greetfiles>
in LVTUV: home>briggs>medley-main>doctools>
in LVTUV: home>briggs>medley-main>sources>
in LVTUV: home>briggs>medley-main>docs>dinfo>
in LVTUV: home>briggs>
in LVTUV: home>briggs>medley-main>fonts>displayfonts>
in LVTUV: home>briggs>medley-main>fonts>altofonts>
in LVTUV: home>briggs>medley-main>fonts>adobe>
in LVTUV: home>briggs>medley-main>fonts>big>
in LVTUV: home>briggs>medley-main>fonts>other>
in LVTUV: home>briggs>medley-main>fonts>postscriptfonts>
in LVTUV: home>briggs>medley-main>fonts>ipfonts>
in LVTUV: home>briggs>medley-main>unicode>xerox>
in LVTUV: home>briggs>
in LVTUV: home>briggs>medley-main>loadups>
in LVTUV: home>briggs>medley-main>loadups>whereis.hash
in LVTUV: home>briggs>medley-main>loadups>
in LVTUV: home>briggs>
in LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT.;1
out LVTUV: home>briggs>medley-main>greetfiles>MEDLEYDIR-INIT..~1~
@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

Trying to load a non-existent file NONE;23 generated these lookups:

in LVTUV: home>briggs>NONE.;23
out LVTUV: home>briggs>NONE..~23~
in LVTUV: home>briggs>NONE
in LVTUV: home>briggs>NONE>NONE
in LVTUV: home>briggs>medley-main>library>NONE
in LVTUV: home>briggs>medley-main>library>NONE>NONE
in LVTUV: home>briggs>medley-main>lispusers>NONE
in LVTUV: home>briggs>medley-main>lispusers>NONE>NONE
in LVTUV: home>briggs>medley-main>internal>NONE
in LVTUV: home>briggs>medley-main>internal>NONE>NONE
in LVTUV: home>briggs>medley-main>greetfiles>NONE
in LVTUV: home>briggs>medley-main>greetfiles>NONE>NONE
in LVTUV: home>briggs>medley-main>doctools>NONE
in LVTUV: home>briggs>medley-main>doctools>NONE>NONE
in LVTUV: home>briggs>medley-main>sources>NONE
in LVTUV: home>briggs>medley-main>sources>NONE>NONE
in LVTUV: home>briggs>medley-main>library>NONE
in LVTUV: home>briggs>medley-main>lispusers>NONE
in LVTUV: home>briggs>medley-main>internal>NONE
in LVTUV: home>briggs>medley-main>greetfiles>NONE
in LVTUV: home>briggs>medley-main>doctools>NONE
in LVTUV: home>briggs>medley-main>sources>NONE

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 29, 2025 via email

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

I'm not sure that (FROM VALUEOF (HOST&DIR ...)) is a pattern we'd want to promote, though. It would cut down on the number of attempts that it would make for hyphenated packages that know about themselves, but doesn't help files that just happen to have a hyphen in their names.

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 29, 2025 via email

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

Looking at DOFILESLOAD - it appears that it's already trying to give priority to the location of the file it is loading for other files that get loaded, but I wonder if something is going wrong in the way it does this?

(COND ((BOUNDP 'LDFLG)
       
       (* ;; "Under a load;  give priority to directory of currently loading file. ")

       (LET ((INPUTNAME (FULLNAME *STANDARD-INPUT*)))
            (if (AND (NEQ INPUTNAME *STANDARD-INPUT*)
                     (NEQ INPUTNAME T))
                then
                                                             (* ; 
                                        "If reading from terminal or nameless stream, don't do this.")
                (SETQ DIRS (CONS (PACKFILENAME.STRING 'VERSION NIL 'NAME NIL 'EXTENSION NIL
                                        'BODY INPUTNAME)
                                 (CONS T DIRECTORIES)))
                (SETQ LOADOPTIONSFLG LDFLG)))))

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 29, 2025 via email

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

It's not terrible for the case where it's actually a X/X-Y organized package. This is it trying to load TEDIT-BUTTONS.LCOM from within TEDIT.LCOM

LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.DFASL
LVTUV: home>briggs>medley>library>tedit>TEDIT>TEDIT-BUTTONS.DFASL *** it's already in the subdir, but tries adding another one because the file wasn't found and it had a dash in the name.
LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.LCOM
LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.LCOM;1
LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.LCOM;1>    **** not sure what's generating this
LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.LCOM;1
LVTUV: home>briggs>medley>library>tedit>TEDIT-BUTTONS.LCOM;1

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

I think the hyphenated file name processing is interacting badly with the font file names, where there are a bunch of hyphens separating components

LVTUV: c0>c0>MODERN10-MRR-C0.DISPLAYFONT
LVTUV: c0>MODERN10>c0>MODERN10-MRR-C0.DISPLAYFONT
LVTUV: c0>c0>MODERN10-MRR-C0.DISPLAYFONT
LVTUV: c0>MODERN10>c0>MODERN10-MRR-C0.DISPLAYFONT
LVTUV: home>briggs>medley>fonts>displayfonts>c0>MODERN10-MRR-C0.DISPLAYFONT

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 29, 2025 via email

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 29, 2025 via email

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 29, 2025

These are logged at the point it tries to convert a Lisp-style versioned name to a Unix-style versioned name. To see what is initiating (on the Lisp side) this I'll have to trigger a URaid call and look at the Lisp stack.

@nbriggs
Copy link
Contributor Author

nbriggs commented Jan 30, 2025

The extra > showing up is when the stack looks like below -- \UFSOpenFile called DIRECTORYNAMEP on the whole name, because it's trying to see if it is a directory instead of a file and then refusing to open it if it's a directory... Sigh.

  0 :    0x132de : IL:\DSKDirectoryNameP-C
  1 :    0x132b8 : SI:*UNWIND-PROTECT*
  2 :    0x132a0 : IL:\UFS.DIRECTORY.NAME
  3 :    0x1327e : IL:\UFSDirectoryNameP
< f3
IVAR -------
  13278 : 0x  69  0xe790  *local* IL:DIRSPEC  "{DSK}<Users>briggs>Projects>medley>sources>MEDLEYDIR.LCOM;2>"
  1327a : 0x  7c  0x6200  *local* IL:DEV  {IL:FDEV}0x7c6200

## STACK BF at 0x1327c ##
[cnt=0 ]
ivar : 0x3278
>> Bf's ivar says 0x13278 vs. IVar says 0x132d6
Fname is IL:\UFSDirectoryNameP
## STACK FX at 0x1327e ##
[cnt = 0 ]
 #alink           0x326a 
 fnhead   0x31cf8c 
 nextblock        0x3298 
 pc               0xac 
 nametbl  0x328e005c 
 #blink           0xe 
 #clink           0x3c 
  13288 : 0x  69  0xed38  *local* [pvar0]   "Users>briggs>Projects>medley>sources>MEDLEYDIR.LCOM;2>"
  1328a : 0x  69  0xed08  *local* [pvar1]   ""
  1328c : 0x   0  0x   0  *local* [pvar2]   CL:NIL


  4 :    0x13260 : IL:DIRECTORYNAMEP

< f4
IVAR -------
  1325a : 0x  69  0xe770  *local* IL:DIRNAME  "{DSK}<Users>briggs>Projects>medley>sources>MEDLEYDIR.LCOM;2"
  1325c : 0x   0  0x   0  *local* IL:HOSTNAME  CL:NIL

## STACK BF at 0x1325e ##
[cnt=0 ]
ivar : 0x325a
>> Bf's ivar says 0x1325a vs. IVar says 0x132d6
Fname is IL:DIRECTORYNAMEP
## STACK FX at 0x13260 ##
[cnt = 0 ]
 #alink           0x321a 
 fnhead   0x2e924c 
 nextblock        0x3278 
 pc               0x70 
 nametbl  0x4c 
 #blink           0x0 
 #clink           0x0 
  1326a : 0x  69  0xe790  *local* [pvar0]   "{DSK}<Users>briggs>Projects>medley>sources>MEDLEYDIR.LCOM;2>"
  1326c : 0x  7c  0x6200  *local* [pvar1]   {IL:FDEV}0x7c6200
  1326e : 0x   0  0x16ad  *local* [pvar2]   IL:\UFSDirectoryNameP

  5 :    0x13210 : SI:*UNWIND-PROTECT*
  6 :    0x131f8 : IL:\UFSOpenFile
  7 :    0x131ce : IL:\OPENFILE
  8 :    0x131ae : IL:OPENSTREAM
  9 :    0x13180 : SI:*UNWIND-PROTECT*
 10 :    0x13164 : IL:LOAD
 11 :    0x13142 : IL:LOAD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants