smabie / xs

concatenative array language inspired by kdb/+q
89 stars 5 forks source link

Problem installing xs #3

Closed hakank closed 4 years ago

hakank commented 4 years ago

I tried to install xs on my Linux Ubuntu 18.04 LTS machine but opam give some strange errors

$ opam pin add xs https://github.com/smabie/xs.git """ Package xs does not exist, create as a NEW package ? [Y/n] y xs is now git-pinned to https://github.com/smabie/xs.git

[xs] https://github.com/smabie/xs.git updated [ERROR] File "/home/hakank/.opam/4.06.0/packages.dev/xs/xs.opam", line 8, character 26-27: parse error. [WARNING] Errors in opam file from xs source, ignored (fix with 'opam pin edit')

[ERROR] File "/home/hakank/.opam/4.06.0/overlay/xs/opam_", line 8, character 26-27: parse error. Invalid opam file: error 1: File does not parse Errors in /home/hakank/.opam/4.06.0/overlay/xs/opam, retry editing ? [Y/n] n [ERROR] No valid metadata available. xs is now unpinned from git https://github.com/smabie/xs.git """

The generated file that comes up with the fix command (for editing the file) is this: """

This file is generated by dune, edit dune-project instead

opam-version: "2.0" synopsis: "Xs is a concatenative array language inspired by kdb+/q" description: """
Xs is a unique concatenative language that aims to match the power
of q with more flexibility and expressiveness. Xs is dynamically
typed with dynamic scoping and puts a strong emphasis on terseness,
beauty, and simplicity.""" maintainer: ["sturm@cryptm.org"] authors: ["Sturm Mabie"] license: "Public Domain" homepage: "https://github.com/smabie/xs" bug-reports: "https://github.com/smabie/xs/issues" depends: [ "ocaml" "dune" "core" "angstrom" "res" "ppx_jane" "ppx_inline_test" ] build: [ ["dune" "subst"] {pinned} [ "dune" "build" "-p" name "-j" jobs "@install" "@runtest" {with-test} "@doc" {with-doc} ] ] dev-repo: "git+https://github.com/smabie/xs.git" """

My opam version is 1.2.2.

Do you have any suggestions how to proceed?

smabie commented 4 years ago

You are using a very old opam version and old OCaml. To get a current version of opam:

add-apt-repository ppa:avsm/ppa
apt update
apt install opam

For more info, check out the opam install instructions: https://opam.ocaml.org/doc/Install.html

Right now, I'm using opam 2.0.7, so check with opam --version that it is atleast 2.x. Just to be sure, let's use the optimized version of the latest OCaml release:

opam switch create 4.10.0+flambda 4.10.0+flambda

This creates a new opam switch called '4.10.0+flambda` that's pinned to version 4.10.0+flambda (flambda is the optimizing compiler). Now simply just run the install command again:

opam pin add xs https://github.com/smabie/xs.git

Let me know if this works for you. Thanks for trying out xs!

hakank commented 4 years ago

Ah, I would expect it was an old version. Excellent, it works now.