@@ -5,6 +5,7 @@ let cache ~variant =
5
5
match Variant. os variant with
6
6
| `Freebsd
7
7
| `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" ]
8
9
| `Macos -> [ Obuilder_spec.Cache. v download_cache ~target: " /Users/mac1000/.opam/download-cache" ;
9
10
Obuilder_spec.Cache. v " homebrew" ~target: " /Users/mac1000/Library/Caches/Homebrew" ]
10
11
let network = [" host" ]
@@ -84,30 +85,35 @@ let setup_repository ?(local=false) ~variant ~for_docker ~opam_version () =
84
85
let open Obuilder_spec in
85
86
let home_dir = match Variant. os variant with
86
87
| `Macos -> None
88
+ | `Windows -> Some " /cygdrive/c/Users/opam"
87
89
| `Freebsd
88
90
| `Linux -> Some " /home/opam"
89
91
in
90
92
let prefix = match Variant. os variant with
91
93
| `Macos -> " ~/local"
92
94
| `Freebsd -> " /usr/local"
93
- | `Linux -> " /usr"
95
+ | `Windows | ` Linux -> " /usr"
94
96
in
95
97
let ln = match Variant. os variant with
96
- | `Macos -> " ln"
98
+ | `Windows | ` Macos -> " ln"
97
99
| `Freebsd | `Linux -> " sudo ln"
98
100
in
101
+ let dst = match Variant. os variant with
102
+ | `Windows -> " /Users/opam/opam-repository/"
103
+ | `Macos | `Freebsd | `Linux -> " opam-repository/"
104
+ in
99
105
let opam_version_str = Opam_version. to_string opam_version
100
106
in
101
107
let opam_repo_args = match Variant. os variant with
102
108
| `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 -> " "
104
110
in
105
111
let opamrc = match Variant. os variant with
106
112
(* NOTE: [for_docker] is required because docker does not support bubblewrap in docker build * )
107
113
(* docker run has --privileged but docker build does not have it *)
108
114
(* so we need to remove the part re-enabling the sandbox. *)
109
115
| `Linux when not for_docker -> " --config .opamrc-sandbox"
110
- | `Freebsd | `Macos | `Linux -> " "
116
+ | `Windows | ` Freebsd | `Macos | `Linux -> " "
111
117
(* TODO: On MacOS, the sandbox is always (and should be) enabled by default but does not have those ~/.opamrc-sandbox files *)
112
118
in
113
119
(* If we are testing a minimal opam-repository without
@@ -130,7 +136,7 @@ let setup_repository ?(local=false) ~variant ~for_docker ~opam_version () =
130
136
env " CI" " true" :: env " OPAM_REPO_CI" " true" :: (* Advertise CI for test frameworks *)
131
137
[
132
138
run " rm -rf opam-repository/" ;
133
- copy [" ." ] ~dst: " opam-repository/ " ;
139
+ copy [" ." ] ~dst ;
134
140
run " opam repository set-url%s --strict default opam-repository/" opam_repo_args;
135
141
run ~network " opam %s || true" (match opam_version with `V2_1 | `V2_2 | `V2_3 | `Dev -> " update --depexts" | `V2_0 -> " depext -u" );
136
142
] @
0 commit comments