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

Installation failed when used in an empty debian VM #78

Open
TheLortex opened this issue Jun 30, 2022 · 1 comment
Open

Installation failed when used in an empty debian VM #78

TheLortex opened this issue Jun 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@TheLortex
Copy link

I'm trying to easily install the platform in a debian Github Codespace (https://github.com/features/codespaces).
The platform installer is not working as expected. When running it, it fails with the following error message:

@TheLortex ➜ /workspaces/ocaml-codespace (main) $ sudo bash < <(curl -L https://github.com/tarides/ocaml-platform-installer/releases/latest/download/installer.sh)
[...] 
=> Install into /usr/local/bin
Installation is done. Please run 'ocaml-platform' to install the Platform tools inside your set switch.
@TheLortex ➜ /workspaces/ocaml-codespace (main) $ ocaml-platform
ocaml-platform: [ERROR] Command 'opam show ocaml -f installed-version --normalise --yes -q
           --color=never --root /home/codespace/.opam' failed: exited with 50

When running the opam command manually I get [ERROR] Opam has not been initialised, please run 'opam init'

@TheLortex TheLortex changed the title Installation failed when using from an empty debian VM Installation failed when used in an empty debian VM Jun 30, 2022
@Julow
Copy link
Member

Julow commented Jun 30, 2022

The root cause is an error during opam init, which is not reported properly: #79

With this patch, I now get:

ocaml-platform: [DEBUG] Running: 'opam' 'init' '--yes' '-q' '--color=never' '--root' '/root/.opam'
ocaml-platform: [DEBUG] Error in execution: 
# bwrap: Creating new namespace failed: Operation not permitted
### output ###
# output-file          /tmp/opam-xxx-11/ocaml-system-11-8b8a2d.out
# env-file             /tmp/opam-xxx-11/ocaml-system-11-8b8a2d.env
# exit-code            1
# command              ~/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml
# path                 ~/.opam/default/.opam-switch/build/ocaml-system.4.11.1
# context              2.0.8 | linux/x86_64 |  | https://opam.ocaml.org#6447b747
#=== ERROR while compiling ocaml-system.4.11.1 ================================#

[ERROR] The compilation of ocaml-system failed at "/root/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml".
[NOTE] Will configure from built-in defaults.
[WARNING] Running as root is not recommended
ocaml-platform: [ERROR] Command 'opam init --yes -q --color=never --root /root/.opam' failed: exited with 31

As a workaround for now, you can init opam manually with opam init --disable-sandboxing and run ocaml-platform again.

@tmattio tmattio added the bug Something isn't working label Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants