Closed norberturkiewicz closed 5 years ago
This and another bug reported by @aplteam now fixed. Both because the buildWsFromSource
function has to run in Dyalog 14.0 where neither ⎕NGET
nor ⎕NINFO
were available. The one due to ⎕WSID
s not always being full path depending on how it was )LOADed. The other by my assumption that line-ends were always either CR or CRLF. Now also copes with LF on it own.
Both fixed, committed and pushed.
I'm still experiencing the same issue with the latest pull. What info. can I provider?
path
C:\GitHub\CarlisleGroup\Acre-Desktop\
⍴cde
470
⍴dat
6
⍴dir
6
⍴fns
6
⍴¨fns
147 14 16 9 22 215
⎕wsid
C:\GitHub\CarlisleGroup\Acre-Desktop\build
display 10↑0⊃ fns
┌→────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ┌→───────────────────────┐ ┌→──────────────────────────────┐ ┌→──────────────┐ ┌→────────────────────┐ ┌→───────────────
│ │6,064 allMessages-8.aplf│ │ 101 aplArrayNotation-108.aplf│ │ 262 a_-0.aplo│ │ 879 buildWs-20.aplf│ │1,822 buildWsFro
│ └────────────────────────┘ └───────────────────────────────┘ └───────────────┘ └─────────────────────┘ └────────────────
└∊────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────┐ ┌→───────────────────┐ ┌→──────────────┐ ┌→───────────────────┐ ┌→───────────────────┐ ┌→─────────
mSource-8a0.aplf│ │ 617 caseOK-30.aplo│ │ 251 Cc-1.aplf│ │ 371 changes-0.aplf│ │1,089 Changes-1.aplf│ │ 168 Clos
────────────────┘ └────────────────────┘ └───────────────┘ └────────────────────┘ └────────────────────┘ └──────────
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
──────────┐
────────┐ │
e-1.aplf│ │
────────┘ │
──────────┘
Can I suggest a different CMD
cde←⎕CMD'dir /s /b /o "',src,'_code-0/"'
@PhilLast
will this do the trick?
buildWsFromSource←{
(⎕THIS #).(⎕IO ⎕ML ⎕WX)←⊂0 0 3 ⋄ LF CR BOM←⎕UCS 10 13 65279
path←{⍵/⍨⌽∨\⌽⍵∊'/\'}⎕WSID
src←path,'APLSource/_code-0/'
dir←⎕CMD'dir /s /b /AD /o "',src,'"'
fns←{⎕CMD'dir /s /b /A /o "',⍵,'"'}¨dir
fns←dir∘{(~⍵∊⍺)/⍵}¨fns
⍝ dat←(⊢(/⍨)1<≢¨)(⊢⊂⍨' '=⊃¨)(⊢(/⍨)0='<'∊¨⊢)~∘∊⍨cde
⍝ fns dir←⊢∘⊃¨\⌽↓⍉↑1(↑{⍺ ⍵}↓)¨dat
⍝ drop←{+/⍺≥+\2</0,' '≠⍵}
⍝ dir⊢←(2 drop⊃dir)↓¨dir
len←+/∨\⌽(⊃dir)∊'/\'
⍝ fns⊢←(3 drop⊃⊃fns)↓¨¨fns
read←((⎕NUNTIE⊢(⎕NREAD⊢,80,⎕NSIZE))0 ⎕NTIE⍨,)
tran←{CR LF(1↓¨∊⍨⊂⊢)CR,{⍵~BOM,LF/⍨CR∊⍵}'UTF-8'⎕UCS ⎕UCS ⍵}
get←{⍵↓⍨-0∊⍴⊃⌽⍵}tran∘read
⍝ data←dir{get∘((⍺,'/')∘,)¨⍵}¨fns
data←read¨¨fns
ns←(⍎''⎕NS⍨⊢)¨{{('..',⍵)[('\/',⍵)⍳⍵]}~∘('-',⎕D)⊢'#.acre.',len↓⍵}¨dir
fns←ns.(⎕FX¨)data
#.⎕LX←'#.acre._code.Install'''''
local←(2 ⎕NQ'.' 'GetEnvironment' 'localappdata'),'\acre\'
ver←local,'acre',{⍵/⍨∧\2>+\⍵='.'}1⊃'.'⎕WG'APLVersion'
z←⎕CMD'md "',ver,'"'
#.⎕WSID←ver,'\acre.dws'
'? )LOAD "',⎕WSID,'"'⊣0 ⎕SAVE #.⎕WSID⊣⎕EX⊃⎕XSI
⍝ This ws, stored in and loaded from the acre development folder
⍝ as "build.dws", creates the intallation ws, that's copied into
⍝ ⎕SE each session, in whatever Dyalog version ≥14.0 into which
⍝ it's loaded. It saves it as e.g. "/acre/acre16.0/acre.dws"
⍝ in whatever is returned by
⍝ 2 ⎕NQ'.' 'GetEnvironment' 'localappdata'
⍝ whence it can be )LOADed to associate the user commands with that
⍝ folder or copied to wherever the user requires acre installation
⍝ to reside and )LOADed thence.
⍝ Phil 2019-01-31 19.34
}
Not tried your version of the function in mine yet as only just seen but the first suggested CMD works a treat and all necessary information is there. Whether it's more efficient to do that and extract the dirs with an APL scan or do the multiple cmds might be academic if we can get something that works for everyone. I guess different versions of WIndows are not guaranteed to provide identically formatted results.
Thanks.
If the second version works it might better due to less moving parts. Your call.
One question is can I build in v14 and use in all later versions or do I need a separate distribution folder for each major dyalog version and point my SALT appropriately.
You can now use the v14.0 build in any later version that supports v14.0 wss - I don't know if v17.0 does - because of the switching that acre now does at startup where it overwrites the emulator function with the primitive where appropriate.
It didn't work at first because it ran the emulator function and skipped to code that contained the primitive but fixing in v14.0 had flagged it as a syntax error and it needed to be refixed.
Can you try again with latest as committed and pushed Saturday?
If it still doesn't work can you send your /acre/APLSource folder?
)LOADing
build.dws should end up saving [localappdata]/acre/acre14.0/acre.dws and displaying in the session
? )LOAD [wsid]
Either remove the "?" and run it from there or move the workspace elsewhere and )LOAD
it to associate the user commands. Once installed it should be good for all Dyalog versions.
I was able to run the build function and install acre-desktop in 14.0 with the latest repository pull.