Hi everyone, I am trying to install dune by using opam on Powershell terminal on Window 11. I have this error, and don’t know how to solve it:
opam upgrade dune
dune is not installed. Install it? [y/n] y
The following actions will be performed:
=== install 1 package
∗ dune 3.17.2
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
⬇ retrieved dune.3.17.2 (https://opam.ocaml.org/cache)
[ERROR] The compilation of dune.3.17.2 failed at "ocaml boot/bootstrap.ml -j 15".
#=== ERROR while compiling dune.3.17.2 ========================================#
# context 2.3.0 | win32/x86_64 | ocaml.5.3.0 | https://opam.ocaml.org#69dc847b8315666c52c71b48a0952f9226e54067
# path ~\AppData\Local\opam\default\.opam-switch\build\dune.3.17.2
# command ~\AppData\Local\opam\default\bin\ocaml.exe boot/bootstrap.ml -j 15
# exit-code 2
# env-file ~\AppData\Local\opam\log\dune-37044-4ffb30.env
# output-file ~\AppData\Local\opam\log\dune-37044-4ffb30.out
### output ###
# [...]
# File "otherlibs/ocamlc-loc/src\\ocamlc_loc.mli", line 1, characters 4-9:
# Warning 53 [misplaced-attribute]: the "alert" attribute cannot appear in this context
# cd _boot && C:\Users\minh\AppData\Local\opam\default\bin\ocamlopt.opt.exe -c -g -no-alias-deps -w -49-6 -alert -unstable -I +unix -I +threads dune_action_plugin.mli
# File "otherlibs/dune-action-plugin/src\\dune_action_plugin.mli", line 1, characters 4-9:
# Warning 53 [misplaced-attribute]: the "alert" attribute cannot appear in this context
# cd _boot && C:\Users\minh\AppData\Local\opam\default\bin\ocamlopt.opt.exe -o ../_boot\dune.exe -g -I +unix -I +threads unix.cmxa threads.cmxa readdir.o wait4_stubs.o signal_stubs.o platform_stubs.o copyfile_stubs.o spawn_stubs.o dune_stats_stubs.o xdg_stubs.o dune_flock.o dune_digest_stubs.o csexp_rpc_stubs.o fsevents_stubs.o inotify_stubs.o fswatch_win_stubs.o sha512_stubs.o sha256_stubs.o s[...]
# /bin/bash: C:UsersminhAppDataLocalTemplongcmd33326e: No such file or directory
# ** Fatal error: Error during linking
#
# File "caml_startup", line 1:
# Error: Error during linking (exit code 2)
#
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build dune 3.17.2
└─
╶─ No changes have been performed
It seems like there is a weird path due to concatenating. Also, I look at the directory C:/Users/minh/AppData/Local/Temp, but I cannot find the longcmd33326e file. Is there any way to solve this?
BTW, my opam version is 2.3.0 and my ocaml version is 5.3.0