@@ -5,6 +5,7 @@ let cache ~variant =
55 match Variant. os variant with
66 | `Freebsd
77 | `Linux -> [ Obuilder_spec.Cache. v download_cache ~target: " /home/opam/.opam/download-cache" ]
8+ | `Windows -> [ Obuilder_spec.Cache. v download_cache ~target: " c:\\ Users\\ opam\\ AppData\\ local\\ opam\\ download-cache" ]
89 | `Macos -> [ Obuilder_spec.Cache. v download_cache ~target: " /Users/mac1000/.opam/download-cache" ;
910 Obuilder_spec.Cache. v " homebrew" ~target: " /Users/mac1000/Library/Caches/Homebrew" ]
1011let network = [" host" ]
@@ -84,30 +85,35 @@ let setup_repository ?(local=false) ~variant ~for_docker ~opam_version () =
8485 let open Obuilder_spec in
8586 let home_dir = match Variant. os variant with
8687 | `Macos -> None
88+ | `Windows -> Some " /cygdrive/c/Users/opam"
8789 | `Freebsd
8890 | `Linux -> Some " /home/opam"
8991 in
9092 let prefix = match Variant. os variant with
9193 | `Macos -> " ~/local"
9294 | `Freebsd -> " /usr/local"
93- | `Linux -> " /usr"
95+ | `Windows | ` Linux -> " /usr"
9496 in
9597 let ln = match Variant. os variant with
96- | `Macos -> " ln"
98+ | `Windows | ` Macos -> " ln"
9799 | `Freebsd | `Linux -> " sudo ln"
98100 in
101+ let dst = match Variant. os variant with
102+ | `Windows -> " /Users/opam/opam-repository/"
103+ | `Macos | `Freebsd | `Linux -> " opam-repository/"
104+ in
99105 let opam_version_str = Opam_version. to_string opam_version
100106 in
101107 let opam_repo_args = match Variant. os variant with
102108 | `Macos -> " -k local" (* TODO: (copy ...) do not copy the content of .git or something like that and make the subsequent opam pin fail *)
103- | `Freebsd | `Linux -> " "
109+ | `Windows | ` Freebsd | `Linux -> " "
104110 in
105111 let opamrc = match Variant. os variant with
106112 (* NOTE: [for_docker] is required because docker does not support bubblewrap in docker build * )
107113 (* docker run has --privileged but docker build does not have it *)
108114 (* so we need to remove the part re-enabling the sandbox. *)
109115 | `Linux when not for_docker -> " --config .opamrc-sandbox"
110- | `Freebsd | `Macos | `Linux -> " "
116+ | `Windows | ` Freebsd | `Macos | `Linux -> " "
111117 (* TODO: On MacOS, the sandbox is always (and should be) enabled by default but does not have those ~/.opamrc-sandbox files *)
112118 in
113119 (* If we are testing a minimal opam-repository without
@@ -130,7 +136,7 @@ let setup_repository ?(local=false) ~variant ~for_docker ~opam_version () =
130136 env " CI" " true" :: env " OPAM_REPO_CI" " true" :: (* Advertise CI for test frameworks *)
131137 [
132138 run " rm -rf opam-repository/" ;
133- copy [" ." ] ~dst: " opam-repository/ " ;
139+ copy [" ." ] ~dst ;
134140 run " opam repository set-url%s --strict default opam-repository/" opam_repo_args;
135141 run ~network " opam %s || true" (match opam_version with `V2_1 | `V2_2 | `V2_3 | `Dev -> " update --depexts" | `V2_0 -> " depext -u" );
136142 ] @
0 commit comments