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

PlutoSliderServer on Windows #102

Open
VivaldoMendes opened this issue Feb 12, 2023 · 6 comments
Open

PlutoSliderServer on Windows #102

VivaldoMendes opened this issue Feb 12, 2023 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@VivaldoMendes
Copy link

Hi,
I am trying to use PlutoSliderServer for the first time. I created a Julia environment that I called plutoserver, then I did add PlutoSliderServer. Apparently, the installation went smoothly. I tried the first example on the website, and I got the message:

julia> path_to_notebook = download("https://raw.githubusercontent.com/fonsp/Pluto.jl/v0.17.2/sample/Interactivity.jl")
"C:\\Users\\UTILIZ~1\\AppData\\Local\\Temp\\jl_49sv0d6TwR"

julia> PlutoSliderServer.run_notebook("C:\\Users\\UTILIZ~1\\AppData\\Local\\Temp\\jl_49sv0d6TwR")
ERROR: AssertionError: PlutoSliderServer does not work on Windows yet!

Is the error message correct, or am I doing something wrong?
Thanks

@fonsp
Copy link
Member

fonsp commented Mar 7, 2023

Hey @VivaldoMendes !

Unfortunately we still don't support Windows :( But we are definitely interested in a PR if you are interested in contributing! The problem is with path separators for static URLs: the URL localhost:2345/a/b/c.html is mapped to the local file a/b/c.html. On Windows, this should map to a\b\c.html, and we don't have code to handle this yet.

For an implementation, be sure to use URIs.jl and joinpath, not just string replacements.

@fonsp fonsp added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 7, 2023
@VivaldoMendes
Copy link
Author

Hi @fonsp, thanks for replying.

I have tested PlutoSliderServer on Linux (Ubuntu) as well. However, I kept doing something stupid. As far as I can understand, in Linux, the plutosliderserver seems to run OK and create the server, but then it spits out the following error:

error: Uncaught PermissionDenied: Permission denied (os error 13) about ["/tmp/systemd-private-ef8b2c2d7f1f40388db3325afb12e1dc-systemd-timesyncd.service-sNRh7g"]
    const watcher = Deno.watchFs("/tmp");
                         ^
    at new FsWatcher (deno:runtime/js/40_fs_events.js:19:23)
    at Object.watchFs (deno:runtime/js/40_fs_events.js:64:12)
    at file:///home/violeta/$deno$eval.js:1:26

I would be more than glad to help, but I wonder if I can be of much help. I know some cases where PlutoSliderServer works very well, e.g., @jbrea 's course here.

@jbrea
Copy link

jbrea commented Mar 7, 2023

If the sliderserver does not have write access to "/tmp" you could set the environment variable TEMP to some path it has write access to.

@fonsp
Copy link
Member

fonsp commented Mar 7, 2023

@VivaldoMendes thanks for the report! Can you create a new issue and post your complete terminal log? Also post the output of:

# see permissions of the `/tmp` folder
ls -lha / | grep tmp
# try creating a temp file
touch /tmp/asdf.txt

@VivaldoMendes
Copy link
Author

Hi @fonsp and @jbrea
I did as you suggested and I had no problem to create the text file in the TEMP folder. The permissions are here:

violeta@violeta-QOSMIO-X70-B:~$ ls -lha / | grep tmp
drwxrwxrwt  19 root root  20K Mar 31 16:36 tmp
violeta@violeta-QOSMIO-X70-B:~$ touch /tmp/asdf.txt

Still not sure what is preventing the server to be reached.

Thanks

@mrufsvold
Copy link

I would love to take on Windows support, but could @fonsp point me to a starting point of where the URL <-> file path work is done? I started looking over the source code and couldn't find a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants