Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel fails to load when using non-standard interactive shells such as fish #154

Closed
Ilazki opened this issue Sep 13, 2020 · 1 comment
Closed

Comments

@Ilazki
Copy link

Ilazki commented Sep 13, 2020

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.

@Ilazki
Copy link
Author

Ilazki commented Sep 14, 2020

@mseri: I know it still has to get merged but wow, that was a fast response. Thanks ;)

@akabe akabe closed this as completed Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants