Merge Unix and Windows build systems in the ocamldoc directory#808
Merge Unix and Windows build systems in the ocamldoc directory#808alainfrisch merged 1 commit intoocaml:trunkfrom
Conversation
139f11c to
9aeef95
Compare
ocamldoc/Makefile
Outdated
| ifeq "$(UNIX_OR_WIN32)" "unix" | ||
| OCAMLDEPFLAGS = | ||
| else # Windows | ||
| OCAMLDEPFLAGS = -slash |
There was a problem hiding this comment.
It seems -slash does nothing under Unix, so one might be able to avoid this conditional.
There was a problem hiding this comment.
Alain Frisch (2016/09/13 13:54 -0700):
+OCAMLDEP =
$(OCAMLRUN) $ (ROOTDIR)/tools/ocamldep
+ifeq "$(UNIX_OR_WIN32)" "unix"
+OCAMLDEPFLAGS =
+else # Windows
+OCAMLDEPFLAGS = -slashIt seems -slash does nothing under Unix,
Indeed (I chekced). Many thanks for having spotted this.
so one might be able to avoid this conditional.
Doone.
38c85d7 to
e913ca4
Compare
e913ca4 to
c5c4835
Compare
This commit changes the behaviour of both the Unix and Windows build systems.
The changes are either specific to one build system or common to both.
Changes specific to the Unix build system:
- Use the -slash option when invoking ocamldep. This does nothing on
Unix and makes it possible to use the same command under Unix and Windows.
- install target:
- Directories are created unconditionnally, instead of creating them
only if they do not already exist
(also true for the installopt target)
- cp no longer uses the -f flag, to be consistent with the
other directories
- The custom directory $(INSTALL_LIBDIR)/custom is no longer created
because nothing was installed there anyway
- In the opt.opt target, consecutive calls to make have been
replaced by prerequisites, enhancing parallelisation opportunities.
Changes specific to the Windows build system:
- Whaen compiling .ml files, use the same line-number-preserving
preprocessor as under Unix, rather than the grep -v DEBUG command.
- ocamldoc generators and odoc_test are now compiled
- ocamldoc can now be run from sources to generate the documentation
of the standard library
- The test targets are now also available under Windows
- opt.opt now builds native-code versions of the generators
Changes affecting both Unix and Windows build systems:
- The targets that were depending on the empty "dummy" target
are now declared as .PHONY targets, dummy has been removed.
- In the all target, successive calls to make have been replaced
by prerequisites.
- Commands executed by make clean are now displayed instead of being
executed silently.
c5c4835 to
d51851a
Compare
|
As a meta comment: you have been doing a lot of excellent work on deduplicating and improving the compiler distribution build system, in a series of distinct pull requests. Very few of those changes had a I think it is probably time for a comprehensive Changes entry that is global in scope (it corresponds to the work of sharing Unix and Windows Makefile across the whole compiler distribution). I think it would be best if it listed all affected directories (in case there is a regression somewhere, users can find the mention of the problematic directory in the changelog), and give the PR numbers of each. |
|
Thanks, Gabriel.
I think the current plan regarding changes (as discussed with
@alainfrisch I don't remember where) is to add one global item for
everything when the build systems have been merged everywhere.
Currently, three directories remain where the build systems have not yet
been completely merged, where "completely merged" means that the only
thing Makefile.nt does is to include the Makefile.
I hope the build systems in these directories can be merged in the next
days.
Then, it should become possible to do exactly the same thing in the main
makefiles to finally get rid of all the Makfile.nt files.
|
|
I've found a problem with this PR, related to calling the bytecode executable ocamldoc under Windows. Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: instead of changing PATH. @shindere Do you think this is the right thing to do? |
|
Very sorry about the delay @alainfrisch, I didn't see your last comment.
In principle I pretty much like your suggestion, because in addition to
solving the problem you describe, it avoids modifying a very generic variable
which affects many things (PATH), in favour of a dedicated variable
whose semantics is much clearer (at least to me).
I suggest that I test this fix on our Windows machines and then
submit another PR. Is that fine?
I am also interested in your feedback, @dra27.
|
This fixes a problem related to the way ocamldoc's bytecode executable is called under Windows, reported by @alainfrisch at ocaml#808 (comment) As he explains, ``Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" instead of changing PATH''. This commit implements the proposed fix, due to @alainfrisch.
This fixes a problem related to the way ocamldoc's bytecode executable is called under Windows, reported by @alainfrisch at ocaml#808 (comment) As he explains, ``Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" instead of changing PATH''. This commit implements the proposed fix, due to @alainfrisch.
|
PR #906 has just been submitted to fix the reported issue.
It has been tested on both MinGW and MSVC ports and seems to work.
|
This fixes a problem related to the way ocamldoc's bytecode executable is called under Windows, reported by @alainfrisch at ocaml#808 (comment) As he explains, ``Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" instead of changing PATH''. This commit implements the proposed fix, due to @alainfrisch.
…#906) This fixes a problem related to the way ocamldoc's bytecode executable is called under Windows, reported by @alainfrisch at #808 (comment) As he explains, ``Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" instead of changing PATH''. This commit implements the proposed fix, due to @alainfrisch.
…#808) This commit changes the behaviour of both the Unix and Windows build systems. The changes are either specific to one build system or common to both. Changes specific to the Unix build system: - Use the -slash option when invoking ocamldep. This does nothing on Unix and makes it possible to use the same command under Unix and Windows. - install target: - Directories are created unconditionnally, instead of creating them only if they do not already exist (also true for the installopt target) - cp no longer uses the -f flag, to be consistent with the other directories - The custom directory $(INSTALL_LIBDIR)/custom is no longer created because nothing was installed there anyway - In the opt.opt target, consecutive calls to make have been replaced by prerequisites, enhancing parallelisation opportunities. Changes specific to the Windows build system: - Whaen compiling .ml files, use the same line-number-preserving preprocessor as under Unix, rather than the grep -v DEBUG command. - ocamldoc generators and odoc_test are now compiled - ocamldoc can now be run from sources to generate the documentation of the standard library - The test targets are now also available under Windows - opt.opt now builds native-code versions of the generators Changes affecting both Unix and Windows build systems: - The targets that were depending on the empty "dummy" target are now declared as .PHONY targets, dummy has been removed. - In the all target, successive calls to make have been replaced by prerequisites. - Commands executed by make clean are now displayed instead of being executed silently.
…ocaml#906) This fixes a problem related to the way ocamldoc's bytecode executable is called under Windows, reported by @alainfrisch at ocaml#808 (comment) As he explains, ``Even if the PATH is extended with explicit paths to otherlibs/win32unix and otherlibs/str, ocamlrun will still look up the stub dlls in the installation directory first, as can be seen by setting OCAMLRUNPARAM=v=256. If another version was installed in the same target directory before, the old dlls will be loaded which can lead to failure (e.g. I just got "Fatal error: unknown C primitive 'unix_lstat'"). A fix could be to set: CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" instead of changing PATH''. This commit implements the proposed fix, due to @alainfrisch.
signal_alloc testcase fix
This PR continues the build-systems merging work started in PRs
#762, #764, #785 and #788.
Here again, the aim is to make ocamldoc/Makefile work for both
Unix and Windows, so that ocamldoc/Makefile.nt can just include it.
So, although this PR improves a few aspects of the build process of ocamldoc
(see commit log for details of those improvements and changes), it is
worth emphasizing that improving the build process itself is not the primary
target of this PR, whose goal is, again, to merge the build systems.