Dyalog / link

Source code for Link – the built-in component that enables the use of text files as the primary storage mechanism for APL source code
https://dyalog.github.io/link
MIT License
19 stars 10 forks source link

]LINK.Create issues a warning if .NET not present - but doesn't bring in any code #227

Closed mbaas2 closed 3 years ago

mbaas2 commented 3 years ago

Describe the bug A ran ]LINK on a MacOS installation which has no .NET. It produced a warning about the lack of filesystem watchers - but also did not bring in any of my code. That's a bit unexpected - it should either issue that msg as ERROR - or bring in the code (the msg seems to indicate that it just won't be able to catch changes of code from outside, which is fine under these circumstances)

To Reproduce

  1. launch Dyalog
  2. ]LINK.Create # {pathToFolderWithCode}

Expected behaviour Show msg as before but import the folder...

Session transcript

]link.create # ~/Documents/Git/foo/Code

Link Warning: ⎕SE.Link.Create: .NET or .NetCore not available - Link cannot watch directory

Linked: # → /Users/m/~/Documents/Git/foo/Code

Desktop (please complete the following information): ]tools.version Dyalog 18.1.40095 64-bit Unicode, BuildID 347ebd98
OS Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x Link 2.1.0-beta47
SALT 2.9
UCMD 2.5
.NET
WS 18.1

  86_64 
mkromberg commented 3 years ago

This is not a bug, as you can see from the output, Link does not expand the "\~". Possibly, we should issue an error if the folder name starts with "\~", even though /Users/m/~/Documents is a valid file name on a Mac.

mbaas2 commented 3 years ago

Oh, right - I didn't pay attention to that bit and misinterpreted the msg :( I'm still a novice with MacOS, but my understanding was that ~ could be used as a placeholder for my HOME-Folder. In which case it would be handy if ]LINK could expand it...

mkromberg commented 3 years ago

The expansion is done by the Linux and macOS shells, not by the file system. This discussion comes up from time to time but so far our conclusion has always been that the Dyalog file system should NOT be doing this.

Whether user commands should do it is of course an interesting question.

nicolas-dyalog commented 3 years ago

Works as expected : when no "watch" setting is provided, Link falls back to watch=ns and warns about it. When watch=dir is explicitly set, Link does error :

        ]Link.Create # '/tmp/mydir'
 Link Warning: ⎕SE.Link.Create: .NET or .NetCore not available - Link cannot watch directory 
 Linked: # → /tmp/mydir
       ]link.status
  Namespace  Directory   Items 
  #          /tmp/mydir      0 
       ]link.break #
 Unlinked 0 items in: #
       ]Link.Create -watch=dir # '/tmp/mydir'
 ⎕SE.Link.Create: Watching directories requires Dyalog v18.0 and either .NET or .NetCore
       ]link.status
 No active links