diff --git a/doc/doc.ml b/doc/doc.ml index 4bda1293..6e9c8d01 100644 --- a/doc/doc.ml +++ b/doc/doc.ml @@ -1,5 +1,7 @@ open Opam_repo_ci +module Opam_version = Opam_ci_check.Opam_version +module Variant = Opam_ci_check.Variant module Git = Current_git type platform = { diff --git a/lib/build.ml b/lib/build.ml index aece828d..567a9fa7 100644 --- a/lib/build.ml +++ b/lib/build.ml @@ -2,6 +2,9 @@ open Current.Syntax module Docker = Current_docker.Default module Distro = Dockerfile_opam.Distro +module Opam_version = Opam_ci_check.Opam_version +module Variant = Opam_ci_check.Variant +module Spec = Opam_ci_check.Spec let master_distro = (Distro.resolve_alias Distro.master_distro :> Distro.t) let default_compilers_full = Ocaml_version.Releases.[ v4_14; Ocaml_version.Releases.latest ] (* NOTE: Should probably stay with list length 2 *) @@ -192,7 +195,7 @@ let get_base ~arch variant = Docker.peek ~schedule:weekly ~arch:(Ocaml_version.to_docker_arch arch) ("ocaml/opam:" ^ Variant.docker_tag variant) in - Spec.Docker (Current_docker.Raw.Image.of_hash repo_id) + Spec.Docker repo_id let build (module Builder : Build_intf.S) ~analysis ~pkgopts ~master ~source ~opam_version ~lower_bounds ~revdeps label variant = let arch = Variant.arch variant in diff --git a/lib/build.mli b/lib/build.mli index c3efcf77..4e518bd0 100644 --- a/lib/build.mli +++ b/lib/build.mli @@ -6,7 +6,7 @@ val compilers : lower_bounds:bool -> revdeps:bool -> string -> - Variant.t -> + Opam_ci_check.Variant.t -> 'a) -> unit -> 'a list @@ -18,7 +18,7 @@ val linux_distributions : lower_bounds:bool -> revdeps:bool -> string -> - Variant.t -> + Opam_ci_check.Variant.t -> 'a) -> 'a list @@ -28,7 +28,7 @@ val macos : lower_bounds:bool -> revdeps:bool -> string -> - Variant.t -> + Opam_ci_check.Variant.t -> 'a) -> 'a list @@ -38,17 +38,17 @@ val freebsd : lower_bounds:bool -> revdeps:bool -> string -> - Variant.t -> + Opam_ci_check.Variant.t -> 'a) -> 'a list val extras : build: - (opam_version:Opam_version.t -> + (opam_version:Opam_ci_check.Opam_version.t -> lower_bounds:bool -> revdeps:bool -> string -> - Variant.t -> + Opam_ci_check.Variant.t -> 'a) -> 'a list diff --git a/lib/build_intf.ml b/lib/build_intf.ml index efa239ab..563715eb 100644 --- a/lib/build_intf.ml +++ b/lib/build_intf.ml @@ -6,8 +6,8 @@ module type S = sig whether high- and low-priority jobs are set as urgent. *) val v : label:string -> - spec:Spec.t Current.t -> - base:Spec.base Current.t -> + spec:Opam_ci_check.Spec.t Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> urgent:([`High | `Low] -> bool) option Current.t -> Current_git.Commit_id.t Current.t -> @@ -20,11 +20,11 @@ module type S = sig The spec is generated on top of [base], and the OCurrent job is run after the job specified by [after], making it a dependency. *) val list_revdeps : - variant:Variant.t -> - opam_version:Opam_version.t -> + variant:Opam_ci_check.Variant.t -> + opam_version:Opam_ci_check.Opam_version.t -> pkgopt:Package_opt.t Current.t -> new_pkgs:OpamPackage.t list Current.t -> - base:Spec.base Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> after:unit Current.t -> Current_git.Commit_id.t Current.t -> diff --git a/lib/cluster_build.ml b/lib/cluster_build.ml index 5b7d52d8..f151c581 100644 --- a/lib/cluster_build.ml +++ b/lib/cluster_build.ml @@ -2,6 +2,9 @@ open Current.Syntax open Capnp_rpc_lwt open Lwt.Infix +module Variant = Opam_ci_check.Variant +module Spec = Opam_ci_check.Spec +module Opam_build = Opam_ci_check.Opam_build module Git = Current_git let ( >>!= ) = Lwt_result.bind diff --git a/lib/cluster_build.mli b/lib/cluster_build.mli index 937bdc8a..d5cc8ce1 100644 --- a/lib/cluster_build.mli +++ b/lib/cluster_build.mli @@ -14,8 +14,8 @@ val config : val v : t -> label:string -> - spec:Spec.t Current.t -> - base:Spec.base Current.t -> + spec:Opam_ci_check.Spec.t Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> urgent:([`High | `Low] -> bool) option Current.t -> Current_git.Commit_id.t Current.t -> @@ -29,11 +29,11 @@ val v : the job specified by [after], making it a dependency. *) val list_revdeps : t -> - variant:Variant.t -> - opam_version:Opam_version.t -> + variant:Opam_ci_check.Variant.t -> + opam_version:Opam_ci_check.Opam_version.t -> pkgopt:Package_opt.t Current.t -> new_pkgs:OpamPackage.t list Current.t -> - base:Spec.base Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> after:unit Current.t -> Current_git.Commit_id.t Current.t -> diff --git a/lib/dune b/lib/dune index d4efe65c..03f17d12 100644 --- a/lib/dune +++ b/lib/dune @@ -20,4 +20,5 @@ obuilder-spec opam-format opam-state - opam-repo-ci-api)) + opam-repo-ci-api + opam_ci_check)) diff --git a/lib/local_build.ml b/lib/local_build.ml index 2a7c1d7c..22ac5de5 100644 --- a/lib/local_build.ml +++ b/lib/local_build.ml @@ -1,6 +1,9 @@ open Current.Syntax open Lwt.Infix +module Spec = Opam_ci_check.Spec +module Variant = Opam_ci_check.Variant +module Opam_build = Opam_ci_check.Opam_build module Git = Current_git module Raw = Current_docker.Raw @@ -158,7 +161,7 @@ module Op = struct ~os (Opam_build.build_spec ~base ~local:true ~for_docker:true build_config) in Current.Job.write job - (Fmt.str "@[Base: %a@,%a@]@." Raw.Image.pp image Spec.pp_summary ty); + (Fmt.str "@[Base: %s@,%a@]@." image Spec.pp_summary ty); Current.Job.write job (Fmt.str "@.To reproduce locally:@.@.cd $(mktemp -d)@.%a@.cat > Dockerfile \ diff --git a/lib/local_build.mli b/lib/local_build.mli index d86f6743..8e00bd40 100644 --- a/lib/local_build.mli +++ b/lib/local_build.mli @@ -5,8 +5,8 @@ to conform with the interface for [Cluster_build]. *) val v : label:string -> - spec:Spec.t Current.t -> - base:Spec.base Current.t -> + spec:Opam_ci_check.Spec.t Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> urgent:([ `High | `Low ] -> bool) option Current.t -> Current_git.Commit_id.t Current.t -> unit Current.t @@ -19,11 +19,11 @@ val v : The spec is generated on top of [base], and the OCurrent job is run after the job specified by [after], making it a dependency. *) val list_revdeps : - variant:Variant.t -> - opam_version:Opam_version.t -> + variant:Opam_ci_check.Variant.t -> + opam_version:Opam_ci_check.Opam_version.t -> pkgopt:Package_opt.t Current.t -> new_pkgs:OpamPackage.t list Current.t -> - base:Spec.base Current.t -> + base:Opam_ci_check.Spec.base Current.t -> master:Current_git.Commit.t Current.t -> after:unit Current.t -> Current_git.Commit_id.t Current.t -> OpamPackage.Set.t Current.t diff --git a/opam-ci-check.opam b/opam-ci-check.opam index b0b22f0c..c9389e44 100644 --- a/opam-ci-check.opam +++ b/opam-ci-check.opam @@ -23,7 +23,11 @@ depends: [ "sexplib" "cmdliner" {>= "1.1.1"} "opam-client" {>= "2.3.0~alpha1"} + "ocaml-version" {>= "3.6.9"} + "obuilder-spec" "odoc" {with-doc} + "ppx_deriving" {>= "5.2.1"} + "ppx_deriving_yojson" ] build: [ ["dune" "subst"] {dev} diff --git a/opam-ci-check/lib/dune b/opam-ci-check/lib/dune index 38873286..3cdd03af 100644 --- a/opam-ci-check/lib/dune +++ b/opam-ci-check/lib/dune @@ -1,4 +1,11 @@ (library (name opam_ci_check) (public_name opam-ci-check) - (libraries opam-client sexplib str)) + (preprocess + (pps ppx_deriving.std ppx_deriving_yojson)) + (libraries + opam-client + sexplib + str + ocaml-version + obuilder-spec)) diff --git a/lib/opam_build.ml b/opam-ci-check/lib/opam_build.ml similarity index 100% rename from lib/opam_build.ml rename to opam-ci-check/lib/opam_build.ml diff --git a/lib/opam_build.mli b/opam-ci-check/lib/opam_build.mli similarity index 100% rename from lib/opam_build.mli rename to opam-ci-check/lib/opam_build.mli diff --git a/opam-ci-check/lib/opam_ci_check.ml b/opam-ci-check/lib/opam_ci_check.ml index ae31d9a4..a0fa2697 100644 --- a/opam-ci-check/lib/opam_ci_check.ml +++ b/opam-ci-check/lib/opam_ci_check.ml @@ -5,3 +5,7 @@ module Revdeps = Revdeps module Test = Test module Lint = Lint +module Opam_build = Opam_build +module Variant = Variant +module Opam_version = Opam_version +module Spec = Spec diff --git a/lib/opam_version.ml b/opam-ci-check/lib/opam_version.ml similarity index 100% rename from lib/opam_version.ml rename to opam-ci-check/lib/opam_version.ml diff --git a/lib/opam_version.mli b/opam-ci-check/lib/opam_version.mli similarity index 100% rename from lib/opam_version.mli rename to opam-ci-check/lib/opam_version.mli diff --git a/lib/spec.ml b/opam-ci-check/lib/spec.ml similarity index 94% rename from lib/spec.ml rename to opam-ci-check/lib/spec.ml index fd606349..5cf39dba 100644 --- a/lib/spec.ml +++ b/opam-ci-check/lib/spec.ml @@ -1,11 +1,11 @@ (* TODO: Make macOS use docker images *) type base = - | Docker of Current_docker.Raw.Image.t + | Docker of string | Macos of string | Freebsd of string let base_to_string = function - | Docker img -> Current_docker.Raw.Image.hash img + | Docker img -> img | Macos base -> base | Freebsd base -> base diff --git a/lib/spec.mli b/opam-ci-check/lib/spec.mli similarity index 97% rename from lib/spec.mli rename to opam-ci-check/lib/spec.mli index 2d64c020..75e18020 100644 --- a/lib/spec.mli +++ b/opam-ci-check/lib/spec.mli @@ -4,7 +4,7 @@ MacOS and FreeBSD do not yet have Docker images and start from custom base images stored in the workers. *) type base = - | Docker of Current_docker.Raw.Image.t + | Docker of string | Macos of string | Freebsd of string diff --git a/lib/variant.ml b/opam-ci-check/lib/variant.ml similarity index 100% rename from lib/variant.ml rename to opam-ci-check/lib/variant.ml diff --git a/lib/variant.mli b/opam-ci-check/lib/variant.mli similarity index 100% rename from lib/variant.mli rename to opam-ci-check/lib/variant.mli diff --git a/test/dune b/test/dune index 3ef03124..920e784d 100644 --- a/test/dune +++ b/test/dune @@ -1,7 +1,12 @@ (test (name test) (package opam-repo-ci-service) - (libraries opam_repo_ci alcotest alcotest-lwt ppx_deriving_yojson.runtime) + (libraries + opam_ci_check + opam_repo_ci + alcotest + alcotest-lwt + ppx_deriving_yojson.runtime) (preprocess (pps ppx_deriving.eq ppx_deriving_yojson)) (deps diff --git a/test/test.ml b/test/test.ml index 6b1287d0..599142fe 100644 --- a/test/test.ml +++ b/test/test.ml @@ -1,7 +1,9 @@ - - open Opam_repo_ci +module Spec = Opam_ci_check.Spec +module Opam_version = Opam_ci_check.Opam_version +module Variant = Opam_ci_check.Variant +module Opam_build = Opam_ci_check.Opam_build module Git = Current_git let specs =