-
Notifications
You must be signed in to change notification settings - Fork 373
Cygwin internal installation should add winsymlinks:native
to CYGWIN
#5782
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
Comments
I am getting an error during
Note that Linking works (I have developer mode enabled): touch test
cmd /c mklink test2 test
symbolic link created for test2 <<===>> test It worked fine for ocamlbuild, mind you. Should I create a new issue or is there something I missed? |
the reason ocp-indent fails and not ocamlbuild here is that, from what i understand, on Windows it is not possible to create a symlink to a non-existant file and tar extracts file in some pre-defined order. In ocamlbuild, tar extracted the target before the symlink so it works fine. In this particular case I would say this is an error in the package making it unavailable on Windows at the moment. Could you open an issue on https://github.com/ocaml/opam-repository/issues/ instead so that the ocp-indent package is marked as |
I think creating links to non-existing files works? $ ls
$ cmd /c mklink src trgt
symbolic link created for src <<===>> trgt
$ cat src
cat: src: No such file or directory
$ echo hello world > trgt
$ cat src
hello world I should have been clear when I said "
|
The underlying technical problem in Windows is slightly more subtle. It's not that you can't create symlinks to files which don't exist, it's that symlinks have types (cf. I had for quite some time been debating writing+submitting a patch to GNU tar to collect symlinks to files which don't exist and then processing them at the end of the extraction (no idea whether that would have been accepted, though) but, given your other work with ocaml-tar already, we could also mitigate this by checking the tarball ourselves on extraction and dealing with any missing symlinks or we could even simply use ocaml-tar to do the extraction entirely. The only thing which had stopped me doing that in the past was that ocaml-tar had a lot of dependencies, but you've dealt with that! |
@jacj-simcorp A potential fix (when |
This is a first step towards improved symlink support. We should ultimately be advising that developers enable Developer Mode (which allows symlinks to be used without elevation), and we should also have a better fallback for tarballs which include symlinks, but in the meantime, using the environment setup from #5781:
The issue is that Cygwin will have used its own symlink format (most likely a WSL symlink) which native Windows opam can't read. The workaround is easy:
At the same point as we add the internal Cygwin bin to the PATH, we should ensure that
winsymlinks:native
(orwinsymlinks:nativestrict
, if the user has elected to set that) are set and remove eitherwinsymlinks:sys
orwinsymlinks:lnk
if found (i.e. it's part of scrubbing the environment.). Cygwin'sCYGWIN
variable is documented here and its symlink support is documented here.The text was updated successfully, but these errors were encountered: