-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
otherlibs: Merge win32unix into unix #11160
Conversation
I will aim to review this in the morning, but there aren’t enough emoji to express how happy this PR makes me! |
David Allsopp (2022/04/04 16:34 -0700):
I will aim to review this in the morning, but there aren’t enough
emoji to express how happy this PR makes me!
Wow! Many thanks for your warm support, David!
There is one issue I do not understand so far: the failure of the
Gigiene workflow. It reports a problem wiht the computation of
dependencies, but the dependencies it wants seem wrong to me whereas
those commited are, I think,right. Any thought on this?
|
|
||
CAMLOBJS=unix.cmo unixLabels.cmo | ||
|
||
HEADERS=unixsupport.h socketaddr.h | ||
|
||
include ../Makefile.otherlibs.common | ||
|
||
unix.ml: unix_$(UNIX_OR_WIN32).ml | ||
cp $< $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought unix.ml
was created by configure
fromunix.ml.in
below. Did I miss something?
Nicolás Ojeda Bär (2022/04/04 22:42 -0700):
@nojb commented on this pull request.
>
CAMLOBJS=unix.cmo unixLabels.cmo
HEADERS=unixsupport.h socketaddr.h
include ../Makefile.otherlibs.common
+unix.ml: unix_$(UNIX_OR_WIN32).ml
+ cp $< $@
I thought `unix.ml` was created by `configure` from`unix.ml.in` below.
Did I miss something?
My bad, sorry, and thanks for your care. This `unix.ml.in` was a
left-over (whichI just removed) from my first (failed) attempt.
Initially I wanted to have `unix.ml` to include the right
implementation, but that does actually not work because that would
require both `unix_unix.ml` and `unix_win32.ml` to have an `.mli` file.
So for the time being, I went with this not-so-clean solution to copy
the right implementationto `unix.ml`.
I considered merging the two `.Ml` files, but it was not obvious how to
do it, especially for functions that are defined in OCaml on one side
and as external C function on the other side. But I can investigate this
more if desired. It's just that, somehow, it felt not so important at
this stage.
|
a879d38
to
0f8b494
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, @shindere!
In many instances, the C files could in future be further merged (the use of char_os
and so forth means that many of the differences aren't as #ifdef
-y as one might fear). Partly with this longer-term goal in mind, and partly to reduce the diff slightly, could it be that we have select.c
as the "POSIX" file and select_win32.c
as the Windows specific one, etc.?
I also double-checked in precheck that the tests being skipped are the same (which they are) - so the change hasn't affected what the testsuite is running.
.gitignore
Outdated
/otherlibs/threads/marshal.mli | ||
/otherlibs/threads/stdlib.mli | ||
/otherlibs/threads/unix.mli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not part of this PR, but if I open a PR with it will create a conflict - these 3 lines should have been deleted in 4.09!
Makefile
Outdated
@@ -83,7 +83,7 @@ TOPINCLUDES=$(addprefix -I otherlibs/,$(filter-out %threads,$(OTHERLIBRARIES))) | |||
ifeq "$(UNIX_OR_WIN32)" "unix" | |||
EXTRAPATH= | |||
else | |||
EXTRAPATH = PATH="otherlibs/win32unix:$(PATH)" | |||
EXTRAPATH = PATH="otherlibs/unix:$(PATH)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this has ever been a necessary thing to do, right since it was added between 4.04 and 4.05 - the only purpose of this would be to add DLLs to PATH
, but the loader never searches PATH
for them. Rather than continuing to update it, how about we just remove EXTRAPATH
completely?
I have quickly double-checked - it's certainly working as expected on trunk without this (even setting CAML_LD_LIBRARY_PATH
to point to an incompatible stub library, for example) and it even worked that way in 4.05 when it was added! The -I otherlibs/unix
should cause the toplevel to prefer otherlibs/unix/dllunix.dll
in the tree, unless I really need more coffee...
Makefile
Outdated
@@ -809,8 +809,7 @@ clean:: | |||
$(MAKE) -C runtime clean | |||
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib | |||
|
|||
otherlibs_all := dynlink \ | |||
str systhreads unix win32unix | |||
otherlibs_all := dynlink str systhreads unix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated in otherlibs/Makefile
- worth introducing OTHERLIBS_ALL
in Makefile.common
??
Makefile.config.in
Outdated
@@ -181,7 +181,7 @@ PTHREAD_CAML_LIBS=$(addprefix -cclib ,$(PTHREAD_LIBS)) | |||
PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ | |||
|
|||
UNIX_OR_WIN32=@unix_or_win32@ | |||
UNIXLIB=@unixlib@ | |||
UNIXLIB=unix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be moved to the "deprecated" part at the bottom - it's no longer used in the build system and anything which was relying on it (for whatever reason) is going to break!
api_docgen/Makefile.common
Outdated
otherlibs/str otherlibs/unix otherlibs/dynlink \ | ||
otherlibs/systhreads) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming we do have a common definition OTHERLIBS_ALL
in Makefile.common
, this could then become:
otherlibs/str otherlibs/unix otherlibs/dynlink \ | |
otherlibs/systhreads) | |
$(addprefix otherlibs/, $(OTHERLIBS_ALL))) |
otherlibs/unix/Makefile
Outdated
# Note: at the moment, we need to include the configuration makefile directly | ||
# even before we can include Makefile.otherlibs.common | ||
# because the UNIX_OR_WIND32 variable must be defined even before | ||
# we can include Makefile.otherlibs.config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Makefile.otherlibs.common
, not config
otherlibs/unix/unixsupport.h
Outdated
#ifdef _WIN32 | ||
extern wchar_t ** cstringvect(value arg, char * cmdname); | ||
extern void cstringvect_free(wchar_t **); | ||
#else | ||
extern char ** cstringvect(value arg, char * cmdname); | ||
extern void cstringvect_free(char **); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if this used char_os
instead:
#ifdef _WIN32 | |
extern wchar_t ** cstringvect(value arg, char * cmdname); | |
extern void cstringvect_free(wchar_t **); | |
#else | |
extern char ** cstringvect(value arg, char * cmdname); | |
extern void cstringvect_free(char **); | |
#endif | |
extern char_os ** cstringvect(value arg, char * cmdname); | |
extern void cstringvect_free(char_os **); |
however, that requires caml/misc.h
and I'm not sure if there are any implications to adding that here? (I don't think there are??)
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#ifdef _WIN32 | ||
#define EXECV_CAST (const char_os * const *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, apropos above, caml/misc.h
is obviously loaded before unixsupport.h
, or this line from the win32unix's unixsupport.h
would already be failing. Perhaps it should be made official by adding #include <caml/misc.h>
here, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nice, I don't think my previous patches are affected in any (bad) way.
otherlibs/unix/unixsupport.h
Outdated
#ifdef _WIN32 | ||
/* Information stored in flags_fd, describing more precisely the socket | ||
* and its status. The whole flags_fd is initialized to 0. | ||
*/ | ||
|
||
/* Blocking or nonblocking. By default a filedescr is in blocking state */ | ||
#define FLAGS_FD_IS_BLOCKING (1<<0) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section could be moved closer to the struct filedescr
definition.
The CI says |
No, it needs a little tweak: diff --git a/Makefile b/Makefile
index 2a9059c9f4..c59429e148 100644
--- a/Makefile
+++ b/Makefile
@@ -810,8 +810,8 @@ clean::
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib
otherlibs_all := dynlink str systhreads unix
-subdirs := debugger lex ocamldoc ocamltest stdlib tools \
- $(addprefix otherlibs/, $(otherlibs_all)) \
+subdirs := lex stdlib tools $(addprefix otherlibs/, $(otherlibs_all)) \
+ debugger ocamldoc ocamltest
.PHONY: alldepend
alldepend: depend The point is that before computing the debugger's dependencies, you need otherlibs/unix's to have been computed in order to generate
|
Antonin Décimo (2022/04/05 08:04 -0700):
The CI says `make alldepend` should be run. Is that missing from the
PR?
No I did run it and when I run it on my system, the dependencies it
computes are the same than those stored in the commit.
Also, if you have a look to the diff, it seems weird because it's about
the dependency of a .cmx file. It wants to replace one .cmx prereq by a
.cmi prereq, which I find mysterious. It makes no sense to me.
|
That's what @dra27 was referring to: if at the time you compute the dependencies in ocamldebug, |
I don't know why, but I was expecting a reorganization based on directories:
with |
Hey David,
Many thanks for the positive feedback and the in-depth review!
David Allsopp (2022/04/05 06:26 -0700):
In many instances, the C files could in future be further merged (the use
of char_os and so forth means that many of the differences aren't as
#ifdef-y as one might fear). Partly with this longer-term goal in mind,
and partly to reduce the diff slightly, could it be that we have select.c
as the "POSIX" file and select_win32.c as the Windows specific one,
etc.?
Well to be honest I am not very excited by this. I don't see reducing
the diff as a strong argument, and to me the fact that the
`$(UNIX_OR_WIN32)` variable can be used to pick the right sources is
nice. I also like the symmetry of the way things are currently done, so
for all this reasons and also because ancy change would be more work
(and work that I feel wouldn't really bring anything compared to what
has already been implemented) I would tend not to follow this
suggestion, and likewise for @xavierleroy's one to put the files
indistinct subdirectories. But, if people insist that one of those
hsould absolutely be done, sure I'll do.
I also double-checked in precheck that the tests being skipped are the
same (which they are) - so the change hasn't affected what the testsuite
is running.
Many thanks for having verified this!
In .gitignore:
> /otherlibs/threads/marshal.mli
/otherlibs/threads/stdlib.mli
/otherlibs/threads/unix.mli
It's not part of this PR, but if I open a PR with it will create a
conflict - these 3 lines should have been deleted in 4.09!
I added a commit to the PR, just before the main one. Many thanks for
the suggestion.
In Makefile:
> @@ -83,7 +83,7 @@ TOPINCLUDES=$(addprefix -I otherlibs/,$(filter-out %threads,$(OTHERLIBRARIES)))
ifeq "$(UNIX_OR_WIN32)" "unix"
EXTRAPATH=
else
-EXTRAPATH = PATH="otherlibs/win32unix:$(PATH)"
+EXTRAPATH = PATH="otherlibs/unix:$(PATH)"
I don't think this has ever been a necessary thing to do, right since it
was added between 4.04 and 4.05 - the only purpose of this would be to add
DLLs to PATH, but the loader never searches PATH for them. Rather than
continuing to update it, how about we just remove EXTRAPATH
completely?
Yes, of course that's a nice suggestion! Done!
I have quickly double-checked - it's certainly working as expected on
trunk without this (even setting CAML_LD_LIBRARY_PATH to point to an
incompatible stub library, for example) and it even worked that way in
4.05 when it was added! The -I otherlibs/unix should cause the toplevel to
prefer otherlibs/unix/dllunix.dll in the tree, unless I really need more
coffee...
Let's assume you had your dose... :-)
In Makefile:
> @@ -809,8 +809,7 @@ clean::
$(MAKE) -C runtime clean
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib
-otherlibs_all := dynlink \
- str systhreads unix win32unix
+otherlibs_all := dynlink str systhreads unix
This is duplicated in otherlibs/Makefile - worth introducing OTHERLIBS_ALL
in Makefile.common??
Absolutely, thanks. I went for `ALL_OTHERLIBS` and used `=` rather than
`?=` because I don't think we want ot provide the ability to override
this definition.
In Makefile.config.in:
> @@ -181,7 +181,7 @@ PTHREAD_CAML_LIBS=$(addprefix -cclib ,$(PTHREAD_LIBS))
***@***.***_CFLAGS@
***@***.***_or_win32@
***@***.***@
+UNIXLIB=unix
This could be moved to the "deprecated" part at the bottom - it's no
longer used in the build system and anything which was relying on it (for
whatever reason) is going to break!
Is it?
I moved the definition in the deprecated section anyway. I thought about
doing that but was not sure so I remained conservative, but the change
looks very sensible to me.
In api_docgen/Makefile.common:
> + otherlibs/str otherlibs/unix otherlibs/dynlink \
otherlibs/systhreads)
Assuming we do have a common definition OTHERLIBS_ALL in Makefile.common,
this could then become:
� Suggested change
- otherlibs/str otherlibs/unix otherlibs/dynlink \
- otherlibs/systhreads)
+ $(addprefix otherlibs/, $(OTHERLIBS_ALL)))
══════════════════════════════════════════════════════════════════════════
Very well spotted and thus done, many thanks.
In [7]ocamltest/builtin_actions.ml:
> + "win32 variant of the unix library available"
+ "win32 variant of the unix library not available")
This may be better to leave to a subsequent PR, but we were already
abusing libwin32unix and libunix as a cheap way of detecting both the
presence of the unix library and a platform, and it feels odd to
perpetuate this when libwin32unix no longer exists!
Given that we have windows and not-windows, I wonder if it would be better
to remove libwin32unix entirely, make libunix mean "the Unix library is
available" (which also eliminates the strange Ocamltest_config.libunix
being a bool option) and refactor the relatively small number of tests to
use libunix followed by windows or not-windows as appropriate?
I definitely agree that it would be nice to clarify this. In practice I
am unsure how to proceed because the "windows" action of ocamltest
actually looks at the `OS` environment variable. In practice, it means
the "windows" action also passes for the Cygwin port, which is not the
case of the `libwin32unix` action which passes only on MinGW and MSVC.
Whatever we decide, if keeping this for another PR is okay that would be
my preferred way because the present one seems already big enough. But
I'm willing to submit that other PR soon after the present one gets
merged if the road to follow is clear.
In ocamltest/ocaml_modifiers.ml:
> @@ -81,7 +81,7 @@ let testing = make_library_modifier
let tool_ocaml_lib = make_module_modifier
"lib" (compiler_subdir ["testsuite"; "lib"])
-let unixlibdir = if Sys.win32 then "win32unix" else "unix"
+let unixlibdir = "unix"
This variable was never exported - can't that just be folded into its one
use below (we don't have let dynlinkdir = "dynlink", for example)
You are absolutely right. Done.
In otherlibs/Makefile:
> @@ -17,7 +17,7 @@ ROOTDIR=..
include $(ROOTDIR)/Makefile.common
OTHERLIBRARIES ?= dynlink str systhreads \
- unix win32unix
+ unix
(suggested previously to have OTHERLIBS_ALL or something in
Makefile.common).
Yep, this file has been updated accordingly.
As a very minor additional point, I think the list now fits on one line!!
Go us, and our gradual shedding of weight!
It does fit. :)
In otherlibs/unix/Makefile:
> @@ -15,42 +15,74 @@
# Makefile for the Unix interface library
+ROOTDIR = ../..
+# Note: at the moment, we need to include the configuration makefile directly
+# even before we can include Makefile.otherlibs.common
+# because the UNIX_OR_WIND32 variable must be defined even before
Typo: stray D in UNIX_OR_WIN32
Fixed, thanks
In otherlibs/unix/Makefile:
> @@ -15,42 +15,74 @@
# Makefile for the Unix interface library
+ROOTDIR = ../..
+# Note: at the moment, we need to include the configuration makefile directly
+# even before we can include Makefile.otherlibs.common
+# because the UNIX_OR_WIND32 variable must be defined even before
+# we can include Makefile.otherlibs.config
Typo: Makefile.otherlibs.common, not config
Fixed. Thanks.
In [12]otherlibs/unix/Makefile:
> @@ -15,42 +15,74 @@
# Makefile for the Unix interface library
+ROOTDIR = ../..
+# Note: at the moment, we need to include the configuration makefile directly
+# even before we can include Makefile.otherlibs.common
+# because the UNIX_OR_WIND32 variable must be defined even before
+# we can include Makefile.otherlibs.config
+# This will be fixed later
Apologies if you've already tried this and it's failed, but there are two
uses of UNIX_OR_WIN32 below. The first defining LINKOPTS and LDOPTS can
safely be moved after Makefile.otherlibs.common is included because those
definitions are only used in recipes.
In Makefile.otherlibs.common if we can add COBJS_win32 ?=, COJBS_unix ?=
and COBJS_ALL = $(COBJS) $(COBJS_$(UNIX_OR_WIN32)) and then all the
subsequent uses of $(COBJS) in the ifeqs and dependencies should be for
$(COBJS_ALL).
Ah yes, I get the idea and it seems nice indeed.
The thing is, I think we oculd get rid of `otherlibs/Makefile.common`
completely to avoid having several common makefiles, by extending the
root Makefile.common a bit. So I didn't want to invest too many efforts
at this stage and woudl prefer to invest them when removing this file.
Would that be okay with you, @dra27?
In otherlibs/unix/Makefile:
> # dllunix.so particularly requires libm for modf symbols
LDOPTS=$(NATIVECCLIBS)
+endif
+
+# C source files common to both Unix and Windows
+COMMON_C_SOURCES = $(addsuffix .c, \
I've implicitly suggested changing this with the suggestion for
COBJS_win32 and so forth above, but FWIW I find it a little odd to add the
.c suffix here and elsewhere solely to do a string replace to .$(O) on it
later!
Well, while working on the Makefiles, I took the habbit to define
variables that describe the source files and to then derive the names of
the generated files from those varialbes. I understand it may be seen as
sub-optimal, but I don't think it's a big cost to do that and I like the
fact that it's principled.
In otherlibs/unix/unixsupport.h:
> +#ifdef _WIN32
+extern wchar_t ** cstringvect(value arg, char * cmdname);
+extern void cstringvect_free(wchar_t **);
+#else
extern char ** cstringvect(value arg, char * cmdname);
extern void cstringvect_free(char **);
+#endif
It would be better if this used char_os instead:
� Suggested change
-#ifdef _WIN32
-extern wchar_t ** cstringvect(value arg, char * cmdname);
-extern void cstringvect_free(wchar_t **);
-#else
-extern char ** cstringvect(value arg, char * cmdname);
-extern void cstringvect_free(char **);
-#endif
+extern char_os ** cstringvect(value arg, char * cmdname);
+extern void cstringvect_free(char_os **);
however, that requires caml/misc.h and I'm not sure if there are any
implications to adding that here? (I don't think there are??)
══════════════════════════════════════════════════════════════════════════
In [15]otherlibs/unix/unixsupport.h:
>
#ifdef __cplusplus
}
#endif
+#ifdef _WIN32
+#define EXECV_CAST (const char_os * const *)
Actually, apropos above, caml/misc.h is obviously loaded before
unixsupport.h, or this line from the win32unix's unixsupport.h would
already be failing. Perhaps it should be made official by adding #include
<caml/misc.h> here, though.
Done so, and I integrated your nice suggestion.
|
David Allsopp (2022/04/05 08:27 -0700):
No, it needs a little tweak:
```diff
diff --git a/Makefile b/Makefile
index 2a9059c9f4..c59429e148 100644
--- a/Makefile
+++ b/Makefile
@@ -810,8 +810,8 @@ clean::
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib
otherlibs_all := dynlink str systhreads unix
-subdirs := debugger lex ocamldoc ocamltest stdlib tools \
- $(addprefix otherlibs/, $(otherlibs_all)) \
+subdirs := lex stdlib tools $(addprefix otherlibs/, $(otherlibs_all)) \
+ debugger ocamldoc ocamltest \
.PHONY: alldepend
alldepend: depend
```
The point is that before computing the debugger's dependencies, you
need otherlibs/unix's to have been computed in order to generate
`unix.ml`. I'd recommend a workaround like the above rather than
hammering in a dependency between `debugger/Makefile` and
`otherlibs/unix/Makefile` just for `alldepend` (at least for now).
Ah yes! I changed alldepend to compute dependencies for stdlib and
otherlibs first. Thanks!
`configure`'s also been regenerated with autoconf 2.71 rather than
2.69 (come on, Ubuntu 22.04!!)
Fixed, sorry about that. I thouhgt we had a GitHub action to verify
this?
|
Vincent Laviron (2022/04/05 10:17 -0700):
> Also, if you have a look to the diff, it seems weird because it's about the dependency of a .cmx file. It wants to replace one .cmx prereq by a .cmi prereq, which I find mysterious. It makes no sense to me.
That's what @dra27 was referring to: if at the time you compute the
dependencies in ocamldebug, `otherlibs/unix/unix.ml` doesn't exist,
`ocamldep` cannot register dependencies to the `.cmx` file, only on
the `.cmi` file (as `unix.mli` is present). In your local copy, I
assume that you have built everything so the `unix.ml` file is here,
and `make alldepend` produces the expected result, but on the CI
there's only a minimal build (that doesn't include the Unix library),
and the ocamldebug dependencies are compiled too early, so you get the
result shown in the log.
THat's exactly what happened indeed, many thanks. It should now be
fixed.
|
aeb4ee5
to
b03cfed
Compare
The latest version of the PR is currently going through precheck on Inria's CI, see build #682. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @shindere - apart from possibly re-inserting one @
symbol, this looks go to go for me.
GitHub actions was checking the configure script - the regeneration check had failed in addition to the alldepend check.
No problem with not renaming the files further - of course, arguing with myself, having select_unix.c
and select_win32.c
also serves as a reminder that there are probably two files to update with any changes.
Anything which was relying on $(UNIXLIB)
in Makefile.config
would could have been using it to differentiate between unix
and win32unix
(just like our testsuite), but I think it's unlikely to have been being used that way "in the wild".
For ocamltest, let's leave this to another PR. I had not realised that windows
and not-windows
were applying to Cygwin - the windows action is not presently used in any tests and a quick look at all the uses of not-windows
suggests that most, if not all, of them are incorrect (i.e. not-windows is excluding Cygwin where Cygwin should be being tested). I have always preferred to explain Cygwin as being Unix - i.e. it's Unix which just happens to be running on Windows, so maybe we can get away with just changing windows
to mean msvc+mingw. Anyway, for the future.
No problem to wait for fixing otherlibs/unix/Makefile
until otherlibs/Makefile.otherlibs.common
is eliminated.
# $1: target name to dispatch to all otherlibs/*/Makefile | ||
define dispatch_ | ||
$1: | ||
@for lib in $$(OTHERLIBRARIES); do \ | ||
for lib in $$(OTHERLIBRARIES); do \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I don't think we need to lose that @
here - each one of the recursive calls to make generates the correct Entering directory
message and the loop is also careful to exit on any error. Of course, it would be even nicer if it were generated using $(for
but that's not important right now ;)
David Allsopp (2022/04/07 14:01 +0000):
@dra27 approved this pull request.
Many thanks for the approval, DAvid!
Thanks for the changes @shindere - apart from possibly re-inserting
one `@` symbol, this looks go to go for me.
I actually ran into troubles while working on the PR and it helped
fixing them to see the for loop, because it helped me to realise that I
mis-used the `OTHERLIBS` variable.
Since removing the `@` helped me to debug my work, I felt it wouldn't
hurt to be a bit more explicit.
Given this, do you still want me to restore it, or is it fine to leave
it out?
GitHub actions was checking the configure script - the regeneration
check had failed in addition to the alldepend check.
I didn't pay attention, very sorry about that.
No problem with not renaming the files further - of course, arguing
with myself, having `select_unix.c` and `select_win32.c` also serves
as a reminder that there are probably two files to update with any
changes.
Thanks.
Anything which was relying on `$(UNIXLIB)` in `Makefile.config` would
could have been using it to differentiate between `unix` and
`win32unix` (just like our testsuite), but I think it's unlikely to
have been being used that way "in the wild".
Ah, indeed. I guess I have been too exicted about removing the variable
completely...
For ocamltest, let's leave this to another PR. I had not realised that
`windows` and `not-windows` were applying to Cygwin - the windows
action is not presently used in any tests and a quick look at all the
uses of `not-windows` suggests that most, if not all, of them are
incorrect (i.e. not-windows is excluding Cygwin where Cygwin should be
being tested).
I think it's partly my fault because it's something I did when migrating
the tests. So, either these tests were already not executed on Cygwin
before the migration (whereas they should have been), or they were
executed on Cygwin before the migration and, as a consequence of an
error when migrating, they stopped being executed on Cygwin. I hope it's
the former which is true and not the latter, but I can't be sure.
I have always preferred to explain Cygwin as being Unix
- i.e. it's Unix which just happens to be running on Windows, so maybe
we can get away with just changing `windows` to mean msvc+mingw.
Anyway, for the future.
Yes, I understandyour point. It's just that Cygwin is listed as a
Windows port, so it felt coherent to include it in the windows
predicate, but it's perhaps somewhat arbitrary.
No problem to wait for fixing `otherlibs/unix/Makefile` until
`otherlibs/Makefile.otherlibs.common` is eliminated.
Thanks.
> # $1: target name to dispatch to all otherlibs/*/Makefile
define dispatch_
$1:
- @for lib in $$(OTHERLIBRARIES); do \
+ for lib in $$(OTHERLIBRARIES); do \
FWIW, I don't think we need to lose that `@` here - each one of the
recursive calls to make generates the correct `Entering directory`
message and the loop is also careful to exit on any error. Of course,
it would be even nicer if it were generated using `$(for ` but that's
not important right now ;)
See above and just let me know what you prefer and I'll do that.
|
I don't mind with the |
Delete three files that should have been removed in 4.09. Suggestion by David Allsopp.
In this file, the clean targets depend on the OTHERLIBRARIES variable. However, this variable is defined in `Makefile.config`, which is not included when make is called for cleaning, so that the clean does actually not happen (OTHERLIBRARIES being empty in that case).
I just pushed 146766c to fix the bootstrap. The problem is explained both in the commit message and as a comment in the source code. Apologies for the noise. |
Antonin Décimo (2022/04/05 07:06 -0700):
@MisterDA approved this pull request.
Thanks!
This looks nice, I don't think my previous patches are affected in any (bad) way.
> +#ifdef _WIN32
+/* Information stored in flags_fd, describing more precisely the socket
+ * and its status. The whole flags_fd is initialized to 0.
+ */
+
+/* Blocking or nonblocking. By default a filedescr is in blocking state */
+#define FLAGS_FD_IS_BLOCKING (1<<0)
+#endif
This section could be moved closer to the `struct filedescr`
definition.
Done so, thanks.
|
David Allsopp (2022/04/08 04:14 -0700):
I don't mind with the `@` - mostly, I prefer shorter build logs, but
not enough to be insisting!
Thanks! Sometimes I need the logs to be idiot-proof, it seems.
It seems something has been missed here because this PR broke the
bootstrap. I don't understand why so far but will investigate today.
|
Build the unix library in the otherlibs/unix directory no matter whether
it's the unix or win32 flavour.
This simplifies the compiler's build system a bit, see for instance
how the recipe for the
depend
target indebugger/Makefile
becomesmore straightforward.
The
unixsupport.h
header files of the two directories have been merged.The declaration of the
unix_freeze_buffer
funciton has been removedsince it is mentionned nowhere else in the code base.
This PR goes through precheck successfully, se Build #679.