Closed sarahspak closed 1 year ago
Oddly, running opam init -vvv --debug-level=3
a second time works, but running opam switch create
doesn't work. See commands below
> opam init -vvv --debug-level=3
00:00.036 FILE(config) Read ~/.opam/config in 0.000s
00:00.036 CLI Parsing CLI version 2.1
<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><> 🐫
In normal operation, opam only alters files within ~/.opam.
However, to best integrate with your system, some environment variables
should be set. If you allow it to, this initialisation step will update
your zsh configuration by adding the following line to ~/.zshrc:
[[ ! -r /Users/sp/.opam/opam-init/init.zsh ]] || source /Users/sp/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
Otherwise, every time you want to access your opam installation, you will
need to run:
eval $(opam env)
You can always re-run this setup with 'opam init' later.
Do you want opam to modify ~/.zshrc? [N/y/f]
(default is 'no', use 'f' to choose a different file) y
A hook can be added to opam's init scripts to ensure that the shell remains in sync with the opam environment when they are loaded. Set that up? [y/N] y
User configuration:
~/.zshrc is already up-to-date.
> opam switch create 4.14.0
[ERROR] No compiler matching `4.14.0' found, use `opam switch list-available' to see what is available, or use `--packages' to select packages explicitly.
> opam switch list-available ocaml-base-compiler
# Listing available compilers from repositories: default
# No matches found
and trying to add a default repository fails with a permission denied error on wget
> opam repository add default https://opam.ocaml.org --set-default -vvv --debug-level=3
00:00.034 FILE(config) Read ~/.opam/config in 0.000s
00:00.034 CLI Parsing CLI version 2.1
00:00.034 GSTATE LOAD-GLOBAL-STATE @ /Users/sp/.opam
00:00.034 SYSTEM LOCK /Users/sp/.opam/lock (none => read)
00:00.034 FILE(config) Read ~/.opam/config in 0.000s
00:00.034 RSTATE LOAD-REPOSITORY-STATE @ /Users/sp/.opam
00:00.034 SYSTEM LOCK /Users/sp/.opam/repo/lock (none => write)
00:00.035 FILE(repos-config) Read ~/.opam/repo/repos-config in 0.000s
00:00.035 SYSTEM LOCK /Users/sp/.opam/repo/state-28AC8B61.cache (none => read)
00:00.035 CACHE(repository) Loaded /Users/sp/.opam/repo/state-28AC8B61.cache in 0.000s
00:00.035 SYSTEM LOCK /Users/sp/.opam/repo/state-28AC8B61.cache (read => none)
00:00.035 RSTATE Cache found
00:00.035 REPOSITORY repository-add
00:00.035 PARALLEL Iterate over 1 task(s) with 3 process(es)
00:00.035 PARALLEL Starting job 0 (worker 1/3): 0
00:00.035 REPOSITORY update default from https://opam.ocaml.org
00:00.035 CURL pull-repo-update
00:00.035 SYSTEM mkdir /var/folders/8l/369lcxws2hz0q_cn2532qz080000gn/T/opam-93251-700a03
00:00.035 PARALLEL Next task in job 0: /opt/homebrew/opt/wget --content-disposition -t 3 -O /private/var/folders/8l/369lcxws2hz0q_cn2532qz080000gn/T/opam-93251-700a03/index.tar.gz.part -U opam/2.1.5 -- https://opam.ocaml.org/index.tar.gz
00:00.036 SYSTEM LOCK /Users/sp/.opam/repo/lock (write => none)
00:00.036 SYSTEM LOCK /Users/sp/.opam/config.lock (none => none)
'opam repository add default https://opam.ocaml.org --set-default -vvv --debug-level=3' failed.
Fatal error:
/opt/homebrew/bin/opam: "create_process" failed on /opt/homebrew/opt/wget: Permission denied
my fault - for some reason /opt/homebrew/opt/ was higher in my path than /opt/homebrew/bin and I suspect that's why opam was trying to use /opt/homebrew/opt/wget
.
Once I adjusted my PATH the issues went away, so will close the issue.
It looks like this will be fixed anyway by https://github.com/ocaml/opam/pull/5606 in the upcoming opam 2.2.0
Installed opam from Homebrew on my M2 Mac but I'm not able to run opam init.
Happy to provide any other information.