简体   繁体   中英

Cannot install dune on MacOS for OUnit2

So, I need to install OUnit2 and I'm on a 2015 MacBook Pro running MacOS Monterey 12.6. I have homebrew, I have Ocaml, I have opam. Dune is one of Ounit2's dependencies, so obviously I need it to have OUnit2. However, this is what I get:

$ opam install ounit
The following actions will be performed:
  ∗ install dune         3.6.1 [required by ounit2]
  ∗ install stdlib-shims 0.3.0 [required by ounit2]
  ∗ install ounit2       2.2.6 [required by ounit]
  ∗ install ounit        2.2.6
===== ∗ 4 =====
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
⬇ retrieved ounit.2.2.6  (cached)
⬇ retrieved ounit2.2.2.6  (cached)
⬇ retrieved stdlib-shims.0.3.0  (cached)
⬇ retrieved dune.3.6.1  (cached)
[ERROR] The compilation of dune.3.6.1 failed at "ocaml boot/bootstrap.ml -j 3".

#=== ERROR while compiling dune.3.6.1 =========================================#
# context     2.1.4 | macos/x86_64 | ocaml-base-compiler.4.13.0 | https://opam.ocaml.org#a9fb5a37
# path        ~/.opam/4.13.0/.opam-switch/build/dune.3.6.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml boot/bootstrap.ml -j 3
# exit-code   2
# env-file    ~/.opam/log/dune-6080-3de25d.env
# output-file ~/.opam/log/dune-6080-3de25d.out
### output ###
# [...]
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:208:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h:25:
# /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:796:20: error: use of undeclared identifier 'uuid_string_t'
#         char            reserved[JIB_RESERVED_SIZE];
#                                  ^
# /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:787:61: note: expanded from macro 'JIB_RESERVED_SIZE'
# #define JIB_RESERVED_SIZE  ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)
#                                                             ^
# 2 errors generated.
# 



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build dune 3.6.1
└─ 
╶─ No changes have been performed

So far, I've tried updating my MacOS (I tried this on Mojave 11.4, same error, then upgraded to Monterey) and reinstalling my xcode Command Line Tools. Why isn't this working?

Stupid problems call for stupid solutions.

Adding typedef __darwin_uuid_string_t uuid_string_t; to line 777 of /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h magically made it work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM