Disable various parts of -thread handling for 5.x #76
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.
Implements a fix for an issue reported in Discuss.
The original example, given
a.ml
:is that this command (despite being incorrect) works in 3.x/4.x:
but in 5.x:
This command isn't directly fixable, as the fix to ensure that
threads.cmxa
is linked from/home/dra/.opam/fix-threads-5.1.1/lib/ocaml/threads/threads.cmxa
will then result in double-linking.However, if we consider the correct invocation, which for
ocamlfind
should always involve-thread
to set ocamlfind's machinery into the correct mode:In 5.x, this is linking without warning, but the invocation is incorrect as it's relying on the deprecated in ocamlopt
-thread
option and effectively ignoring theMETA
file for threads shipped with OCaml 5.With this PR, that then becomes:
and we can see the correct set of predicates, combined with standard
-I
and.cmxa
parameters for packages. The command works with or without the-thread
argument toocamlfind
, the flag now controls whether themt
andmt_posix
predicates are true. My recollection when preparing ocaml/ocaml#11007 was that themt
andmt_posix
predicates were not used outside of findlib itself (i.e. that there are not (m)any third-party META files which uses these two predciates)