Commit 7eb4d827 authored by Ulrik Strid's avatar Ulrik Strid Committed by Vincent Laporte
Browse files

ligo: 0.47.0 -> 0.53.0

parent 7ca2b0d9
Loading
Loading
Loading
Loading
+24 −14
Original line number Diff line number Diff line
@@ -2,41 +2,46 @@
, fetchFromGitLab
, git
, coq
, ocamlPackages
, cacert
, ocaml-crunch
}:

coq.ocamlPackages.buildDunePackage rec {
ocamlPackages.buildDunePackage rec {
  pname = "ligo";
  version = "0.47.0";
  version = "0.53.0";
  src = fetchFromGitLab {
    owner = "ligolang";
    repo = "ligo";
    rev = version;
    sha256 = "sha256-VJs0pKA99mZXhipK1bSAZmgAHvYbGbjxdI2XyJYjSm0=";
    sha256 = "sha256-WNiN9UrwXCwfxWnR5oPm9sGWelQCpooCXh43T2QaOnI=";
    fetchSubmodules = true;
  };

  # The build picks this up for ligo --version
  LIGO_VERSION = version;

  duneVersion = "3";

  strictDeps = true;

  nativeBuildInputs = [
    ocaml-crunch
    git
    coq
    coq.ocamlPackages.menhir
    coq.ocamlPackages.ocaml-recovery-parser
    ocamlPackages.crunch
    ocamlPackages.menhir
    ocamlPackages.ocaml-recovery-parser
  ];

  buildInputs = with coq.ocamlPackages; [
  buildInputs = with ocamlPackages; [
    coq
    menhir
    menhirLib
    qcheck
    ocamlgraph
    bisect_ppx
    decompress
    ppx_deriving
    ppx_deriving_yojson
    ppx_expect
@@ -49,11 +54,11 @@ coq.ocamlPackages.buildDunePackage rec {
    core_unix
    pprint
    linenoise
    dune-configurator
    ctypes_stubs_js
    crunch
    zarith_stubs_js
    pure-splitmix
    semver
    lambda-term
    tar-unix
    parse-argv

    # Test helpers deps
    qcheck
@@ -61,7 +66,12 @@ coq.ocamlPackages.buildDunePackage rec {
    alcotest-lwt

    # vendored tezos' deps
    tezos-plonk
    tezos-bls12-381-polynomial
    ctypes
    ctypes_stubs_js
    class_group_vdf
    dune-configurator
    hacl-star
    hacl-star-raw
    lwt-canceler
@@ -80,23 +90,23 @@ coq.ocamlPackages.buildDunePackage rec {
    irmin-pack
    ezjsonm
    data-encoding
    pure-splitmix
    zarith_stubs_js
  ];

  checkInputs = [
    cacert
    coq.ocamlPackages.ca-certs
    ocamlPackages.ca-certs
  ];

  doCheck = false; # Tests fail, but could not determine the reason

  patches = [ ./ligo.patch ]; # fix for core >= 0.15.0

  meta = with lib; {
    homepage = "https://ligolang.org/";
    downloadPage = "https://ligolang.org/docs/intro/installation";
    description = "A friendly Smart Contract Language for Tezos";
    license = licenses.mit;
    platforms = [ "x86_64-linux" ];
    platforms = ocamlPackages.ocaml.meta.platforms;
    maintainers = with maintainers; [ ulrikstrid ];
  };
}
+0 −151
Original line number Diff line number Diff line
From 6926fed076c2f5aa3282dbca10538d156c045c6f Mon Sep 17 00:00:00 2001
From: bezmuth <benkel97@protonmail.com>
Date: Wed, 3 Aug 2022 15:53:10 +0100
Subject: [PATCH] Compat with core v0.15.0

---
 ligo.opam                                  | 4 +++-
 ligo.opam.locked                           | 5 +++--
 src/bin/cli.ml                             | 4 ++--
 src/bin/dune                               | 4 +++-
 src/main/helpers/cli_helpers.ml            | 4 ++--
 src/main/interpreter/dune                  | 2 +-
 src/main/interpreter/interpreter.ml        | 2 ++
 vendors/ligo-utils/simple-utils/dune       | 1 +
 vendors/ligo-utils/simple-utils/snippet.ml | 2 +-
 9 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ligo.opam b/ligo.opam
index 47513217f..073f68ff5 100644
--- a/ligo.opam
+++ b/ligo.opam
@@ -10,7 +10,9 @@ license: "MIT"
 # If you change the dependencies, run `opam lock` in the root
 depends: [
   # Jane Street Core
-  "core" {= "v0.14.1"}
+  "core" {>= "v0.14.1" & < "v0.16.0"}
+  "core_kernel" { >= "v0.14.1" & "v0.16.0"}
+  "core_unix" { >= "v0.14.1"  & "v0.16.0"}
   # Tooling
   "odoc" { build }
   "ocamlfind" { build }
diff --git a/ligo.opam.locked b/ligo.opam.locked
index fd6fccf03..458e11791 100644
--- a/ligo.opam.locked
+++ b/ligo.opam.locked
@@ -47,8 +47,9 @@ depends: [
   "conf-rust" {= "0.1"}
   "conf-which" {= "1"}
   "coq" {= "8.13.2"}
-  "core" {= "v0.14.1"}
-  "core_kernel" {= "v0.14.2"}
+  "core" {= "v0.15.0"}
+  "core_kernel" {= "v0.15.0"}
+  "core_unix" {= "v0.15.0"}
   "cppo" {= "1.6.8"}
   "csexp" {= "1.5.1"}
   "cstruct" {= "6.1.0"}
diff --git a/src/bin/cli.ml b/src/bin/cli.ml
index dcaa85621..e411d8f32 100644
--- a/src/bin/cli.ml
+++ b/src/bin/cli.ml
@@ -14,7 +14,7 @@ let entry_point =
 let source_file =
     let name = "SOURCE_FILE" in
     let _doc = "the path to the smart contract file." in
-    Command.Param.(anon (name %: Filename.arg_type))
+    Command.Param.(anon (name %: Filename_unix.arg_type))
 
 let package_name =
   let name = "PACKAGE_NAME" in
@@ -783,7 +783,7 @@ let main = Command.group ~preserve_subcommand_order:() ~summary:"The LigoLANG co
   ]
 
 let run ?argv () =
-  Command.run ~version:Version.version ?argv main;
+  Command_unix.run ~version:Version.version ?argv main;
   (* Effect to error code *)
   match !return with
     Done -> 0;
diff --git a/src/bin/dune b/src/bin/dune
index 03e5f17b5..74340ae9d 100644
--- a/src/bin/dune
+++ b/src/bin/dune
@@ -11,7 +11,9 @@
   repl
   install
   cli_helpers
-  ligo_api)
+  ligo_api
+  core_unix.command_unix
+  core_unix.filename_unix)
  (modules cli version))
 
 
diff --git a/src/main/helpers/cli_helpers.ml b/src/main/helpers/cli_helpers.ml
index 3d09ee6b8..585cca6fa 100644
--- a/src/main/helpers/cli_helpers.ml
+++ b/src/main/helpers/cli_helpers.ml
@@ -71,7 +71,7 @@ let run_command (cmd : command) =
     (fun p -> Lwt.map  
       (fun status -> 
         match status with
-          Caml.Unix.WEXITED 0 -> Ok ()
+          Caml_unix.WEXITED 0 -> Ok ()
         | _ -> Error ("unknown error"))
         p#status) in
-  Lwt_main.run status
\ No newline at end of file
+  Lwt_main.run status
diff --git a/src/main/interpreter/dune b/src/main/interpreter/dune
index 6ccc74ff0..7d38bb822 100644
--- a/src/main/interpreter/dune
+++ b/src/main/interpreter/dune
@@ -4,4 +4,4 @@
  (instrumentation
   (backend bisect_ppx))
  (libraries tezos-013-PtJakart-test-helpers ast_aggregated ligo_interpreter
-   main_errors ligo_compile build fuzz ligo_run self_ast_typed bls12-381))
+   main_errors ligo_compile build fuzz ligo_run self_ast_typed bls12-381 core_unix.sys_unix))
diff --git a/src/main/interpreter/interpreter.ml b/src/main/interpreter/interpreter.ml
index 0f76a286c..d9a389a6b 100644
--- a/src/main/interpreter/interpreter.ml
+++ b/src/main/interpreter/interpreter.ml
@@ -3,6 +3,8 @@ open Simple_utils
 open Ligo_interpreter.Types
 open Ligo_interpreter.Combinators
 
+module Sys = Sys_unix
+
 module AST = Ast_aggregated
 
 include AST.Types
diff --git a/vendors/ligo-utils/simple-utils/dune b/vendors/ligo-utils/simple-utils/dune
index becca2f86..a890dbf62 100644
--- a/vendors/ligo-utils/simple-utils/dune
+++ b/vendors/ligo-utils/simple-utils/dune
@@ -6,6 +6,7 @@
   (libraries
     ;; Third party
    core
+   core_kernel.caml_unix
    yojson
    result
    unix
diff --git a/vendors/ligo-utils/simple-utils/snippet.ml b/vendors/ligo-utils/simple-utils/snippet.ml
index 658f115f2..f23000590 100644
--- a/vendors/ligo-utils/simple-utils/snippet.ml
+++ b/vendors/ligo-utils/simple-utils/snippet.ml
@@ -1,7 +1,7 @@
 (* used to show code snippets in error messages *)
 
 let print_code ppf (l:Region.t) (input_line: unit -> string) =
-  let dumb =String.equal (Caml.Unix.getenv "TERM") "dumb" in
+  let dumb =String.equal (Caml_unix.getenv "TERM") "dumb" in
   let start = l#start#line in
   let start_column = l#start#offset `Byte in
   let stop = l#stop#line in
-- 
2.36.1