Lisp-Stat / documentation

Documentation for Lisp-Stat
Microsoft Public License
0 stars 4 forks source link

Crash evaluating (plot:plot-from-file (vglt:save-plot 'cars-strip-plot)) #2

Closed ericpmoss closed 3 years ago

ericpmoss commented 3 years ago

On Ubuntu with sbcl 2.1.6 and only Firefox installed (not chrome),

(plot:plot-from-file (vglt:save-plot 'cars-strip-plot))

crashes with the complaint that:

The value
"--user-data-dir=/home/eric/.cache/plot/chrome-data-G1245 --window-size=800,600 --app=/home/eric/.cache/plot/cars-strip-plot.html"

is not of type
LIST

The issue appears to be that sbcl's defun prepare-args expects a list of strings to which it applies #'every. It is being handed a dotted pair instead:

    ARGS = ("chrome" . "--user-data-dir=/home/eric/.cache/plot/chrome-data-G1245 --window-size=800,600 --app=/home/eric/.cache/plot/cars-strip-plot.html")

I can get around it with using this instead of what's in the lisp-stat documentation:

  (plot:plot-from-file (vglt:save-plot 'cars-strip-plot) :browser :default)
                                                         ^^^^^^^^^^^^^^^^^

Otherwise I had to modify sbcl's #'run-program to call prepare-args on (list progname args) rather than on (cons progname args). This doesn't seem right at all, so I just mention it and defer to better programmers. Thanks!

Symbolics commented 3 years ago

Thank you! You're in uncharted waters with Linux and Firefox, and I'm glad to see that you got it working. I'll update the documentation to reflect this.

Something else you could try is to modify the path to Firefox. It's difficult to put a sensible default there because Firefox might be anywhere on a Linux system.

ericpmoss commented 3 years ago

Hi,

Thanks, but I don’t know enough to verify if it is a problem in the SBCL lisp library or not, so I hope someone who does understand it fixes the right thing, or can tell me what I did wrong.

Thanks again,

Eric

Sent from my iPhone

On Jul 8, 2021, at 03:55, Steve @.***> wrote:

 Thank you! You're in uncharted waters with Linux and Firefox, and I'm glad to see that you got it working. I'll update the documentation to reflect this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Symbolics commented 3 years ago

I don't think it's in SBCL or the library, I think it is because the path to the Firefox executable isn't in the init file. Your work-around is actually correct it tells the system to open the default browser. The change I'm hoping will work means you don't have to add the :browser :default options.

To do this, edit the path to Firefox in the init file to have the full path, like the other system do. E.g.: Change "firefox" to "/usr/local/bin/firefox", if that's where it's located. To know for certain, type which firefox at a command prompt and it will tell you the path to firefox.

ericpmoss commented 3 years ago

Hmmm... on my Ubuntu system, I can just say firefox at the command prompt and it opens, so I'm not sure it's about the path to the executable. Even if I put a break point in #'prepare-args (which is called before the browser is even started), there is still an issue of trying to apply #'every to a cons that's not a list. Here is why I think that:

In .../sbcl-2.1.6/src/code/run-program.lisp there are two versions of #'prepare-args, one for win32 and one for all else. The win32 version assumes the args are passed in as conses, and the non-win32 version assumes it's a list of simple-strings. It's always possible I am misunderstanding it, but I think that the win32 version is correct in how it treats its args, and the non-win32 wasn't modified to match.

Symbolics commented 3 years ago

Ah, I see. Good sleuthing. It seems like this will need a fix. I have a MacOS machine that I can try, but not Linux. I'll leave this open as a reminder to fix it, and update the documentation with the work-around. Thanks.

ericpmoss commented 3 years ago

Thanks. I reported it -- feel free to correct any misconceptions I have in the comments.

https://bugs.launchpad.net/sbcl/+bug/1935012

kwccoin commented 2 years ago

Ah, I see. Good sleuthing. It seems like this will need a fix. I have a MacOS machine that I can try, but not Linux. I'll leave this open as a reminder to fix it, and update the documentation with the work-around. Thanks.

-- Sorry it is a side-issue, but do not want to start an issue or a series of email any more, just a "quick comment"

May I say I was a bit "shocked" you can use mac to develop this, as your development include jupyter. Trying last one week on using MacOS. Bascially work even under brew installed version.

except common-lispt-jupyter and this plot under jupyter-lab. Really hard that one. I down several path so far:

a) it once work with ECL64 but never SBCL under macOS (ECL graphic never work for awhile now, use brew install ecl64) but ... anyway only once and must under miniconda only.

b) to use parallel running BootCamp. The common-lisp-jupyter work under WSL2 fully, incluidng embeded graphic under plot under chrome. May try firefox ... But sadly not working there as BootCamp via parallel V17 which no longer have nested virtulisation and hence cannot run WSL2 and ...

c) Hence I resolve to use Parallel ubuntu and it works ... and would try later for this firefox issue under ubuntu, but as I am really want to use MacOS, I tried to use external chrome on Mac (by --ip= .... under jupyter-lab and amend browser.lisp) and perhaps may try firefox external as well. But I suspect it all work, except the graphic now is a seperate windows.

d) on docker under various environment to be tested (also use external browser; same ip and browser.lisp trick)

e) later would see how all these under M1 ...

Yes MacOS works but not really jupyter-lab?

I will continue my testing and this firefox would add to my list of ToDo list.

(also btw, may I comment there are at least 5 pages needed to plot and not all started from Getting Start ... and at least one script use common-lisp and and one use local-projects ... and I am now writing a script on my test it all; would share and comment which pages needed to be minor edit etc. But all goods, just scatter and not all consistent, guess hard work just manage the core and I am a fringe user/tester/statistics-cum-social-simulation guy here anyway.).

--sorry just side trick ---