Dyalog / qSE

Initialisation of ⎕SE, including source code that ends up somewhere in ⎕SE, and code to get it there.
https://help.dyalog.com/latest/#UserGuide/The%20APL%20Environment/Session%20Initialisation.htm
MIT License
4 stars 0 forks source link

Non-Windows: ~/.dyalog needs to be added to the directories which are searched for Run.aplfs etc #10

Open dyaandys opened 3 months ago

dyaandys commented 3 months ago

StartupSession.aplf@9d97012

In 19.0 on non-Windows platforms we currently look in the following directories for startup files (eg Run.aplf) /opt/mdyalog/19.0/64/unicode /home/andys/dyalog.files
/home/andys/dyalog.190U64.files

However, we are actually putting Tatin and Cider in /home/andys/.dyalog/dyalog.190U64.files. While we think about all of this for 20.0, the immediate problem is to allow Cider to work in 19.0 on non-Windows platforms. My suggestion is to simply add /home/andys/.dyalog/dyalog.190U64.files to the list of directories to be searched. The following seems to work:

In StartupSession.aplf replace (line 107 ish):

     :If 0∊≢¨envVars
         defaults←{
             verSpec←{
                 ⍵:NoSlash 2⊃4070⌶⍬ ⍝ win only: version specific folder in user docs folder
                 num←∊2↑'.'Cut ver
                 uc←'UC'/⍨80 82=⎕DR'' ⍝ unicode/classic
                 bits←¯2↑'32',{⍵↓⍨⍵⍳'-'}os
                 home,'/dyalog.',num,uc,bits,'.files'
             }⍵
             user←⊃⎕NPARTS verSpec ⍝ /../
             verAgno←user,'dyalog.files' 'Dyalog APL Files'⊃⍨1+⍵
             ∊¨1 ⎕NPARTS dyalog verAgno verSpec ⍝ normalise
         }win
     :EndIf

with

     :If 0∊≢¨envVars
         defaults←{
             verSpec←{
                 ⍵:NoSlash 2⊃4070⌶⍬ ⍝ win only: version specific folder in user docs folder
                 num←∊2↑'.'Cut ver
                 uc←'UC'/⍨80 82=⎕DR'' ⍝ unicode/classic
                 bits←¯2↑'32',{⍵↓⍨⍵⍳'-'}os
                 ∊¨(,\home '/.dyalog'),¨⊂'/dyalog.',num,uc,bits,'.files'
             }⍵
             user←⊃⊃⎕NPARTS verSpec ⍝ /../
             verAgno←∊¨(,\user '.dyalog/'),¨⊂'dyalog.files' 'Dyalog APL Files'⊃⍨1+⍵
             ∊¨1 ⎕NPARTS (⊂dyalog),verAgno,verSpec ⍝ normalise
         }win
     :EndIf
abrudz commented 3 months ago

I'm afraid we can't just do that, since that folder wouldn't be one of the default three (installation, version agnostic, version specific). We could instruct people to set the DYALOGSTARTUPSE config param or we could change to install Tatin and Cider in the correct location.

xpqz commented 1 month ago

Can you elaborate on why this is problematic? It's clearly designed to be extensible (hence the DYALOGSTARTUPSE env var).

abrudz commented 1 month ago

Sure, it is extensible, but if the effective value when not making changes isn't the default value, then the default isn't really a default.

xpqz commented 1 month ago

I still don't follow. How is this different from say the $PATH setting in a shell, or the include path for a compiler? A notional default which defines the minimum search space, and a clear extension mechanism for adding to this space.

On Wed, 14 Aug 2024 at 07:31, Adám Brudzewsky @.***> wrote:

Sure, it is extensible, but if the effective value when not making changes isn't the default value, then the default isn't really a default.

— Reply to this email directly, view it on GitHub https://github.com/Dyalog/qSE/issues/10#issuecomment-2287957615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUQ6JGNNGIJZ6BKT6JTOR3ZRL2UTAVCNFSM6AAAAABJGP43GWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBXHE2TONRRGU . You are receiving this because you commented.Message ID: @.***>

-- Stefan Kruger @.***>

abrudz commented 1 month ago

Maybe we're talking by each other? If I understand correctly, @dyaandys is asking for the default to be changed, while I'm saying that one should just use the extension mechanism to make things work.

dyaandys commented 1 month ago

.. I am asking for something which without a user having to do anything, allows non-Windows users to use Tatin and Cider. My suggestion of adding an additional directory to the search path is only for 19.0 .. we'll have to branch qSE for 20.0 as it'll have different and acceptable set of directories.

abrudz commented 1 month ago

19.0's session startup system is behaving as designed and documented. Why not just put Cider and Tatin into the correct location instead of making 19.0 look in the wrong location?