Skip to content

Commit

Permalink
Merge pull request #8 from imandra-ai/simon/compat-4.12
Browse files Browse the repository at this point in the history
chore: compat with 4.12
  • Loading branch information
c-cube authored Jun 12, 2024
2 parents 2310990 + 29ef220 commit 75d2b74
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
#- macos-latest
#- windows-latest
ocaml-compiler:
- '4.13'
- '4.12'
- '5.2'

runs-on: ${{ matrix.os }}
Expand Down
6 changes: 3 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(synopsis "Core utils library for Imandra")
(depends
(ocaml
(>= 4.13))
(>= 4.12))
dune
(containers
(>= 3.4))
Expand Down Expand Up @@ -66,7 +66,7 @@
(synopsis "Logging utils for Imandra")
(depends
(ocaml
(>= 4.13))
(>= 4.12))
(imandrakit
(= :version))
hmap
Expand All @@ -83,7 +83,7 @@
(synopsis "IO utils for Imandra")
(depends
(ocaml
(>= 4.13))
(>= 4.12))
(imandrakit
(= :version))
(imandrakit-log
Expand Down
2 changes: 1 addition & 1 deletion imandrakit-io.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/imandra-ai/imandrakit"
bug-reports: "https://github.com/imandra-ai/imandrakit/issues"
depends: [
"dune" {>= "3.0"}
"ocaml" {>= "4.13"}
"ocaml" {>= "4.12"}
"imandrakit" {= version}
"imandrakit-log" {= version}
"moonpool" {>= "0.6"}
Expand Down
2 changes: 1 addition & 1 deletion imandrakit-log.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: "MIT"
homepage: "https://github.com/imandra-ai/imandrakit"
bug-reports: "https://github.com/imandra-ai/imandrakit/issues"
depends: [
"ocaml" {>= "4.13"}
"ocaml" {>= "4.12"}
"imandrakit" {= version}
"hmap"
"dune" {>= "3.0"}
Expand Down
2 changes: 1 addition & 1 deletion imandrakit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: ["moonpool" "multicore" "thread" "logs" "logging"]
homepage: "https://github.com/imandra-ai/imandrakit"
bug-reports: "https://github.com/imandra-ai/imandrakit/issues"
depends: [
"ocaml" {>= "4.13"}
"ocaml" {>= "4.12"}
"dune" {>= "3.0"}
"containers" {>= "3.4"}
"iter" {>= "1.0"}
Expand Down
8 changes: 8 additions & 0 deletions src/io/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
(public_name imandrakit-io)
(synopsis "Utils around IO/unix")
(libraries imandrakit imandrakit-log moonpool threads unix)
(private_modules realpath_)
(preprocess
(pps ppx_deriving.std))
(flags :standard -open Imandrakit))

(rule
(targets realpath_.ml)
(action
(with-stdout-to
%{targets}
(run ./gen/gen.exe))))
2 changes: 2 additions & 0 deletions src/io/gen/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(executable
(name gen))
14 changes: 14 additions & 0 deletions src/io/gen/gen.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let after_4_13 = {|
let realpath = Unix.realpath
|}

let before_4_13 = {|
let realpath x = x
|}

let () =
let major, min = Scanf.sscanf Sys.ocaml_version "%d.%d" (fun x y -> x, y) in
if (major, min) >= (4, 13) then
print_endline after_4_13
else
print_endline before_4_13
2 changes: 1 addition & 1 deletion src/io/imandrakit_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let make_absolute ?(in_dir = Sys.getcwd ()) file_name =
else
Filename.concat in_dir file_name
in
try Unix.realpath f
try Realpath_.realpath f
with Unix.Unix_error (Unix.ENOENT, _, _) -> normalize_in_mem_ f

let find_file ?(in_dir = Sys.getcwd ()) ~file_name ~load_path () :
Expand Down

0 comments on commit 75d2b74

Please sign in to comment.