Skip to content

Commit

Permalink
Don't warn on newer compilers
Browse files Browse the repository at this point in the history
OCaml should be backward compatible so if the user has a newer compiler
we most likely don't need to warn.
  • Loading branch information
Leonidas-from-XIV committed Mar 8, 2022
1 parent e349676 commit f5317b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cli/pull.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ let check_dune_lang_version ~yes ~root =
Logs.debug (fun l -> l "No dune-project found");
Ok ())

let version_is_at_least locked_version =
let version_constraint = (`Geq, locked_version) in
let version_formula = OpamFormula.Atom version_constraint in
OpamFormula.check_version_formula version_formula

let run (`Yes yes) (`Root root) (`Lockfile explicit_lockfile)
(`Keep_git_dir keep_git_dir) (`Duniverse_repos duniverse_repos) () =
let open Result.O in
Expand All @@ -75,9 +80,7 @@ let run (`Yes yes) (`Root root) (`Lockfile explicit_lockfile)
OpamSwitchState.get_package switch_state Config.compiler_package_name
|> OpamPackage.version
in
(match
OpamPackage.Version.equal locked_ocaml_version switch_ocaml_version
with
(match version_is_at_least locked_ocaml_version switch_ocaml_version with
| true -> ()
| false ->
Logs.warn (fun l ->
Expand Down

0 comments on commit f5317b9

Please sign in to comment.