@@ -431,22 +431,24 @@ let windows_mingw_opam2 ?win10_revision ?winget ?(labels = []) ?arch
431431 install_winget ?win10_revision ?winget version
432432 in
433433 let opams_image =
434+ let packages =
435+ (* dra27: we only need g++ in the "builder" image so that
436+ opam-putenv gets built properly and so that opam is built
437+ with the internal solver as well *)
438+ " mingw64-x86_64-gcc-g++" :: " mingw64-i686-gcc-g++"
439+ :: Windows.Cygwin. mingw_packages
440+ in
434441 Windows. header ~alias: " opam-builder" ?win10_revision ~version ()
435442 @@ Windows. sanitize_reg_path ()
436- @@ Windows.Cygwin. (
437- install_cygwin
438- ~extra:
439- (" git" :: " patch" :: " mingw64-x86_64-gcc-g++"
440- :: " mingw64-i686-gcc-g++" :: mingw_packages)
441- () )
443+ @@ Windows.Cygwin. install_cygwin ~extra: packages ()
442444 @@ install_opams_windows opam_master_hash opam_branches
443445 in
444446 (* 2022-10-12: Docker Engine 20.10.18 on Windows fails copying
445447 C:\cygwin64, so we cannot build Cygwin in a separate image. *)
446448 let ocaml_for_windows =
447- let extra = Windows.Cygwin. mingw_packages in
448- let extra, pkgs = Windows.Cygwin. ocaml_for_windows_packages ~extra () in
449- Windows.Cygwin. install_cygwin ~msvs_tools: true ~extra () @@ pkgs
449+ let packages, setup = Windows.Cygwin. install_ocaml_for_windows () in
450+ let packages = Windows.Cygwin. mingw_packages @ packages in
451+ Windows.Cygwin. install_cygwin ~extra: packages () @@ setup
450452 in
451453 parser_directive (`Escape '`' )
452454 @@ comment " Autogenerated by OCaml-Dockerfile scripts"
@@ -483,17 +485,18 @@ let windows_msvc_opam2 ?win10_revision ?winget ?(labels = []) ~opam_hashes
483485 (* 2022-10-12: Docker Engine 20.10.18 on Windows fails copying
484486 C:\cygwin64, so we cannot build Cygwin in a separate image. *)
485487 let ocaml_for_windows =
486- let extra , vs_build_tools =
488+ let packages , vs_build_tools =
487489 ( Windows.Cygwin. msvc_packages,
488490 Windows. install_visual_studio_build_tools
489491 [
490492 " Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ;
491493 " Microsoft.VisualStudio.Component.Windows10SDK.18362" ;
492494 ] )
493495 in
494- let extra, pkgs = Windows.Cygwin. ocaml_for_windows_packages ~extra () in
495- Windows.Cygwin. install_cygwin ~msvs_tools: true ~extra ()
496- @@ vs_build_tools @@ pkgs
496+ 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
497500 in
498501 parser_directive (`Escape '`' )
499502 @@ comment " Autogenerated by OCaml-Dockerfile scripts"
0 commit comments