opam icon indicating copy to clipboard operation
opam copied to clipboard

Unable to build: clang: error: unable to make temporary file: Operation not permitted

Open jinh0 opened this issue 3 years ago • 2 comments

Expected Behavior

Install dune without any errors with sudo opam install dune.

Actual Behavior

Run sudo opam install dune. I get:

The following actions will be performed:
  - install dune 3.3.1

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[dune.3.3.1] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of dune failed at "/Users/jinhoyoon/.opam/opam-init/hooks/sandbox.sh build ocaml bootstrap.ml -j 7".

#=== ERROR while compiling dune.3.3.1 =========================================#
# context     2.0.8 | macos/x86_64 | ocaml-base-compiler.4.14.0 | https://opam.ocaml.org#473aa392
# path        ~/.opam/default/.opam-switch/build/dune.3.3.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml bootstrap.ml -j 7
# exit-code   2
# env-file    ~/.opam/log/dune-49784-6d07ae.env
# output-file ~/.opam/log/dune-49784-6d07ae.out
### output ###
# ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
# cc: error: couldn't create cache file '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/xcrun_db-upMHW2rY' (errno=Operation not permitted)
# cc: error: couldn't create cache file '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/xcrun_db-mcDgJ8PT' (errno=Operation not permitted)
# clang: error: unable to make temporary file: Operation not permitted
# File "boot/duneboot.ml", line 1:
# Error: Error while building custom runtime system

Specifications

  • Version of dune (output of dune --version): I want to install 3.3.1
  • Version of ocaml (output of ocamlc --version): 4.14.0
  • Operating system (distribution and version): macOS Monterey

jinh0 avatar Jul 21 '22 14:07 jinh0

Is it the same problem than in #4958 ?

rjbou avatar Jul 21 '22 14:07 rjbou

I saw that issue, but it didn't seem to help. I also did chmod +rwx /var/folders to see if that might help, but it did not change the issue.

jinh0 avatar Jul 22 '22 01:07 jinh0