Skip to content

Fix incorrect uses of libunix in the testsuite#12844

Merged
dra27 merged 2 commits intoocaml:trunkfrom
dra27:testsuite-libunix
Dec 19, 2023
Merged

Fix incorrect uses of libunix in the testsuite#12844
dra27 merged 2 commits intoocaml:trunkfrom
dra27:testsuite-libunix

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Dec 19, 2023

Two related changes:

  • Various multicore tests (possibly down to copy+paste) contained libunix but 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).
  • Two tests were using libunix instead of hasunix which 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) and libunix (which passes if the Posix version of Unix has been built) and libwin32unix (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 libunix and libwin32unix, but it's fiddly. For example, libunix passes on Cygwin because Cygwin is Posix, but not-windows does not pass because Cygwin runs on Windows, so the obvious conversion of libunix; to hasunix; 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.

dra27 added 2 commits October 22, 2023 11:04
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.
Copy link
Copy Markdown
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go if the testsuite approves.

(I guess libunix could be renamed to libunixunix to avoid such confusions?)

@dra27 dra27 merged commit 0c07b33 into ocaml:trunk Dec 19, 2023
@dra27 dra27 deleted the testsuite-libunix branch December 19, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants