opam switch error
Hello, really silly error here (not sure if this is the right place to ask, so let me know. I figured stack overflow does not have a large number of topics on opam):
I'm using opam 1.1.1
my current ocaml is 4.01.0, but for a project I want to work on I should be using 4.00.1
so I type
opam switch 4.00.1
and I get this error after awhile:
# ./build/mixed-boot.sh: 1: ./build/mixed-boot.sh: Bad substitution
# ./build/mixed-boot.sh: 16: ./build/mixed-boot.sh: Bad substitution
# make[1]: *** [ocamlbuild-mixed-boot] Error 2
# make: *** [world] Error 2
The full log would be useful. What operating system and CPU architecture, in particular.
Is your 4.01.0 switch using the 'system' (ie preinstalled switch), or does "opam switch 4.01.0" work?
-anil
On 3 Mar 2014, at 22:06, evanthebouncy [email protected] wrote:
Hello, really silly error here (not sure if this is the right place to ask, so let me know. I figured stack overflow does not have a large number of topics on opam):
I'm using opam 1.1.1
my current ocaml is 4.01.0, but for a project I want to work on I should be using 4.00.1
so I type
opam switch 4.00.1 and I get this error after awhile:
./build/mixed-boot.sh: 1: ./build/mixed-boot.sh: Bad substitution
./build/mixed-boot.sh: 16: ./build/mixed-boot.sh: Bad substitution
make[1]: *** [ocamlbuild-mixed-boot] Error 2
make: *** [world] Error 2
— Reply to this email directly or view it on GitHub.
opam config report would be a good start, plus the full log.
It should be as simple as opam switch 4.00.1.
Thanks.
Closing due to lack of information to reproduce. Feel free to reopen if you have more data.
Hi @AltGr
I got the same error message when running $ opam init --comp=4.01.0.
In my case, the problem is caused by my custom PS4 environment variable which uses bash-specific syntax. A sh-compatible string should be set to PS4.
$ PS4="" opam init --comp=4.01.0 worked for me.
# defined in my bashrc
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
$ opam config report
# OPAM config report
# opam-version 1.2.2 (391297300524717e1475deaea37bca287c7f5e36)
# self-upgrade no
# os linux
# external-solver aspcud $in $out $criteria
# criteria -count(removed),-notuptodate(request),-sum(request,version-lag),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution),-sum(solution,version-lag)
# jobs 4
# repositories 1* (http)
# pinned 0
# current-switch 4.01.0
# last-update 2015-06-30 13:33