fdopen / opam-repository-mingw

windows package repository for OPAM (mingw and msvc)
https://fdopen.github.io/opam-repository-mingw/
Creative Commons Zero v1.0 Universal
96 stars 34 forks source link

problem with both auto install and manual install #43

Closed tensor-programming closed 7 years ago

tensor-programming commented 7 years ago

When trying to install Opam and the Ocaml compiler via the manual, I receive these errors:

opam init mingw "https://github.com/fdopen/opam-repository-mingw.git" --comp 4                                     .05.0+mingw64c --switch 4.05.0+mingw64c
Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg
    command on your system.
  - you won't be able to use darcs repositories unless you install the darcs
    command on your system.

[WARNING] No external solver found, one of aspucd, packup and mccs is
          recommended (see
          http://opam.ocaml.org/doc/Install.html#ExternalSolvers for details)
[WARNING] Recommended dependencies -- most packages rely on these:
            - cc

=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[mingw: git]
[mingw: git]
[mingw: git]
[mingw: git]
[mingw: git]
[mingw: git]
[mingw] git+https://github.com/fdopen/opam-repository-mingw.git updated

=-=- Installing compiler 4.05.0+mingw64c =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[4.05.0+mingw64c: http]
[compiler.get] https://dl.bintray.com/fdopen/prebuild-win32-ocaml-packages/4.05.                                     0+mingw64c2.tar.xz downloaded
Now compiling OCaml. This may take a while, please bear with us...
[4.05.0+mingw64c: sed]
[4.05.0+mingw64c: sed]
[4.05.0+mingw64c: dash.exe install.sh]
Done.

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#=== ERROR while installing base-unix.base ====================================#
OpamSystem.File_not_found("C:/Projects/.opam/4.05.0+mingw64c/lib/base-unix/opam.                                     config")

#=== ERROR while installing base-threads.base =================================#
OpamSystem.File_not_found("C:/Projects/.opam/4.05.0+mingw64c/lib/base-threads/op                                     am.config")

#=== ERROR while installing base-bigarray.base ================================#
OpamSystem.File_not_found("C:/Projects/.opam/4.05.0+mingw64c/lib/base-bigarray/o                                     pam.config")

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  ∗  install base-bigarray base
  ∗  install base-threads  base
  ∗  install base-unix     base
No changes have been performed
[ERROR] Initialisation failed
OpamStd.OpamSys.Exit(4)

These three errors, base-bigarray, base-threads and base-unix consistently happen when using both the auto-install method and the manual install method as well as when using the prebuilt Ocaml compiler and the source. I've tried completely purging cygwin etc multiple times and keep encountering this error no matter what I try. Is there something I am just blatantly missing here?

Edit: this happens even with the 4.03 version and the older version mentioned in the wiki post. I haven't tried the 32 bit version yet because I don't really think that would make a difference. Also, c:\Projects is my default home (i set it a while ago for emacs). I'm not sure this is the problem either. Capital letters shouldn't cause an issue.

fdopen commented 7 years ago

Please post the output of

env
cmd /c set
mount
cygcheck -c

at the point before you start the manual installation (opam init ...).

tensor-programming commented 7 years ago

Edit: I was able to get it to work finally. After a clean install of Cygwin and a walkthrough of the manual install, It worked when I compiled the 64bit Ocaml install from source. When I tried to install the precompiled version, it threw the same errors as mentioned above and when I tried using the graphical install the same thing happened.

You can go ahead and close this issue unless you want to look into the reason why I was unable to use the precompiled versions or the graphical installer.

fdopen commented 7 years ago

It's probably because your folder (C:\Projects) has the "wrong" user rights (cygwin posix emulation doesn't interact very well with native windows access rights).

If you encounter further problems, rename it and create a new folder with the same name (with cmd.exe shell):

set HOME=
C:\cygwin64\bin\bash.exe -l
exit # back to cmd.exe
cd C:\
move "cygwin64\home\YourUsername" Projects
exit

Then start a cygwin shell and try opam init ... again. If everything works this time, you can move the content of your old folder to the new folder.

tensor-programming commented 7 years ago

No it has nothing to do with user rights on the project folder. I have encountered write protection problems before with this setup for other tools and services on windows and have since changed the access rights on the projects folder so that this will never be a problem again. Since I work with so many different programming languages, (many that do not work well on windows), I try to keep all of my projects in one area and of course, that was one of the first things I had to address.

Edit: I just think its likely that the problem had nothing to do with your actual repo and more to do with an error that I made during the installation. The fact that after a 3rd clean installation things worked properly seems to indicate this. I suspect that I didn't fully clean up the automatic installed Cygwin environment before I had made my first attempt at the manual installation and this caused the problems.

Anyways, thank you for your help.