Skip to content

Commit

Permalink
Merge pull request ocaml#4760 from kit-ty-kate/dose-7
Browse files Browse the repository at this point in the history
Update to dose >= 6.1
  • Loading branch information
dra27 authored Jul 28, 2021
2 parents 775eb71 + 60d3a55 commit 59eb601
Show file tree
Hide file tree
Showing 42 changed files with 211 additions and 495 deletions.
1 change: 0 additions & 1 deletion .github/scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ unset-dev-version () {
touch src/client/no-git-version
}

export OPAMYES=1
export OCAMLRUNPARAM=b

( # Run subshell in bootstrap root env to build
Expand Down
8 changes: 5 additions & 3 deletions .github/scripts/preamble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ OPAMBSROOT=`eval echo $OPAMBSROOT`

OPAMBSSWITCH=opam-build

export OPAMCONFIRMLEVEL=unsafe-yes

case $GITHUB_EVENT_NAME in
pull_request)
BRANCH=$GITHUB_HEAD_REF
Expand All @@ -38,21 +40,21 @@ init-bootstrap () {
set -e
export OPAMROOT=$OPAMBSROOT
# The system compiler will be picked up
opam init --yes --no-setup git+https://github.com/ocaml/opam-repository#$OPAM_REPO_SHA
opam init --no-setup git+https://github.com/ocaml/opam-repository#$OPAM_REPO_SHA
eval $(opam env)
# opam update
CURRENT_SWITCH=$(opam var switch)
if [[ $CURRENT_SWITCH != "default" ]] ; then
opam switch default
eval $(opam env)
opam switch remove $CURRENT_SWITCH --yes
opam switch remove $CURRENT_SWITCH
fi

opam switch create $OPAMBSSWITCH ocaml-system
eval $(opam env)
# extlib is installed, since UChar.cmi causes problems with the search
# order. See also the removal of uChar and uTF8 in src_ext/jbuild-extlib-src
opam install . --deps-only --yes
opam install . --deps-only

rm -f "$OPAMBSROOT"/log/*
fi
Expand Down
2 changes: 0 additions & 2 deletions .github/scripts/solvers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

. .github/scripts/preamble.sh

export OPAMYES=1
export OPAMCONFIRMLEVEL=unsafe-yes
export OCAMLRUNPARAM=b

# All environment variable are overwritten in job description
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Builds, tests & co
on: [ push, pull_request ]

env:
OPAMBSVERSION: 2.1.0-beta4
OPAMBSVERSION: 2.1.0
OPAMBSROOT: ~/.cache/.opam.cached
OPAM12CACHE: ~/.cache/opam1.2/cache
# This should be identical to the value in appveyor.yml
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ src_ext/cmdliner/
src_ext/extlib/
src_ext/mccs/
src_ext/re/
src_ext/base64/
src_ext/ocamlgraph/
src_ext/dune-local/
src_ext/result/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ libraries, rather than use `make lib-ext` which would cause conflicts. It's
easier to already have a working opam installation in this case, so you can do
it as a second step.

* Make sure to have ocamlfind, ocamlgraph, cmdliner >= 0.9.8, cudf >= 0.7,
dose3 >= 5, re >= 1.5.0, opam-file-format installed. Or run `opam install
* Make sure to have ocamlfind, ocamlgraph, cmdliner >= 1.0.0, cudf >= 0.7,
dose3 >= 6.1, re >= 1.9.0, opam-file-format installed. Or run `opam install
. --deps-only` if you already have a working instance. Re-run
`./configure` once done
* Run `make libinstall` at the end
Expand Down
6 changes: 3 additions & 3 deletions admin-scripts/cudf-debug.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ let rebuild_version_map univ =
let _ =
match Cudf_parser.load_from_file Sys.argv.(1) with
| Some preamble, univ, Some req ->
begin match Algo.Depsolver.check_request ~explain:true (preamble, univ, req) with
| Algo.Depsolver.Unsat (Some f) ->
begin match Dose_algo.Depsolver.check_request ~explain:true (preamble, univ, req) with
| Dose_algo.Depsolver.Unsat (Some f) ->
OpamConsole.msg "== DOSE MESSAGE ==\n";
flush stdout;
Algo.Diagnostic.fprintf_human
Dose_algo.Diagnostic.fprintf_human
~pp:cudf_pp
Format.err_formatter
f;
Expand Down
9 changes: 5 additions & 4 deletions appveyor_build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ goto :EOF

:CheckPackage
"%CYG_ROOT%\bin\bash.exe" -lc "cygcheck -dc %1" | findstr %1 > nul
if %ERRORLEVEL% equ 1 (
echo Cygwin package %1 will be installed
set CYGWIN_INSTALL_PACKAGES=%CYGWIN_INSTALL_PACKAGES%,%1
)
if %ERRORLEVEL% equ 0 goto :EOF
set PKG=%1
if "%PKG%" equ "flexdll" set PKG=flexdll=0.39-1
echo Cygwin package %PKG% will be installed
set CYGWIN_INSTALL_PACKAGES=%CYGWIN_INSTALL_PACKAGES%,%PKG%
goto :EOF

:UpgradeCygwin
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Prefixes used to help generate release notes, changes, and blog posts:

## Build
* Bump src_exts and fix build compat with Dune 2.9.0 [#4752 @dra27]
* Upgrade to dose3 >= 6.1 and vendor dose3 7.0.0 [#4760 @kit-ty-kate]

## Infrastructure
*
Expand Down
6 changes: 5 additions & 1 deletion opam-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ depends: [
"ocaml" {>= "4.02.3"}
"opam-state" {= version}
"opam-solver" {= version}
"extlib" {>= "1.7.3" & < "1.7.8"}
"base64" {>= "3.1.0"}
"opam-repository" {= version}
"re" {>= "1.9.0"}
"cmdliner" {>= "1.0.0"}
"dune" {>= "1.11.0"}
]
conflicts: [
"extlib" {< "1.7.8"}
"extlib-compat"
]
2 changes: 1 addition & 1 deletion opam-solver.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ depends: [
"ocaml" {>= "4.02.3"}
"opam-format" {= version}
"mccs" {>= "1.1+9"}
"dose3" {>= "5" & < "6.0"}
"dose3" {>= "6.1"}
"cudf" {>= "0.7"}
"re" {>= "1.9.0"}
"dune" {>= "1.11.0"}
Expand Down
2 changes: 1 addition & 1 deletion src/client/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name opam-client)
(synopsis "OCaml Package Manager client and CLI library")
(modules (:standard \ opamMain get_git_version))
(libraries opam-state opam-solver opam-repository re extlib cmdliner)
(libraries opam-state opam-solver opam-repository re base64 cmdliner)
(flags (:standard
(:include ../ocaml-flags-standard.sexp)
(:include ../ocaml-flags-configure.sexp)
Expand Down
6 changes: 3 additions & 3 deletions src/client/opamAdminCheck.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ let cycle_check univ =
in
(* conflicts break cycles *)
let conflicts =
Algo.Defaultgraphs.PackageGraph.conflict_graph cudf_univ
Dose_algo.Defaultgraphs.PackageGraph.conflict_graph cudf_univ
in
let module CGraph = Algo.Defaultgraphs.PackageGraph.UG in
let module CGraph = Dose_algo.Defaultgraphs.PackageGraph.UG in
CGraph.iter_edges (fun nv1 nv2 ->
OpamCudf.Graph.remove_edge graph nv1 nv2;
OpamCudf.Graph.remove_edge graph nv2 nv1)
Expand All @@ -127,7 +127,7 @@ let cycle_check univ =
let univ = Cudf.load_universe pkgs in
let g = OpamCudf.Graph.of_universe univ in
let conflicts =
Algo.Defaultgraphs.PackageGraph.conflict_graph univ
Dose_algo.Defaultgraphs.PackageGraph.conflict_graph univ
in
(* Simplify the graph by merging all equivalent versions of each
package *)
Expand Down
2 changes: 1 addition & 1 deletion src/client/opamSwitchCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ let import_t ?ask importfile t =
OpamPath.Switch.extra_files_dir t.switch_global.root t.switch
in
OpamHash.Map.iter (fun hash content ->
let value = Base64.decode_string content in
let value = Base64.decode_exn content in
let my = OpamHash.compute_from_string ~kind:(OpamHash.kind hash) value in
if OpamHash.contents my = OpamHash.contents hash then
let dst =
Expand Down
2 changes: 1 addition & 1 deletion src/solver/opamBuiltin0install.ml.real
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ let call ~criteria ?timeout:_ (preamble, universe, request) =
| Error problem ->
log "No solution. Solve took %.2f s" (timer ());
log ~level:3 "%a" (OpamConsole.slog Opam_0install_cudf.diagnostics) problem;
raise Common.CudfSolver.Unsat
raise Dose_common.CudfSolver.Unsat
2 changes: 1 addition & 1 deletion src/solver/opamBuiltinMccs.ml.real
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let call solver_backend ext ~criteria ?timeout cudf =
~verbose:OpamCoreConfig.(abs !r.debug_level >= 2)
?timeout criteria cudf
with
| None -> raise Common.CudfSolver.Unsat
| None -> raise Dose_common.CudfSolver.Unsat
| Some (preamble, univ) -> Some preamble, univ
| exception Mccs.Timeout -> raise (Timeout None)

Expand Down
4 changes: 2 additions & 2 deletions src/solver/opamBuiltinZ3.ml.real
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ let call ~criteria ?timeout (preamble, universe, _ as cudf) =
match Z3.Optimize.check opt with
| UNSATISFIABLE ->
log "UNSAT";
raise Common.CudfSolver.Unsat
raise Dose_common.CudfSolver.Unsat
| UNKNOWN ->
log "UNKNOWN";
(try
Expand All @@ -433,7 +433,7 @@ let call ~criteria ?timeout (preamble, universe, _ as cudf) =
in
Some preamble, universe
(* with
* | (Timeout | Common.CudfSolver.Unsat | Failure _) as e -> raise e
* | (Timeout | Dose_common.CudfSolver.Unsat | Failure _) as e -> raise e
* | e ->
* OpamConsole.error "Z3 error: %s" (Printexc.to_string e);
* OpamConsole.errmsg "%s" (Printexc.get_backtrace ());
Expand Down
Loading

0 comments on commit 59eb601

Please sign in to comment.