diskuv / dkml-installer-ocaml

The Windows-friendly distribution of OCaml
Apache License 2.0
63 stars 2 forks source link

Ocaml installation on windows fails #75

Closed Heyji2 closed 11 months ago

Heyji2 commented 1 year ago

Here is the error message (replacing my username with xxxxx) :

C:\Users\xxxxx\AppData\Local\Temp\7z7A211170>"C:\DiskuvOCaml\BuildTools\Common7\Tools\vsdevcmd.bat" -no_logo -vcvars_ver=14.26 -winsdk=10.0.18362.0 && csc.exe /nologo /target:exe "/out:C:\Users\xxxxx\AppData\Local\Temp\PA8CE5~1\0\inotify-win\inotifywait.exe" "C:\Users\xxxxx\AppData\Local\Temp\PA8CE5~1\0\inotify-win\src*.cs" Le chemin d’accès spécifié est introuvable. Setup did not complete because an error occurred. Win32 command failed! Exited with 1. Command was: C:\WINDOWS\system32\cmd.exe /c call "C:\Users\xxxxx\AppData\Local\Temp\PA8CE5~1\0\inotify-win\compile.bat".

at Invoke-Win32CommandWithProgress, C:\Users\xxxxx\AppData\Local\Temp\7z7A211170\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.ps1: line 771 at , C:\Users\xxxxx\AppData\Local\Temp\7z7A211170\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.ps1: line 914 at , : line 1 at , : line 1

Bug Reports can be filed at https://github.com/diskuv/dkml-installer-ocaml/issues Please copy the error message and attach the log file available at C:\Users\xxxxx\AppData\Local\Programs\DISKUV~1\setup-userprofile.full.log

FATAL [a0d16230]. A transient failure occurred.

Root cause: The conformant command had exit code 1: C:\Users\xxxxx\AppData\Local\Temp\7z7A211170\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.bat -AllowRunAsAdmin -InstallationPrefix C:\Users\xxxxx\AppData\Local\Programs\DISKUV~1 -MSYS2Dir C:\Users\xxxxx\AppData\Local\Programs\DISKUV~1\tools\MSYS2 -OpamExe C:\Users\xxxxx\AppData\Local\Programs\DISKUV~1\bin\OPAM-R~1.EXE -DkmlPath C:\Users\xxxxx\AppData\Local\Temp\7Z7A21~1\sg\NETWOR~1\WINDOW~1\dkmldir -GlobalCompileDir C:\Users\xxxxx\AppData\Local\Temp\7Z7A21~1\sg\STAGIN~1\generic -NoDeploymentSlot -DkmlHostAbi windowsx86 setup-userprofile.full - anonymized.log 64 -TempParentPath C:\Users\xxxxx\AppData\Local\Temp\PA8CE5~1 -SkipProgress -SkipMSYS2Update

A transient failure occurred. <<<

Heyji2 commented 1 year ago

I made a copy and paste from the installation console... I don't know why some of the line are blacked-out. I certainly did not added a smiley at the end.

jonahbeckford commented 1 year ago

You can attach the full log if you run into further problems, rather than copy-and-paste.

Can you try the new installer?

  1. Stop your anti-virus and malware detection temporarily (Windows Defender, Malwarebytes, etc.).
  2. Delete C:\Users\xxx\AppData\Local\Programs\DkMLNative (skip if it doesn't exist)
  3. Delete C:\Users\xxx\AppData\Local\Programs\DiskuvOCaml
  4. Run the new 2.0.3 Windows 64-bit Native Installer from https://gitlab.com/dkml/distributions/dkml/-/releases/2.0.3
Heyji2 commented 1 year ago

Normaly the full log is also attached, isn't it ?Envoyé depuis mon appareil Galaxy -------- Message d'origine --------De : jonahbeckford @.> Date : 02/11/2023 17:41 (GMT+01:00) À : diskuv/dkml-installer-ocaml @.> Cc : Heyji2 @.>, Author @.> Objet : Re: [diskuv/dkml-installer-ocaml] Ocaml installation on windows fails (Issue #75) You can attach the full log if you run into further problems, rather than copy-and-paste. Can you try the new installer?

Stop your anti-virus and malware detection temporarily (Windows Defender, Malwarebytes, etc.). Delete C:\Users\xxx\AppData\Local\Programs\DkMLNative (skip if it doesn't exist) Delete C:\Users\xxx\AppData\Local\Programs\DiskuvOCaml Run the new 2.0.3 Windows 64-bit Native Installer from https://gitlab.com/dkml/distributions/dkml/-/releases/2.0.3

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

Heyji2 commented 1 year ago

I have tried the new installer, without success. As reported in the log (see the link below), I have this C:\DiskuvOCaml folder that is created by the installer (and the other as well) which is not at the right place in my opinion (you did not mentioned it at least in your procedure above as one of the folder to delete manually).

There might be an environment variable which is not configured as expected on my box. Let me know if you want me to dig futher into it. setup-userprofile.full.anonymised.log

jonahbeckford commented 1 year ago

Does C:\DiskuvOCaml\BuildTools\Common7\Tools\VsDevCmd.bat exist on your machine? The error says it (Visual Studio 2019 Build Tools) doesn't exist but it should.

If it doesn't exist, can you give me a directory listing inside C:\DiskuvOCaml, C:\DiskuvOCaml\BuildTools and C:\DiskuvOCaml\BuildTools\Common7\Tools?

Heyji2 commented 1 year ago

C:\DiskuvOCaml\BuildTools is empty ! PS C:\DiskuvOCaml> tree Structure du dossier pour le volume OS Le numéro de série du volume est F4F5-D9C5 PS C:\DiskuvOCaml> tree /F Structure du dossier pour le volume OS Le numéro de série du volume est F4F5-D9C5 C:. ├───BuildTools ├───PowerShell │ └───0DE9A5653BF6CC40 │ └───Modules │ └───VSSetup │ about_VSSetup.help.txt │ LICENSE.txt │ Microsoft.VisualStudio.Setup.Configuration.Interop.dll │ Microsoft.VisualStudio.Setup.PowerShell.dll │ Microsoft.VisualStudio.Setup.PowerShell.dll-Help.xml │ VSSetup.psd1 │ VSSetup.psm1 │ VSSetup.types.ps1xml │ └───vsinstall collect.exe Install.cmd Install.orig.cmd VisualStudio.chman vs_buildtools.exe

jonahbeckford commented 1 year ago

That is troubling but at least we are getting somewhere. Let's see what Visual Studio is reporting about itself ...

# This is PowerShell syntax
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -format json -include packages -products * > vs.json

If you can attach the generated vs.json I can check what it is reporting.

Heyji2 commented 1 year ago

Here you go : vs.json

jonahbeckford commented 1 year ago

I'm lost why you don't have a C:\DiskuvOCaml\BuildTools directory. Visual Studio says you should have it:

[
  {
    "instanceId": "27aea9eb",
    "installDate": "2023-10-30T20:35:14Z",
    "installationName": "VisualStudio/16.11.2+31624.102",
    "installationPath": "C:\\DiskuvOCaml\\BuildTools",
    "installationVersion": "16.11.31624.102",
    "productId": "Microsoft.VisualStudio.Product.BuildTools",
    "productPath": "C:\\DiskuvOCaml\\BuildTools\\Common7\\Tools\\LaunchDevCmd.bat",
    "state": 4294967295,
    "isComplete": true,

The DkML installer does not have the logic or the Administrative permissions to delete that Visual Studio directory.


You can fix the immediate issue by running "Visual Studio Installer" (press Windows+R, and then type in "Visual Studio Installer"). And then "Repair" the installation. But unless you can find out what deleted that directory, I would have no confidence that your installation will succeed.

jonahbeckford commented 11 months ago

Try:

  1. winget install Microsoft.VisualStudio.2019.BuildTools --override "--wait --passive --installPath C:\VS --addProductLang En-us --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
  2. winget install Git.Git if you don't have Git for Windows
  3. Install Windows 64-bit Native Installer (unsigned)
oboudry-mvp commented 11 months ago

Hi Jonah,

Seeing no update from the author of this issue, I take the liberty to reply to it.

I'm getting the exact same errors trying to install on an up to date Windows 10 Pro machine. Both the old an new installers fail.

I tried the new installer following the steps you mentionned in this post.

I installed VisualStudio 2019 BuildToos successfully and have github for Windows installed: image

Error when using the new installer is:

opamshim-install.bc: option '--opam-putenv-exe': no
                     'C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin\opam-putenv.exe'
                     file or directory
Usage: opamshim-install.bc [OPTION]…
Try 'opamshim-install.bc --help' for more information.
FATAL [98b534b7]. The command C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\offline-opamshim\generic\install_user.bc
              --verbosity=info --color=always --opam-putenv-exe
              C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin\opam-putenv.exe
              --opam-exe
              C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin\opam.exe
              --with-dkml-exe
              C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-withdkml\windows_x86_64\bin\with-dkml.exe
              --target-dir
              C:\Users\olivier.boudry\AppData\Local\Programs\DkMLNative exited with status 124

dkml-package.bc: [ERROR] FATAL [5f927a8b].
                         A transient failure occurred.

                         Root cause: The command had exit code 20:
                                       C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\bin\dkml-install-user-runner.exe
                                         install-user-offline-opamshim --verbosity=info --color=always
                                         --prefix
                                         C:\Users\olivier.boudry\AppData\Local\Programs\DkMLNative
                                         --staging-files
                                         C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg

                         >>> A transient failure occurred. <<<

Press "y" and ENTER to exit the installer.

I tried to re-run the command with loglevel debug and got the following output:

opamshim-install.bc: option '--opam-putenv-exe': no
                     'C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin\opam-putenv.exe'
                     file or directory 

Effectively opam-putenv.exe is not there:

C:\Users\olivier.boudry>dir C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin\
 Le volume dans le lecteur C s’appelle {
 Le numéro de série du volume est 04F6-477A

 Répertoire de C:\Users\olivier.boudry\AppData\Local\Temp\7z9C040A64\sg\staging-opam64\windows_x86_64\bin

12.12.2023  09:36    <DIR>          .
12.12.2023  09:36    <DIR>          ..
07.09.2023  09:08         3 774 464 opam-installer.exe
07.09.2023  09:08         8 582 656 opam.exe
               2 fichier(s)       12 357 120 octets
               2 Rép(s)  52 224 389 120 octets libres

That seems to be the reason for the failure to install. Not sure how to fix.

jonahbeckford commented 11 months ago

@oboudry-mvp I see no connection at all in your error message. Maybe I am missing something you are seeing, or maybe you are saying your anti-virus (etc.) is causing an issue? Did you disable it? If so, open a new issue and I'll give you next steps.

OP: reopen if needed.

Heyji2 commented 8 months ago

Hi,

Sorry for the late reply. I tried to dig into this issue today. It turned out I had two visual studio installations in the installer (could not really identify each of them formally), and the one related to DiskuvOCaml was broken with an error message saying the the folder C:\DiskuvOCaml\BuildTools was missing (indeed). I also had a visual studio community 2015 installed which I didn't use anymore. So I removed all installations from within the installer, and relaunched a fresh install using the 2.1.0 installer. It worked.

Heyji2 commented 6 months ago

ok

Le mar. 12 déc. 2023 à 11:43, jonahbeckford @.***> a écrit :

@oboudry-mvp https://github.com/oboudry-mvp I see no connection at all in your error message. Maybe I am missing something you are seeing, or maybe you are saying your anti-virus (etc.) is causing an issue? Did you disable it? If so, open a new issue and I'll give you next steps.

OP: reopen if needed.

— Reply to this email directly, view it on GitHub https://github.com/diskuv/dkml-installer-ocaml/issues/75#issuecomment-1851784257, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASXNJKBOR52UCQKZXC3RC4TYJAYLXAVCNFSM6AAAAAA6ZTDLDSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRG44DIMRVG4 . You are receiving this because you authored the thread.Message ID: @.***>

oboudry-mvp commented 6 months ago

@jonahbeckford you were right, it was the EDR (CrowdStrike) quarantaining the opam-putenv.exe file during setup.