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

windows support #66

Open
joinr opened this issue Sep 22, 2021 · 6 comments
Open

windows support #66

joinr opened this issue Sep 22, 2021 · 6 comments

Comments

@joinr
Copy link

joinr commented Sep 22, 2021

Given:

(ns m4tutorials.core
  (:require [notespace.api]))

#_(notespace.api/init-with-browser)

;;hello, this is a tutorial.

(+ 2 3)

["hello world"]

(def x :a)

2

and a dependency on [scicloj/notespace "3-beta9"]
, evaluating (notespace.api/init-with-browser) gives me:
notes

(notespace.api/eval-this-notespace ) leaders to an error in the JS on the browser side and a blank page.
Invoking (listen) yields a similar error in gorilla-notes js:

TypeError: ca is null (slew of minified gibberish elided).

I have no idea where to start trying to debug this, but am interested in getting it working for some recent tutorials I would like to develop. As I recall, gorilla had issues with windows before (I remember talking with the lead like a year ago, trying to get stuff working). Seems like this is a transitive issue with gorilla maybe.

@joinr joinr closed this as completed Sep 22, 2021
@joinr joinr reopened this Sep 22, 2021
@daslu
Copy link
Member

daslu commented Sep 30, 2021

Thanks, @joinr.

In few days, we will share an initial version of Notespace v4, and it will be interesting to check if the problem persists there.
The frontend (gorilla-notes) will remain the same, for some time. So maybe the problem will persist.

@joinr
Copy link
Author

joinr commented Nov 29, 2021

https://github.com/scicloj/notespace/blob/master/src/scicloj/notespace/v4/watch.clj#L6

fails on windows since sun.nio.fs.UnixPath doesn't exist.

examining the usage to determine a portable way to do this; can't load at all.

;;scicloj.notespace.v4.path/real-path returns nil for temp files, which are picked up by the regex.
;;naive fix is to modify the regex to ignore emacs tmp files. less naive fix would be to use a cleaner
;;path to convince windows file exists; but we don't really want to be looking at tmp files....

;;this prevents us from picking up emacs tempfiles which error out
;;nil values passed from real-path, since windows doesn't think they exist...
(defn clj-path? [path]
(re-matches #_ #"..clj$" #"[^#].clj$" path))

;;watch imports a unix-specific class, when a portable interface would work fine..
(ns scicloj.notespace.v4.watch
(:require ...elided)
(:import java.nio.file.Path)) ;;changed to Path interface instead of unix-only class.

The JS side is still jacked up with the same earlier error, TypeError: ca is null (slew of minified gibberish elided).

@jsg24
Copy link

jsg24 commented Jan 27, 2022

I can confirm that the sun.nio.fs.UnixPath doesn't exist can be overcome by using WSL Ubuntu and running the REPL. However I get probably the same Type issue as specified above.

jsss
)

@jsg24
Copy link

jsg24 commented Jan 31, 2022

Tried installing my own checked out version of gorilla-notes with shadow-cljs release app --debug and an altered version number but couldn't get any clojurescript error messages in the browser to appear.

@joinr
Copy link
Author

joinr commented Jan 31, 2022

I think WSL dodges the issue though (that can be fixed using my little patch though). fwiw it looks like there may have been a similar issue in clerk, but that seems to work fine. I may try the shadow-cljs variant as well.

@jsg24
Copy link

jsg24 commented Feb 1, 2022

@joinr Thanks for the clerk tip. Switching my project to that. Hope notespace resolves this issue.

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

3 participants