-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
In the process of trying to get this hello world example working, I kept encountering the following error:
uncaught exception: "ssh binary not found"
To run this I am using DrRacket 8.3 on a windows 10 computer. I have OpenSSH client installed with the binaries in their default location (C:\Windows\System32\OpenSSH). I also have this path included in my PATH variable.
Upon further inspection of the source code I noticed the error is raised from the following piece of code in the distributed.rkt file:
`; find ssh-binary
(define (ssh-bin-path)
(define (exists? paths)
(and paths
(for/or ([p paths]) (and (file-exists? p) p))))
(define (fallback-paths)
(exists?
(case (system-type 'os)
[(unix macosx)
(list "/usr/local/bin/ssh" "/usr/bin/ssh" "/bin/ssh" "/opt/local/bin/ssh" "/opt/bin/ssh")]
[(windows) #f])))
(define (which cmd)
(define path (getenv "PATH"))
(and path
(exists? (map (lambda (x) (build-path x cmd))
(regexp-split (case (system-type 'os)
[(unix macosx) ":"]
[(windows) "#:;"])
path)))))
(or (which "ssh")
(fallback-paths)
(raise "ssh binary not found")))`
Upon experimenting with with function, I noticed that the regxp-split does not correctly split the PATH string. As a result it never finds the SSH binaries. Using (find-executable-path "ssh") find the ssh binaries just fine in the current version of DrRacket (maybe this is also the fix?).