Add --with-private-runtime for mingw builds #3255
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes minor changes to
src/jbuild
andsrc/core/jbuild
which I noticed as part of this PR, but they're not related.The addition of the internal solver means that opam when compiled with the mingw version of OCaml needs runtime DLLs which are by default not available. The commit message for 1aeb5e7 expands on the detail of this, so I won't repeat it here.
Convincing Dune to feed a custom object file to ocamlopt requires a slightly bizarre contortion - it's accomplished by adding an empty generated module called
OpamManifest
to the binary which itself depends on the manifest object. This is added on all platforms, but it's empty and is only part of the binary, not part of the opam-client library. It would be possible to eliminate that if at some point Dune permits arbitrary dependencies for theexecutable
stanza.The manifest XML fragments look unnecessarily complicated, however they only change if Microsoft introduce a new version of Windows (very unlikely, since Windows 10 has been declared to be the "last" version) or the runtime DLLs for either of the architectures change name (which can happen, but not frequently). The detection logic for them may improve in the future... it's possible to use either
cygcheck
ordumpbin
to determine the exact names required, but this already took enough time 🙂I also tweaked AppVeyor to demonstrate that the build doesn't work by default (see this AppVeyor log) and then tweak AppVeyor to configure the two mingw builds to use this new flag.
Reasons for choice of the parameter name (FWIW):
with
rather thanenable
because a third party library really is being pulled in here, rather than a switch being turned on (cf. `--enable-developer-mode)