diskuv / dkml-installer-ocaml

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

Scoop bash.exe (etc.) conflicts with v1.2.0-prerel7 Installer #34

Closed AisonSu closed 1 year ago

AisonSu commented 1 year ago

I had disbled antivirus/malware/Defender/etc, But I still got error as log beyond:

config.status: creating Makefile.build_config
config.status: creating Makefile.config
config.status: creating stdlib/sys.ml
config.status: creating manual/src/version.tex
config.status: creating manual/src/html_processing/src/common.ml
config.status: creating tools/eventlog_metadata
config.status: creating runtime/caml/m.h
config.status: creating runtime/caml/s.h
config.status: creating runtime/caml/version.h
config.status: executing libtool commands
Setup did not complete because an error occurred.
MSYS2 command failed! Exited with 127. Command was: env MSYSTEM=CLANG64 MSYSTEM_PREFIX=/clang64 HOME=/home/aison PATH=/clang64/bin:/usr/bin:/bin env PATH=/c/Users/aison/scoop/shims:/clang64/bin:/usr/bin:/bin DKML_TMP_PARENTDIR=/c/Users/aison/AppData/Local/Temp/PA7B6E~1/0 env DiskuvOCamlVarsVersion=2 DiskuvOCamlHome='/c/Users/aison/AppData/Local/Programs/DISKUV~1' DiskuvOCamlBinaryPaths='/c/Users/aison/AppData/Local/Programs/DISKUV~1/usr/bin:/c/Users/aison/AppData/Local/Programs/DISKUV~1/bin' DiskuvOCamlMSYS2Dir='/' DiskuvOCamlDeploymentId='v-1.2.0-prerel7;ocaml-4.14.0;opam-2.2.0~alpha0~20221228;inotify-36d18f3dfe042b21d7136a1479f08f0d8e30e2f9;msys2-999CED2C8F5FF6A2;docker-99C8BC9860D703EB;bins-952D9673A6642899;stubs-4E6958B274EAB043;toplevels-80941AA1C64DA259' DiskuvOCamlVersion='1.2.0-prerel7' WITHDKML_ENABLE=OFF OCAMLLIB= TOPDIR=/c/Users/aison/AppData/Local/Temp/7Z3AEE~1/sg/NETWOR~1/WINDOW~1/dkmldir/vendor/drc/all/emptytop sh /c/Users/aison/AppData/Local/Temp/7z3AEE8530/sg/network-ocamlcompiler/windows_x86_64/install-ocaml.sh /c/Users/aison/AppData/Local/Temp/7Z3AEE~1/sg/NETWOR~1/WINDOW~1/dkmldir 15553b77175270d987058b386d737ccb939e8d5a windows_x86_64 /c/Users/aison/AppData/Local/Programs/DISKUV~1 --disable-imprecise-c99-float-ops

at Invoke-MSYS2Command, C:\Users\aison\AppData\Local\Temp\7z3AEE8530\sg\network-ocamlcompiler\windows_x86_64\dkmldir\vendor\drd\src\windows\UnixInvokers\UnixInvokers.psm1: line 165
at Invoke-MSYS2CommandWithProgress, C:\Users\aison\AppData\Local\Temp\7z3AEE8530\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.ps1: line 863
at <ScriptBlock>, C:\Users\aison\AppData\Local\Temp\7z3AEE8530\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.ps1: line 1123
at <ScriptBlock>, <No file>: line 1
at <ScriptBlock>, <No file>: line 1

[Advanced] MSYS2 commands can be run with: C:\Users\aison\AppData\Local\Programs\DISKUV~1\tools\MSYS2\msys2_shell.cmd

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\aison\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\aison\AppData\Local\Temp\7z3AEE8530\sg\network-ocamlcompiler\windows_x86_64\setup-userprofile.bat
                                             -AllowRunAsAdmin
                                             -InstallationPrefix
                                             C:\Users\aison\AppData\Local\Programs\DISKUV~1
                                             -MSYS2Dir
                                             C:\Users\aison\AppData\Local\Programs\DISKUV~1\tools\MSYS2
                                             -OpamExe
                                             C:\Users\aison\AppData\Local\Programs\DISKUV~1\bin\OPAM-R~1.EXE
                                             -DkmlPath
                                             C:\Users\aison\AppData\Local\Temp\7Z3AEE~1\sg\NETWOR~1\WINDOW~1\dkmldir
                                             -GlobalCompileDir
                                             C:\Users\aison\AppData\Local\Temp\7Z3AEE~1\sg\STAGIN~1\generic
                                             -NoDeploymentSlot -DkmlHostAbi
                                             windows_x86_64 -TempParentPath
                                             C:\Users\aison\AppData\Local\Temp\PA7B6E~1
                                             -SkipProgress -SkipMSYS2Update

>>> A transient failure occurred. <<<

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

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

                         >>> A transient failure occurred. <<<
jonahbeckford commented 1 year ago

Please schedule a session with me using https://calendly.com/diskuv/30-minute-dkml-installation at your convenience.

jonahbeckford commented 1 year ago

You won't need to schedule another session ... I have enough information to at least provide a temporary fix.

jonahbeckford commented 1 year ago

Thank you for taking the time. I'll try to get you a temporary fix as soon as possible.

jonahbeckford commented 1 year ago

Actually, on second thought I will need to reschedule another session. Can you add one more to the calendar at https://calendly.com/diskuv/30-minute-dkml-installation ?

Thanks.

jonahbeckford commented 1 year ago

The problem is that you have a bash (a UNIX shell) present in your Windows folder, and also another one in your scoop folder where you have Git located. Those are conflicting with the bash from Diskuv OCaml.

Will update ticket when I figure out the best way to make them all work together.

jonahbeckford commented 1 year ago

The Git installation by Scoop seems like the main issue. Another Scoop package install may be the culprit as well, if that package installed its own make.exe. I installed Scoop in a Windows Sandbox, and then ran scoop install git, and can see:

PS C:\Users\WDAGUtilityAccount> dir ~\scoop\shims

    Directory: C:\Users\WDAGUtilityAccount\scoop\shims

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        11/14/2022   6:50 PM         126464 7z.exe
-a----         1/20/2023   8:52 AM             69 7z.shim
-a----        11/14/2022   6:50 PM         126464 7zfm.exe
-a----         1/20/2023   8:52 AM             71 7zfm.shim
-a----        11/14/2022   6:50 PM         126464 7zg.exe
-a----         1/20/2023   8:52 AM             70 7zg.shim
-a----        11/14/2022   6:50 PM         126464 bash.exe
-a----         1/20/2023   8:52 AM             74 bash.shim
-a----        11/14/2022   6:50 PM         126464 git-bash.exe
-a----         1/20/2023   8:52 AM             74 git-bash.shim
-a----        11/14/2022   6:50 PM         126464 git-gui.exe
-a----         1/20/2023   8:52 AM             77 git-gui.shim
-a----        11/14/2022   6:50 PM         126464 git.exe
-a----         1/20/2023   8:52 AM             73 git.shim
-a----        11/14/2022   6:50 PM         126464 gitk.exe
-a----         1/20/2023   8:52 AM             74 gitk.shim
-a----        11/14/2022   6:50 PM         126464 scalar.exe
-a----         1/20/2023   8:52 AM             76 scalar.shim
-a----         1/20/2023   8:51 AM            382 scoop
-a----         1/20/2023   8:51 AM            599 scoop.cmd
-a----         1/20/2023   8:51 AM            248 scoop.ps1
-a----        11/14/2022   6:50 PM         126464 sh.exe
-a----         1/20/2023   8:52 AM             72 sh.shim
-a----        11/14/2022   6:50 PM         126464 tig.exe
-a----         1/20/2023   8:52 AM             77 tig.shim

During the install, a sanitized PATH is used to avoid unusual PATH issues on PCs. However, the Git directory always has to be added to the PATH, which means a new bash.exe gets added as well.

One solution may be to check for scoop and only add the following to the PATH:

PS C:\Users\WDAGUtilityAccount> dir ~\scoop\apps\git\current\cmd

    Directory: C:\Users\WDAGUtilityAccount\scoop\apps\git\current\cmd

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         1/12/2023   8:42 AM         136240 git-gui.exe
-a----         1/12/2023   8:42 AM          45104 git.exe
-a----         1/12/2023   8:42 AM         136240 gitk.exe
-a----         1/12/2023   8:42 AM          45104 scalar.exe
-a----         1/12/2023   8:42 AM           3022 start-ssh-agent.cmd
-a----         1/12/2023   8:42 AM           2723 start-ssh-pageant.cmd

(I'm a bit surprised that a major Windows package manager will squash everything into the same directory.)

Renaming ticket to "Scoop conflicts during installation".

jonahbeckford commented 1 year ago

@AisonSu Can you open a PowerShell window and run:

dir ~\scoop\shims

and paste the output here?

AisonSu commented 1 year ago

@AisonSu Can you open a PowerShell window and run:

dir ~\scoop\shims

and paste the output here?

@jonahbeckford


    Directory: C:\Users\aison\scoop\shims

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2022/11/14    18:50         126464 7z.exe
-a---          2022/11/25    20:22             56 7z.shim
-a---          2022/11/14    18:50         126464 7zfm.exe
-a---          2022/11/25    20:22             58 7zfm.shim
-a---          2022/11/14    18:50         126464 7zg.exe
-a---          2022/11/25    20:22             57 7zg.shim
-a---          2022/11/14    18:50         126464 bash.exe
-a---          2022/11/25    20:22             61 bash.shim
-a---          2022/11/30    13:14         126464 dark.exe
-a---          2022/12/14    11:14             58 dark.shim
-a---          2022/11/14    18:50         126464 git-bash.exe
-a---          2022/11/25    20:22             61 git-bash.shim
-a---          2022/11/14    18:50         126464 git-gui.exe
-a---          2022/11/25    20:22             64 git-gui.shim
-a---          2022/11/14    18:50         126464 git.exe
-a---          2022/11/25    20:22             60 git.shim
-a---          2022/11/14    18:50         126464 gitk.exe
-a---          2022/11/25    20:22             61 gitk.shim
-a---          2022/12/14    11:14            177 idle
-a---          2022/12/14    11:14            138 idle.cmd
-a---          2022/12/14    11:14            177 idle3
-a---          2022/12/14    11:14            138 idle3.cmd
-a---          2022/11/14    18:50         126464 nvm.exe
-a---          2022/11/25    20:28             56 nvm.shim
-a---          2022/11/14    18:50         126464 op.exe
-a---          2022/11/25    20:22             65 op.shim
-a---          2022/11/30    13:14         126464 poetry.exe
-a---          2022/12/17    15:44             75 poetry.shim
-a---          2022/11/30    13:14         126464 python3.exe
-a---          2022/12/14    11:14             62 python3.shim
-a---          2022/11/14    18:50         126464 scalar.exe
-a---          2022/11/25    20:22             63 scalar.shim
-a---          2022/12/17    15:42            343 scoop
-a---          2022/12/17    15:42            342 scoop.cmd
-a---          2022/12/17    15:42            235 scoop.ps1
-a---          2022/11/14    18:50         126464 sh.exe
-a---          2022/11/25    20:22             59 sh.shim
-a---          2022/11/14    18:50         126464 starship.exe
-a---          2022/11/25    20:22             66 starship.shim
-a---          2022/11/30    13:14            325 sudo
-a---          2022/11/30    13:14            324 sudo.cmd
-a---          2022/11/30    13:14            223 sudo.ps1
-a---          2022/11/14    18:50         126464 tig.exe
-a---          2022/11/25    20:22             64 tig.shim
AisonSu commented 1 year ago

They were instead in scoop/apps and then symbolic linked in the scoop/shims

jonahbeckford commented 1 year ago

I have a fix for you now.

Please use the downloads at https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v1.2.0-prerel10 :

Use the uninstaller first, temporarily disable the antivirus (if any) and then the installer.

Please tell me if that works for you.

AisonSu commented 1 year ago

It totally works well! Thanks for your help!

tensor-programming commented 1 year ago

This is interesting. I do use scoop as well and also have git on my scoop install. I can verify that 1.2.0 works without a problem. Thanks for all the work; scoop is such a useful tool but it can cause obvious issues if some of the dependencies are exposed and overlap.