diskuv / dkml-installer-ocaml

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

Windows Installation fails #63

Closed FullValueRider closed 10 months ago

FullValueRider commented 10 months ago

In response to the request here

https://discuss.ocaml.org/t/windows-installation-failed/12875

I used powershell in administrator mode. The output I got was.

PS G:\download\programminglanguages\ocaml> .\setup-diskuv-ocaml-windows_x86_64-1.2.0.exe dkml-package.bc: [e[34mINFOe[0m] Writing to registry for Add/Remove Programs dkml-package.bc: [e[34mINFOe[0m] Running: C:\WINDOWS\system32\reg.exe import C:\Users\slayc\AppData\Local\Temp\uninstallf60055.reg The operation completed successfully. dkml-package.bc: [e[34mINFOe[0m] Detecting whether administrator privileges are needed by running C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\network-ocamlcompiler\windows_x86_64\setup-machine.bat -DkmlPath C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\network-ocamlcompiler\windows_x86_64\dkmldir -TempParentPath C:\Users\slayc\AppData\Local\Temp\path_eval_3398a7 -SkipProgress -AllowRunAsAdmin -SkipAutoInstallVsBuildTools Start-Job : The pwsh executable cannot be found at "C:\Users\slayc.dotnet\tools.store\powershell\6.2.3\powershell\6.2.3\tools\netcoreapp2.1\any\win\pwsh.exe". Note that 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications. Instead, usage of the 'ThreadJob' module is recommended in such scenarios. At line:1 char:1

& 'C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\network-ocamlcompiler\windows_x86_64\setup-machine.ps1' -DkmlPath C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\network-ocamlcompiler\windows_x86_64\dkmldir -TempParentPath C:\Users\slayc\AppData\Local\Temp\path_eval_3398a7 -SkipProgress -AllowRunAsAdmin -SkipAutoInstallVsBuildTools; exit $LASTEXITCODE dkml-package.bc: [INFO] Detected that a compatible Visual Studio was already installed; will not request administrator privileges dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-opam64 --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-ocamlrun --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-unixutils --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-desktop-compile --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-desktop-full --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-opam32 --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-withdkml --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-staging-dkmlconfdir --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-package.bc: [INFO] Running: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\bin\dkml-install-user-runner.exe install-user-offline-opamshim --verbosity=info --color=always --prefix C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml --staging-files C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg dkml-install-user-runner.exe: [INFO] Running bytecode with: C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\staging-ocamlrun\windows_x86_64\bin\ocamlrun C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\offline-opamshim\generic\install_user.bc --verbosity=info --color=always --opam-exe C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\staging-opam64\windows_x86_64\bin\opam.exe --with-dkml-exe C:\Users\slayc\AppData\Local\Temp\7z9F5C695C\sg\staging-withdkml\windows_x86_64\bin\with-dkml.exe --target-dir C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml FATAL [ebe9e0f2]. rename C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml\bin\bos-808e45.tmp to C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml\bin\opam-real.exe: Permission denied

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

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

                     >>> A transient failure occurred. <<<

and as a follow up

I found two issues. Pwsh did not exist in the target directory but did exist earlier in the path. I copied the pwsh.exe to the target directory and the installation proceeded further before reaching the could not copy issue. On investigation the relevant directory already contained the file that the .tmp file was trying to be renames to. It seems I have an earlier installtion of ocaml but have no recollection of trying to do so. I deleted the relevant ocaml directories and .\setup-diskuv-ocaml-windows_x86_64-1.2.0.exe ran to completion without errors.

I closed the administrator mode powershell window and opened a new powershell.

Utop is not a recognised command. Do I need to add some paths to the %PATH% environment variable.?

jonahbeckford commented 10 months ago
  1. Can you tell me about this other OCaml installation?
  2. C:\Users\slayc.dotnet\tools.store\powershell\6.2.3\powershell\6.2.3\tools\netcoreapp2.1\any\win: It sounds like Microsoft Store. Can you confirm that "PowerShell" was installed through the Microsoft Store? I can then try to recreate your environment in a sandbox.
  3. Can you paste your PATH (run PowerShell, type echo $env:PATH)?

Thanks.

FullValueRider commented 10 months ago
  1. Unfortunately, no.

  2. If the directory 'C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml' exists then the installation fails. If I delete 'C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml' then the installation gets as far as the 'press "y" then enter to exit installation' after about 5 minutes. If I press "y" then the installation exits with no errors. However, when I restart powershell utop is not recognised. This pattern in repeated if I use the pwsh.exe I copied to 'C:\Users\slayc.dotnet\tools.store\powershell\6.2.3\powershell\6.2.3\tools\netcoreapp2.1\any\win' and also if I use the more recenlty installed Powershell 7.3.6.

  3. Adter lots of shenanigins this evening my current path environment variable is

    C:\Program Files\PowerShell\7;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.3.6.0_x64__8wekyb3d8bbwe;S:\ProgLang\Python\Scripts\;S:\ProgLang\Python\;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\WINDOWS\System32\OpenSSH\;G:\Code\D\dmd2\windows\bin;G:\Code\D\D1\dmd\windows\bin;C:\Program Files\Crucial\Crucial Storage Executive;C:\Users\slayc\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Rust nightly MSVC 1.42\bin;C:\Program Files (x86)\Rust nightly GNU 1.42\bin;C:\Program Files\OpenJDK\jdk-13.0.2\bin;C:\Program Files\Java\jdk1.8.0_211\bin;G:\NAS\;C:\Users\slayc\AppData\Roaming\Python\Python39\Scripts;C:\Users\slayc\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\OpenJDK\jdk-16\bin;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\VSCodium\bin;C:\Users\slayc\.nimble\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\slayc\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Go\bin;C:\Program Files\Erlang OTP\bin;S:\ProgLang\Haxe\haxe;S:\ProgLang\Haxe\neko;S:\ProgLang\GoLang\bin;S:\ProgLang\Erlang\Erlang OTP\bin;S:\ProgLang\Elixir\Elixir\bin;C:\WINDOWS\system32\config\systemprofile\.mix\escripts;C:\Program Files\nodejs\;C:\Program Files\PowerShell\7\;C:\Users\slayc\scoop\shims;G:\Download\ProgrammingLanguages\vlang\v_windows\v\.bin;S:\ProgLang\vLang\v\.bin;C:\Users\slayc\source\repos\Cpp\mingw64\bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools;C:\Program Files (x86)\Microsoft Visual Studio\VC98\bin;C:\Users\slayc\.cargo\bin;C:\Users\slayc.cargo\bin;C:\Users\slayc\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\slayc\AppData\Roaming\npm;C:\Users\slayc\.dotnet\tools;C:\Users\slayc\go\bin;C:\Users\slayc\AppData\Local\GitHubDesktop\bin;C:\Users\slayc\.nimble\bin;C:\Users\slayc\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Erlang OTP\bin;c:\Haskell\ghcup\bin;C:\tools\ghc-9.4.3\bin;C:\Users\slayc\.dotnet\tools;C:\Users\slayc\AppData\Local\Programs\Julia-1.8.5\bin;S:\ProgLang\Kotlinc\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin;;C:\Gradle\gradle-8.1\bin;C:\Users\slayc\go\bin;G:\Download\ProgrammingLanguages\Odin\Odin;C:\Users\slayc\AppData\Local\Programs\Microsoft VS Code\bin;E:\rakudo\bin;E:\rakudo\share\perl6\site\bin;S:\ProgLang\Haxe\haxe;C:\ProgramData\chocolatey\lib\Elixir\tools\bin;
    PS C:\Users\slayc>

    which shows that I've been trying to play around with lots of different programming languages recently.

jonahbeckford commented 10 months ago

If the installer finished the PATH would be updated. But right now, that is a side issue.

Main issue: I understand you are copying pwsh.exe around, but forget about the DkML installer if PowerShell is broken ... you have far worse issues! I hear you tell me you installed PowerShell 6.3 but that didn't include pwsh.exe (yikes!). It sounds like your system can't install either PowerShell or DkML. Is that accurate?

(Sent from mobile)

Get Outlook for iOShttps://aka.ms/o0ukef


From: FullValueRider @.> Sent: Monday, August 21, 2023 2:47:00 PM To: diskuv/dkml-installer-ocaml @.> Cc: Jonah Beckford @.>; Comment @.> Subject: Re: [diskuv/dkml-installer-ocaml] Windows Installation fails (Issue #63)

  1. Unfortunately, no.

  2. If the directory 'C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml' exists then the installation fails. If I delete 'C:\Users\slayc\AppData\Local\Programs\DiskuvOCaml' then the installation gets as far as the 'press "y" then enter to exit installation' after about 5 minutes. If I press "y" then the installation exits with no errors. However, when I restart powershell utop is not recognised. This pattern in repeated if I use the pwsh.exe I copied to 'C:\Users\slayc.dotnet\tools.store\powershell\6.2.3\powershell\6.2.3\tools\netcoreapp2.1\any\win' and also if I use the more recenlty installed Powershell 7.3.6.

  3. Adter lots of shenanigins this evening my current path environment variable is

C:\Program Files\PowerShell\7;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.3.6.0_x64__8wekyb3d8bbwe;S:\ProgLang\Python\Scripts\;S:\ProgLang\Python\;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\WINDOWS\System32\OpenSSH\;G:\Code\D\dmd2\windows\bin;G:\Code\D\D1\dmd\windows\bin;C:\Program Files\Crucial\Crucial Storage Executive;C:\Users\slayc\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Rust nightly MSVC 1.42\bin;C:\Program Files (x86)\Rust nightly GNU 1.42\bin;C:\Program Files\OpenJDK\jdk-13.0.2\bin;C:\Program Files\Java\jdk1.8.0_211\bin;G:\NAS\;C:\Users\slayc\AppData\Roaming\Python\Python39\Scripts;C:\Users\slayc\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\OpenJDK\jdk-16\bin;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\VSCodium\bin;C:\Users\slayc.nimble\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\slayc\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Go\bin;C:\Program Files\Erlang OTP\bin;S:\ProgLang\Haxe\haxe;S:\ProgLang\Haxe\neko;S:\ProgLang\GoLang\bin;S:\ProgLang\Erlang\Erlang OTP\bin;S:\ProgLang\Elixir\Elixir\bin;C:\WINDOWS\system32\config\systemprofile.mix\escripts;C:\Program Files\nodejs\;C:\Program Files\PowerShell\7\;C:\Users\slayc\scoop\shims;G:\Download\ProgrammingLanguages\vlang\v_windows\v.bin;S:\ProgLang\vLang\v.bin;C:\Users\slayc\source\repos\Cpp\mingw64\bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools;C:\Program Files (x86)\Microsoft Visual Studio\VC98\bin;C:\Users\slayc.cargo\bin;C:\Users\slayc.cargo\bin;C:\Users\slayc\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\slayc\AppData\Roaming\npm;C:\Users\slayc.dotnet\tools;C:\Users\slayc\go\bin;C:\Users\slayc\AppData\Local\GitHubDesktop\bin;C:\Users\slayc.nimble\bin;C:\Users\slayc\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Erlang OTP\bin;c:\Haskell\ghcup\bin;C:\tools\ghc-9.4.3\bin;C:\Users\slayc.dotnet\tools;C:\Users\slayc\AppData\Local\Programs\Julia-1.8.5\bin;S:\ProgLang\Kotlinc\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin;;C:\Gradle\gradle-8.1\bin;C:\Users\slayc\go\bin;G:\Download\ProgrammingLanguages\Odin\Odin;C:\Users\slayc\AppData\Local\Programs\Microsoft VS Code\bin;E:\rakudo\bin;E:\rakudo\share\perl6\site\bin;S:\ProgLang\Haxe\haxe;C:\ProgramData\chocolatey\lib\Elixir\tools\bin; PS C:\Users\slayc>

which shows that I've been trying to play around with lots of different programming languages recently.

— Reply to this email directly, view it on GitHubhttps://github.com/diskuv/dkml-installer-ocaml/issues/63#issuecomment-1687089220, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AREG4PLDOXMI4ZT67NF3WKTXWPJNJANCNFSM6AAAAAA3Y56ODI. You are receiving this because you commented.Message ID: @.***>

useada commented 10 months ago

Maybe you should try the higher version:

https://gitlab.com/dkml/distributions/dkml/-/releases

I successfully installed

FullValueRider commented 10 months ago

The observation that I might have a corrupt powershell installlation seems to have been the solution.

I can confirm that I now have a working Ocaml installation

I took the following steps

  1. Deleted all installations of powershell using the windows installer.
  2. Deleted the directory ''C:\Users\slayc.dotnet\tools.store\powershell' this removed powershell 6.2.3
  3. Deleted previous attempts at ocaml installation using windows installer
  4. Deleted any ocaml related directories at ''C:\Users\slayc\AppData\Local\Programs\'
  5. Rebooted
  6. Installed powershell via windows store - powershell 7.3.6
  7. Rebooted
  8. Installed ocaml using .\setup-diskuv-ocaml-windows_x86_64-1.2.0.exe

The installation took much longer than previous install attempts and even fired up Visual Studio Installer to install 1.5gb worth of Visual Studia Tools 2019 amongst other things.

carljr123 commented 10 months ago

I had the same issue and I basically did what FullValueRider did but I also had to disable my Avast anti-virus for the download to proceed smoothly.

kauderk commented 4 months ago

I did all of the above yet no luck

  1. powershell path.txt
  2. ocaml setup64un success question mark.txt
  3. omal diskuv failure.txt

btw after all those steps when opening visual studio installer it wants to update "visual studio build tools 2019" from version 16.11.2 to 16.11.34

kauderk commented 4 months ago

I found this video tutorial https://youtu.be/33niX94tn3U and it worked, but first I made sure to delete all previous installations.