Skip to content

Commit 8dfd66b

Browse files
committed
Split MSVC and Cygwin install into a separate build step
1 parent b956fa5 commit 8dfd66b

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src-opam/opam.ml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -480,38 +480,37 @@ let windows_msvc_opam2 ?win10_revision ?winget ?(labels = []) ~opam_hashes
480480
let winget_image, winget_setup =
481481
install_winget ?win10_revision ?winget version
482482
in
483-
let packages, vs_build_tools =
484-
( Windows.Cygwin.msvc_packages,
485-
Windows.install_visual_studio_build_tools
486-
[
487-
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64";
488-
(* Without 18362, rc.exe is missing from the Path. *)
489-
"Microsoft.VisualStudio.Component.Windows10SDK.18362";
490-
] )
491-
in
492-
let opams_image =
493-
Windows.header ~alias:"opam-builder" ?win10_revision ~version ()
483+
let cygwin_msvc_image =
484+
let packages, vs_build_tools =
485+
( Windows.Cygwin.msvc_packages,
486+
Windows.install_visual_studio_build_tools
487+
[
488+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64";
489+
(* Without 18362, rc.exe is missing from the Path. *)
490+
"Microsoft.VisualStudio.Component.Windows10SDK.18362";
491+
] )
492+
in
493+
Windows.header ~alias:"cygwin-msvc" ?win10_revision ~version ()
494494
@@ Windows.sanitize_reg_path ()
495495
@@ vs_build_tools
496496
@@ Windows.Cygwin.install_cygwin ~msvs_tools:true ~extra:packages ()
497+
in
498+
let opams_image =
499+
Dockerfile.from ~alias:"opam-builder" "cygwin-msvc"
497500
@@ install_opams_windows ~msvs:true opam_master_hash opam_branches
498501
in
499502
(* 2022-10-12: Docker Engine 20.10.18 on Windows fails copying
500503
C:\cygwin64, so we cannot build Cygwin in a separate image. *)
501504
let ocaml_for_windows =
502-
let ofw_packages, ofw_setup = Windows.Cygwin.install_ocaml_for_windows () in
503-
vs_build_tools
504-
@@ Windows.Cygwin.install_cygwin ~msvs_tools:true
505-
~extra:(packages @ ofw_packages) ()
506-
@@ ofw_setup
505+
let packages, setup = Windows.Cygwin.install_ocaml_for_windows () in
506+
Windows.Cygwin.install packages @@ setup
507507
in
508508
parser_directive (`Escape '`')
509509
@@ comment "Autogenerated by OCaml-Dockerfile scripts"
510-
@@ winget_image @@ opams_image
511-
@@ header ?win10_revision ?arch distro
510+
@@ winget_image @@ cygwin_msvc_image @@ opams_image
511+
@@ Dockerfile.from "cygwin-msvc"
512512
@@ label (("distro_style", "windows") :: labels)
513513
@@ user "ContainerAdministrator"
514-
@@ Windows.sanitize_reg_path ()
515514
@@ ocaml_for_windows @@ winget_setup
516515
@@ copy_opams_windows opam_branches
517516
@@ Windows.Cygwin.setup () @@ Windows.Cygwin.Git.init ()

0 commit comments

Comments
 (0)