Grimoire-
Command
.es

GNU+Linux command memo

Install rtop on Debian Stretch (or Buster)

1. version : en

1.1. Official methods

Install rtop, the ReasonML toplevel interpreter in Debian oldstable [1] Stretch 9.9. It’s young (may 2016) and not packaged (yet ? [2]).

Official method, via npm : ~250 dependances for npm in Debian… let’s try the alternative method : yarn.

The yarnpkg is not installed by apt, conflicts in dependances :

The following package contain unsatisfied dependances :
 yarnpkg : Depends on: node-babel-runtime (>= 6.26.0) but 6.18.0-1 must be installed
			[… 8 lines …]
		   Depends on: node-node-uuid (>= 3.0.1) but 1.4.0-1 must be installed
E: Impossibl to fix the problems, some broken packages are in "keep" state.

That lets us with npm, but surprise npm install -g reason-cli@latest-linux fails Grmbl :-/

error: Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/reason-cli/3______________________________________________'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reason-cli@3.3.3-linux-1 postinstall: `node ./esyInstallRelease.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reason-cli@3.3.3-linux-1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-07-19T13_10_38_373Z-debug.log

1.2. Via OPAM the OCaml Package Manager

The official Reason website don’t mention other methods but there’s still the OCaml Package Manager : opam.

opam Install :

# apt install opam

Catalog update and rtop install :

$ opam init (1)
$ opam install rtop
1 With Debian Buster, this step needs to be augmented a bit : apt install mccs opam init --solver=mccs
$ rtop
────────────────┬─────────────────────────────────────────────────────────────┬
                 Welcome to utop version 2.0.1 (using OCaml version 4.02.3)! 
                └─────────────────────────────────────────────────────────────┘

                   ___  _______   ________  _  __
                  / _ \/ __/ _ | / __/ __ \/ |/ /
                 / , _/ _// __ |_\ \/ /_/ /    /
                /_/|_/___/_/ |_/___/\____/_/|_/

  Execute statements/let bindings. Hit <enter> after the semicolon. Ctrl-d to quit.

        >   let myVar = "Hello Reason!";
        >   let myList: list(string) = ["first", "second"];
        >   #use "./src/myFile.re"; /* loads the file into here */

Type #utop_help for help about using utop.

Reason #

2. version : fr

2.1. Méthodes officielles

Installation d' rtop, l’interpréteur ReasonML, dans Debian oldstable [3] Stretch 9.9. C’est jeune (mai 2016) et pas packagé [4] (ça commence…).

Méthode officielle, via npm. Y’a ~250 dépendances pour npm dans Debian… voyons la méthode alternative : yarn.

Le paquet yarnpkg n’est pas installé par apt, conflit de dépendances :

Les paquets suivants contiennent des dépendances non satisfaites :
 yarnpkg : Dépend: node-babel-runtime (>= 6.26.0) mais 6.18.0-1 devra être installé
			[… 8 lignes …]
		   Dépend: node-node-uuid (>= 3.0.1) mais 1.4.0-1 devra être installé
E: Impossible de corriger les problèmes, des paquets défectueux sont en mode « garder en l'état ».

Bon bah allons-y pour npm… Mais surprise : erreur à l’exécution de npm install -g reason-cli@latest-linux Grmbl :-/

error: Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/reason-cli/3______________________________________________'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reason-cli@3.3.3-linux-1 postinstall: `node ./esyInstallRelease.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reason-cli@3.3.3-linux-1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-07-19T13_10_38_373Z-debug.log

2.2. Via OPAM l’OCaml Package Manager

Le site officiel n’indique pas d’autre méthode d’installation, mais il reste le gestionnaire de paquet d’OCaml : opam.

Installation d' opam :

# apt install opam

Mise à jour du catalogue, et installation d' rtop :

$ opam init (1)
$ opam install rtop
1 Avec Debian Buster, cette étape doit être augmentée un peu : apt install mccs opam init --solver=mccs
$ rtop
────────────────┬─────────────────────────────────────────────────────────────┬
                 Welcome to utop version 2.0.1 (using OCaml version 4.02.3)! 
                └─────────────────────────────────────────────────────────────┘

                   ___  _______   ________  _  __
                  / _ \/ __/ _ | / __/ __ \/ |/ /
                 / , _/ _// __ |_\ \/ /_/ /    /
                /_/|_/___/_/ |_/___/\____/_/|_/

  Execute statements/let bindings. Hit <enter> after the semicolon. Ctrl-d to quit.

        >   let myVar = "Hello Reason!";
        >   let myList: list(string) = ["first", "second"];
        >   #use "./src/myFile.re"; /* loads the file into here */

Type #utop_help for help about using utop.

Reason #

1. oldstable since 10 days while writing this post.
2. Neither in Buster 10.0.
3. oldstable depuis 10 jours au moment de l’écriture.
4. Pas dans Buster 10.0 non plus.