nixpkgs/pkgs/development/compilers/ligo/ligo.patch
Ulrik Strid aee04b1bed
ocamlPackages.git: 3.5.0 -> 3.9.1 (#188389)
* ocamlPackages.cstruct: 6.0.1 -> 6.1.1

* ocamlPackages.git: 3.5.0 -> 3.9.1

* ocamlPackages.carton: 0.4.3 -> 0.4.4

* ocamlPackages.bigstringaf: 0.7.0 -> 0.9.0

* ocamlPackages.decompress: 1.4.2 -> 1.5.1

* ocamlPackages.repr: 0.5.0 -> 0.6.0

* ocamlPackages.irmin: 2.9.1 -> 3.4.1

* ligo: 0.36.0 -> 0.47.0

ocamlPackages.ringo: 0.5 → 0.9
ocamlPackages.data-encoding: 0.4.0 → 0.5.3
ocamlPackages.bls12-381: 1.1.0 -> 3.0.0

Co-authored-by: bezmuth <benkel97@protonmail.com>
2022-10-11 08:50:54 +02:00

152 lines
4.8 KiB
Diff

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