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

on loading clhs-use-local.el, debugger entered due to inability to make symlinks #10

Open
saraf opened this issue Apr 25, 2017 · 10 comments

Comments

@saraf
Copy link

saraf commented Apr 25, 2017

Installation does not work when using with quicklisp on windows 10

Break 4 [6]> (clhs:print-emacs-setup-form)


[ Quicklisp directory: "C:\home\quicklisp\" (exists)
  If the above location is not correct, do:
  (setf clhs:*quicklisp-directory* "\\\\path\\\\to\\\\quicklisp\\\\") ]

(clhs-use-local.el was found in your quicklisp directory.
Moreover, its version matches the one bundled with this CLHS ASDF wrapper.
You may proceed with step 2 of 2 below.)
Make Emacs evaluate this form to browse the CLHS locally:
(load "C:\\\\home\\\\quicklisp\\\\clhs-use-local.el" t)
Debugger entered--Lisp error: (file-error "Making symbolic link" "Operation not permitted" "dists/quicklisp/software/clhs-0.6.3/HyperSpec-7-0/HyperSpec/" "c:/home/quicklisp/HyperSpec")
  make-symbolic-link("dists/quicklisp/software/clhs-0.6.3/HyperSpec-7-0/HyperSpec/" "c:/home/quicklisp/HyperSpec" t)
  (let ((absolute (quicklisp-clhs-hyperspec-location))) (make-symbolic-link (if relativep (file-relative-name absolute quicklisp-clhs-base) absolute) (quicklisp-clhs-symlink-location) t))
  quicklisp-clhs-setup-symlink(t)
  (if (quicklisp-clhs-inhibit-symlink-p) nil (quicklisp-clhs-setup-symlink (if (quicklisp-clhs-inhibit-symlink-relative-p) nil t)))
  (quicklisp-clhs-setup-hyperspec-root (if (quicklisp-clhs-inhibit-symlink-p) nil (quicklisp-clhs-setup-symlink (if (quicklisp-clhs-inhibit-symlink-relative-p) nil t))))
  eval-buffer(#<buffer  *load*> nil "c:/home/quicklisp/clhs-use-local.el" nil t)  ; Reading at buffer position 2599
  load-with-code-conversion("c:/home/quicklisp/clhs-use-local.el" "c:/home/quicklisp/clhs-use-local.el" t nil)
  load("C:\\home\\quicklisp\\clhs-use-local.el" t)
  eval((load "C:\\home\\quicklisp\\clhs-use-local.el" t) nil)
  eval-expression((load "C:\\home\\quicklisp\\clhs-use-local.el" t) nil)
  funcall-interactively(eval-expression (load "C:\\home\\quicklisp\\clhs-use-local.el" t) nil)
  call-interactively(eval-expression record nil)
  command-execute(eval-expression record)
  execute-extended-command(nil "eval-expression" "eval-expression")
  funcall-interactively(execute-extended-command nil "eval-expression" "eval-expression")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

[I edited your comment to use triple-backtick code block quoting instead of single-backtick quoting. Much better...]

@Hexstream
Copy link
Owner

Hexstream commented Apr 25, 2017

Hello,

Thank you very much for reporting this issue!

Full disclosure: I never use Windows, do not have access to a Windows machine, don't really know anything about Windows, and generally do not care about Windows.

HOWEVER, my CLHS ASDF wrapper is certainly intended to work at least on the 3 major platforms (Linux, Mac OS X and Windows), and I will always make a best effort to ensure that that's the case.

I'm pretty sure that Windows 10 does still support some concept analogous to symlinks, such as Windows "shortcuts", and I'm confident that Emacs is able to make Windows create such symlink analogues in general. So in order for me to able to fix this issue, I would need you or someone else to figure out why the symlink creation fails (possibly according to some peculiarities of your setup), and what would make it work more reliably. You may like to use the emacs symlink creation function interactively and do some tests to see if you can create symlinks in general. I think you should also attempt to "manually" create a symlink in your Quicklisp directory, maybe you could get a more useful backtrace or some sort of insight.

I could eventually try to have a Windows setup in a VM or something like that, but I'm very busy and am not interested in doing this soon. So I need help to be able to resolve this issue.

@saraf
Copy link
Author

saraf commented Apr 26, 2017 via email

@Hexstream
Copy link
Owner

Thank you very much for this information! Very informative.

The right thing for me to do seems to be to:

  1. test to see if the symlink already exists before trying to create it (although probably emacs should have done it this way in the first place); and

  2. when the symlink does not already exist, then try to create it, but if an error is thrown, then catch it and inform the user that the symlink has not been created successfully and that they will need to create it themselves, and inform them that this is expected on Windows 10 and that they need to go in administrator mode to create symlinks.

I'm pretty busy right now, but I'll classify this as high priority so I should be able to do this soon. I'll be relying on you to test the update to see if it works. Stay tuned. :)

@Hexstream Hexstream self-assigned this Apr 26, 2017
@Hexstream
Copy link
Owner

Ok! So here's a first release candidate: http://tarballs.hexstreamsoft.com/tmp/clhs_0.6.4-rc1.tar.gz

Put this somewhere where asdf can find it, such as in the local-projects directory of your quicklisp directory. Then (asdf:load-system '#:clhs) and follow the instructions. I could give you more complete instructions on various scenarios to test, but it should be fine if you can just get this to work just for your current scenario. Let me know if you need more guidance...

(Here's the (preliminary) diff, for the curious: https://github.com/Hexstream/clhs/compare/tmp_0.6.4-rc1)

btw upon doing the (asdf:load-system '#:clhs) you'll get the following warnings, which you can safely ignore:

WARNING: PARSE-VERSION: "0.6.4-rc1" doesn't follow asdf version numbering convention
WARNING: Invalid :version specifier "0.6.4-rc1" for component "clhs" from file #P"/home/hexstream/data/projects/lisp/ready-to-use/clhs/clhs.asd", using NIL instead
WARNING: Invalid :version specifier "0.6.4-rc1" for component "clhs" from file #P"/home/hexstream/data/projects/lisp/ready-to-use/clhs/clhs.asd", using NIL instead

If everything works, I'll make a real 0.6.4 release, else I might make another release candidate, etc.
I'm looking forward to your feedback!

@Hexstream Hexstream changed the title on loading clhs-use-local.el, debugger entered due to inability to make symlinks (Windows 10, quicklisp) on loading clhs-use-local.el, debugger entered due to inability to make symlinks Apr 30, 2017
@saraf
Copy link
Author

saraf commented Apr 30, 2017

NOTE: I tried the steps you gave above (on top of the 0.6.3 install) but it did not work, and hence I chose to remove 0.6.3 completely before trying to install 0.6.4-rc1.

(Copying steps sent earlier over email)

I followed the following steps:

(ql:uninstall clhs) to remove the existing 0.6.3

remove the line to load clhs-use-local.el from the .emacs file.

un-tar 0.6.4-rc1.tar.gz into local-projects inside quicklisp.

shutdown emacs.

start emacs without elevated privileges.


;; Loading file C:\home.clisprc.lisp ...
;; Loading file C:\home\quicklisp\setup.lisp ...
;; Loading file C:\home\quicklisp\ASDF.lisp ...
;; Loaded file C:\home\quicklisp\ASDF.lisp
;; Loaded file C:\home\quicklisp\setup.lisp
;; Loaded file C:\home.clisprc.lisp
[1]> (asdf:load-system '#:clhs)

;; Loading file C:\home\quicklisp\local-projects\clhs_0.6.4-rc1\clhs.asd ...
WARNING: Invalid version "0.6.4-rc1" for component "clhs"
;; Loaded file C:\home\quicklisp\local-projects\clhs_0.6.4-rc1\clhs.asd
;; Loading file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\package.fas ...
;; Loaded file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\package.fas
;; Loading file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\main.fas ...

clhs-use-local.el doesn't seem to have been installed.
(Assuming "C:\home\quicklisp\" is the correct quicklisp directory location.)

Please run (clhs:print-emacs-setup-form) for details
on how to setup Emacs/Slime to perform lookups/browsing
with your local copy of the CLHS provided by this wrapper.

(That command will also tell you how to set
another quicklisp directory location, if necessary.)

;; Loaded file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\main.fas
0 errors, 0 warnings
T
[2]> (clhs:print-emacs-setup-form)

[ Quicklisp directory: "C:\home\quicklisp" (exists)
If the above location is not correct, do:
(setf clhs:quicklisp-directory "\path\to\quicklisp\") ]

clhs-use-local.el was not found in your quicklisp directory.
This means you're at step 1 of 2 for configuring Emacs/Slime
to perform lookups/browsing with your local copy of the CLHS.

Please run (clhs:install-clhs-use-local) in the (Common Lisp) REPL.
This will install clhs-use-local.el in your quicklisp directory.

Then, run (clhs:print-emacs-setup-form) again for instructions for step 2.

[3]> (clhs:install-clhs-use-local)

T
[4]> (clhs:print-emacs-setup-form)

[ Quicklisp directory: "C:\home\quicklisp" (exists)
If the above location is not correct, do:
(setf clhs:quicklisp-directory "\path\to\quicklisp\") ]

(clhs-use-local.el was found in your quicklisp directory.
Moreover, its version matches the one bundled with this CLHS ASDF wrapper.
You may proceed with step 2 of 2 below.)

Make Emacs evaluate this form to browse the CLHS locally:

(load "C:\home\quicklisp\clhs-use-local.el" t)

Use C-c C-d h make-instance RET to test if the change was successful.
If it was, then this will open your browser and the URL will begin with "file:///".

Put the form in your ~/.emacs to persist the change for future sessions.

The README file has some further information,
including a list of 3 useful Slime CLHS lookup commands
and how to get Emacs to open CLHS pages in a different browser.
(Location: C:\home\quicklisp\local-projects\clhs_0.6.4-rc1\README)

[5]>

M-x eval-expression: (load "C:\home\quicklisp\clhs-use-local.el" t)

As expected, this gives us the message:
Sorry, unable to create symlink named "c:/home/quicklisp/HyperSpec" pointing to "../HyperSpec-7-0/HyperSpec/".

Would you happen to be using Windows 10? Then you may need administrator privileges to be able to create symlinks. Please either run emacs as an administrator and then load clhs-use-local.el, or manually create the symlink with mklink in an administrator-mode console per the above parameters. This needs to be done only once, you should be able to use the CLHS wrapper as a normal user subsequently.

(TODO: Detect Windows 10 instead of unconditionally displaying the above note about Windows 10.)

Then restart emacs with administrator privileges and M-x eval-expression: (load "C:\home\quicklisp\clhs-use-local.el" t)

This results/evaluates in a T.

Looking at the directory to see if hyperlink was created: A hyperlink has been created, but its target is a non-existent directory!

ljcq8vkrdydsl4zxiqixorbo6a7ziwn8rsri3-vrmcwrw9yksjdwrkqmeeuv9y6hxszl5jvh3akeu4-kpeni4ipjonkdcvexf_tbnica-c9b9ektxr1ydakzvgkshg1yudde3eabhgxeaxs0exofcxwlxkmp3w5i6nrfcsw9vgakum3i5o5bqiv1jrxtqbtuixqm5bqdsvyfow5jyud

Try to test as suggested by C-c C-d h make-instance RET
This gives:
[2]>
*** - SYSTEM::READ-EVAL-PRINT: variable MAKE-INSTANCE has no value
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of MAKE-INSTANCE.
STORE-VALUE :R2 Input a new value for MAKE-INSTANCE.
ABORT :R3 Abort main loop
Break 1 [3]>

Then restart emacs without elevated privileges.
start up lisp and load asdf ... looks okay.

[1]> (asdf:load-system '#:clhs)

;; Loading file C:\home\quicklisp\local-projects\clhs_0.6.4-rc1\clhs.asd ...
WARNING: Invalid version "0.6.4-rc1" for component "clhs"
;; Loaded file C:\home\quicklisp\local-projects\clhs_0.6.4-rc1\clhs.asd
;; Loading file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\package.fas ...
;; Loaded file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\package.fas
;; Loading file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\main.fas ...
;; Loaded file C:\Users\Aalhad\AppData\Local\common-lisp\cache\clisp-2.49-win-x86\C\home\quicklisp\local-projects\clhs_0.6.4-rc1\main.fas
0 errors, 0 warnings
T
[2]>

Try to load up clhs-use-local.el M-x eval-expression: (load "C:\home\quicklisp\clhs-use-local.el" t)

This gives us
Sorry, unable to create symlink named "c:/home/quicklisp/HyperSpec" pointing to "../HyperSpec-7-0/HyperSpec/".

Would you happen to be using Windows 10? Then you may need administrator privileges to be able to create symlinks. Please either run emacs as an administrator and then load clhs-use-local.el, or manually create the symlink with mklink in an administrator-mode console per the above parameters. This needs to be done only once, you should be able to use the CLHS wrapper as a normal user subsequently.

(TODO: Detect Windows 10 instead of unconditionally displaying the above note about Windows 10.)

Created the symlink manually as administrator

ac3yzvbgqc1rf49itfxg09df3a0iz7tnkxvablg6ke6kuix_cted5lbs1y-j3olhngvv9hvx1zi0a9myativywpqwi2af4slvcr41ady9fayfeqqeqyl4frntgdgpj84yd6mx8cfms41slghkhvlx9exk_mcxraxcyvwpu8-_pdnsnelbznqyicydexywecm9kmkjx6tw-mybnmqczh

Started emacs as a normal user, and tried to load clhs-use-local.el:

Sorry, unable to create symlink named "c:/home/quicklisp/HyperSpec" pointing to "../HyperSpec-7-0/HyperSpec/".

Would you happen to be using Windows 10? Then you may need administrator privileges to be able to create symlinks. Please either run emacs as an administrator and then load clhs-use-local.el, or manually create the symlink with mklink in an administrator-mode console per the above parameters. This needs to be done only once, you should be able to use the CLHS wrapper as a normal user subsequently.

(TODO: Detect Windows 10 instead of unconditionally displaying the above note about Windows 10.)

@Hexstream
Copy link
Owner

Hexstream commented Apr 30, 2017

I'm confused. Did you see issue #11 yet? I @mentioned you there, thinking that it would send you an email notification, but maybe I should also have linked you to it from an email reply to make sure.

(edit: You can review and update your notification settings here.)

Also, you REALLY need to learn how to use triple backquotes blockquoting. (```)
Click on Styling with Markdown is supported while editing a message for details. It's easy!

@chuchana
Copy link

Hello and thank you!

I found this after trying to fix the fact that the symlink could not be created by version 0.6.3 with w32-symlinks.el, which just resulted in breaking hyperspec-lookup because the link it created was broken.

The download link you provided was down but I could get it here.

It succeeds in enabling local lookup :)

Executing (load "C:/Users/p/quicklisp/clhs-use-local.el" t) still shows an error saying that the symbolic link could not be created, though.

And, last and least: I assumed that PowerShell could do everything Command Prompt (cmd) could, but mklink isn't recognized there. Maybe that's worth mentioning in the error text?

@Hexstream
Copy link
Owner

Hexstream commented Jun 21, 2020

Hello and thank you!

Hello and thank you!

The download link you provided was down

Yeah, sorry, that had been wiped out by a server upgrade. I restored it now.

It succeeds in enabling local lookup :)

Hooray!

Executing (load "C:/Users/p/quicklisp/clhs-use-local.el" t) still shows an error saying that the symbolic link could not be created, though.

Then I guess I should test to see if the symlink already exists and points to the right place and not try to create it in that case...


Unfortunately, I'm doing a big push to finish and release 10 new libraries right now, so I'll probably look into making a second release candidate only after that's done. Thank you for your patience.

edit: Actually, I'm not sure I'll have time to do this in 2020, but definitely Q1 2021 at the latest. ;P

@chuchana
Copy link

I am in no hurry, I'm just glad it works. The error message when starting Emacs is not a problem for me, I just thought it would make sense to give some feedback so you know that your efforts were both effective and appreciated.

@Hexstream
Copy link
Owner

Hexstream commented Jun 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants