You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the non-POSIX compliant fish shell, attempting to load the ocaml-jupyter kernel fails repeatedly with messages of ocaml-jupyter-kernel: 1: set: Illegal option -g. The problem here is that opam is fish-aware and, if it detects it as your shell, opam config env emits commands of set -gx to set environment variables, which is valid in fish but not in sh/bash/etc. That means the line in kernel.json that starts with eval $(opam config env --switch=<switch>) is failing to execute properly on kernel start because it's running /bin/sh but opam is emitting fish shell syntax and causing sh to error out.
This is fixed by adding --shell=sh to the opam arguments (e.g. eval $(opam config env --switch=<switch> --shell=sh)), which forces it to emit sh-compliant environment variable setting instead of attempting to intelligently detect the correct shell. If I do this manually and then install the kernel everything works as expected.
Judging by the error messages, I think this may also be the source of the unsolved bug report #110 as well. It was closed after the submitter worked around the problem by using docker, which bypassed the bug but never actually solved it.
The text was updated successfully, but these errors were encountered:
When using the non-POSIX compliant fish shell, attempting to load the ocaml-jupyter kernel fails repeatedly with messages of
ocaml-jupyter-kernel: 1: set: Illegal option -g
. The problem here is thatopam
is fish-aware and, if it detects it as your shell,opam config env
emits commands ofset -gx
to set environment variables, which is valid in fish but not in sh/bash/etc. That means the line inkernel.json
that starts witheval $(opam config env --switch=<switch>)
is failing to execute properly on kernel start because it's running /bin/sh but opam is emitting fish shell syntax and causing sh to error out.This is fixed by adding
--shell=sh
to the opam arguments (e.g.eval $(opam config env --switch=<switch> --shell=sh)
), which forces it to emitsh
-compliant environment variable setting instead of attempting to intelligently detect the correct shell. If I do this manually and then install the kernel everything works as expected.Judging by the error messages, I think this may also be the source of the unsolved bug report #110 as well. It was closed after the submitter worked around the problem by using docker, which bypassed the bug but never actually solved it.
The text was updated successfully, but these errors were encountered: