@@ -471,32 +471,29 @@ let windows_msvc_opam2 ?win10_revision ?winget ?(labels = []) ~opam_hashes
471471 let winget_image, winget_setup =
472472 install_winget ?win10_revision ?winget version
473473 in
474+ let packages, vs_build_tools =
475+ ( Windows.Cygwin. msvc_packages,
476+ Windows. install_visual_studio_build_tools
477+ [
478+ " Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ;
479+ " Microsoft.VisualStudio.Component.Windows10SDK.18362" ;
480+ ] )
481+ in
474482 let opams_image =
475483 Windows. header ~alias: " opam-builder" ?win10_revision ~version ()
476484 @@ Windows. sanitize_reg_path ()
477- @@ Windows.Cygwin. (
478- install_cygwin
479- ~extra:
480- (" git" :: " patch" :: " mingw64-x86_64-gcc-g++"
481- :: " mingw64-i686-gcc-g++" :: mingw_packages)
482- () )
485+ @@ vs_build_tools
486+ @@ Windows.Cygwin. install_cygwin ~extra: packages ()
483487 @@ install_opams_windows opam_master_hash opam_branches
484488 in
485489 (* 2022-10-12: Docker Engine 20.10.18 on Windows fails copying
486490 C:\cygwin64, so we cannot build Cygwin in a separate image. *)
487491 let ocaml_for_windows =
488- let packages, vs_build_tools =
489- ( Windows.Cygwin. msvc_packages,
490- Windows. install_visual_studio_build_tools
491- [
492- " Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ;
493- " Microsoft.VisualStudio.Component.Windows10SDK.18362" ;
494- ] )
495- in
496492 let ofw_packages, ofw_setup = Windows.Cygwin. install_ocaml_for_windows () in
497- Windows.Cygwin. install_cygwin ~msvs_tools: true
498- ~extra: (packages @ ofw_packages) ()
499- @@ vs_build_tools @@ ofw_setup
493+ vs_build_tools
494+ @@ Windows.Cygwin. install_cygwin ~msvs_tools: true
495+ ~extra: (packages @ ofw_packages) ()
496+ @@ ofw_setup
500497 in
501498 parser_directive (`Escape '`' )
502499 @@ comment " Autogenerated by OCaml-Dockerfile scripts"
@@ -505,7 +502,7 @@ let windows_msvc_opam2 ?win10_revision ?winget ?(labels = []) ~opam_hashes
505502 @@ label ((" distro_style" , " windows" ) :: labels)
506503 @@ user " ContainerAdministrator"
507504 @@ Windows. sanitize_reg_path ()
508- @@ winget_setup @@ ocaml_for_windows
505+ @@ ocaml_for_windows @@ winget_setup
509506 @@ copy_opams_windows opam_branches
510507 @@ Windows.Cygwin. setup () @@ Windows.Cygwin.Git. init ()
511508
0 commit comments