Fix incorrect uses of libunix in the testsuite#12844
Merged
dra27 merged 2 commits intoocaml:trunkfrom Dec 19, 2023
Merged
Conversation
This appears to have been a copy+paste issue in the ocaml-multicore history. These tests don't use the Unix library, which disables them for the minimal build but, more importantly, also on Windows.
It's a bit of a wart, but hasunix tests that the Unix library is enabled, libunix tests the Unix library is enabled and is running on either Unix or Cygwin.
gasche
approved these changes
Dec 19, 2023
Member
gasche
left a comment
There was a problem hiding this comment.
This is good to go if the testsuite approves.
(I guess libunix could be renamed to libunixunix to avoid such confusions?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two related changes:
libunixbut didn't use the Unix library. That disables them if the Unix library isn't built (the "minimal" build) and always disables them on Windows (more below).libunixinstead ofhasunixwhich meant that they didn't ever run on Windows.That's it for the PR. Background follows...
#11160 removed the distinction between otherlibs/unix (the Unix library on Posix) and otherlibs/win32unix (the Unix library on Win32). ocamltest still has
hasunix(which passes if either library is available) andlibunix(which passes if the Posix version of Unix has been built) andlibwin32unix(which passes if the Win32 version of Unix has been built). The two separate lib actions were logical before #11160, but they're now a bit of a confusing legacy and, as this PR shows, prone to misuse.Ideally, we should remove both
libunixandlibwin32unix, but it's fiddly. For example,libunixpasses on Cygwin because Cygwin is Posix, butnot-windowsdoes not pass because Cygwin runs on Windows, so the obvious conversion oflibunix;tohasunix; not-windows;does not work. In correcting misuse of those actions, this PR is at least a step on the way to improving all this.