Building from GitHub source

48 views
Skip to first unread message

Markus Mottl

unread,
Sep 22, 2016, 11:39:51 PM9/22/16
to ocaml...@googlegroups.com
Hi,

are there any instructions on building Core, Core_kernel, etc. from
GitHub source (i.e. not via OPAM or tarball)?

I wanted to add a feature to Core_kernel, but the build for Git tag
113.33.01+4.03 fails with this error:

----------
./setup.exe -build -j 8
W: No replace section found in file Makefile
W: Cannot find source file matching module 'core_kernel' in library core_kernel.
W: Use InterfacePatterns or ImplementationPatterns to define this file
with feature "source_patterns".
+ ocamlfind ocamlopt unix.cmxa -I
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild/ocamlbuildlib.cmxa -linkpkg
myocamlbuild.ml
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild/ocamlbuild.cmx -o
myocamlbuild
File "myocamlbuild.ml", line 71, characters 4-34:
Error: Unbound module Ppx_driver_ocamlbuild
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
E: Failure("Command ''/Users/mmottl/.opam/4.03.0/bin/ocamlbuild'
src/libcore_kernel_stubs.a src/dllcore_kernel_stubs.so
src/core_kernel.cma src/core_kernel.cmxa src/core_kernel.a
src/core_kernel.cmxs -use-ocamlfind -tag debug -j 8' terminated with
error code 10")
make: *** [build] Error 1
EXIT STATUS 2
---------

This doesn't happen with the distributed tarball of the exact same version.

Regards,
Markus

--
Markus Mottl http://www.ocaml.info markus...@gmail.com

Yaron Minsky

unread,
Sep 23, 2016, 10:58:06 PM9/23/16
to ocaml...@googlegroups.com
That's a little surprising.

Have you tried this against tip? That's probably a more natural
version to develop against. The 113.33.01+4.03 version was a bit of a
hack to get something working with 4.03, but tip works against 4.03
naturally, and it's anyway better to release PRs against tip.

y
> --
> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Yaron Minsky

unread,
Sep 23, 2016, 11:01:37 PM9/23/16
to ocaml...@googlegroups.com
That's a little surprising.

Have you tried this against tip? That's probably a more natural
version to develop against. The 113.33.01+4.03 version was a bit of a
hack to get something working with 4.03, but tip works against 4.03
naturally, and it's anyway better to release PRs against tip.

y

On Fri, Sep 23, 2016 at 12:39 PM, Markus Mottl <markus...@gmail.com> wrote:

Markus Mottl

unread,
Sep 25, 2016, 11:02:21 AM9/25/16
to ocaml...@googlegroups.com
Yes, tip (master branch) doesn't compile either:

----------
./setup.exe -build -j 8
W: No replace section found in file Makefile
W: Cannot find source file matching module 'core_kernel' in library core_kernel.
W: Use InterfacePatterns or ImplementationPatterns to define this file
with feature "source_patterns".
+ ocamlfind ocamlopt unix.cmxa -I
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild/ocamlbuildlib.cmxa -linkpkg
myocamlbuild.ml
/Users/mmottl/.opam/4.03.0/lib/ocamlbuild/ocamlbuild.cmx -o
myocamlbuild
File "myocamlbuild.ml", line 5, characters 12-42:
Error: Unbound module Jane_street_ocamlbuild_goodies
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
E: Failure("Command ''/Users/mmottl/.opam/4.03.0/bin/ocamlbuild'
src/libcore_kernel_stubs.a src/dllcore_kernel_stubs.so
src/core_kernel.cma src/core_kernel.cmxa src/core_kernel.a
src/core_kernel.cmxs -use-ocamlfind -tag debug -j 8' terminated with
error code 10")
make: *** [build] Error 1
----------

That was the reason why I tried the stable branch. The OPAM packages
containing requested modules are installed, but apparently not linked
with.

I'm also not sure how to make test suits work. I used the distributed
tar ball, which compiles, but "make test" doesn't seem to do anything.
A document with contributor instructions would be really helpful.

Sylvain Le Gall

unread,
Sep 26, 2016, 2:55:49 AM9/26/16
to ocaml...@googlegroups.com
Hi,

Make sure you are not using OASIS 0.4.7, it has a bug with ocamlbuild plugin:

Markus Mottl

unread,
Sep 29, 2016, 4:54:45 PM9/29/16
to ocaml...@googlegroups.com
Hi Sylvain,

thanks for the tip, I've downgraded OASIS. Unfortunately, this didn't
solve this particular problem.

Regards,
Markus

Jeremie Dimino

unread,
Sep 30, 2016, 7:26:27 AM9/30/16
to ocaml...@googlegroups.com
Hi Markus,

I just gave it a try and I got the same error as you. However, the
error went away after a `git clean -dfx`. Maybe you have some stale
artifacts in your working copy?

Regarding tests, at the moment we only setup the minimum number of
build rules, i.e. only for what's installed. This is because we use a
different build system internally (jenga) and externally
(oasis/ocamlbuild) and even though the external one is generated, it
requires a lot of manual fixing as our internal code base evolve.

However, we are working on getting our jenga rules to work in the opam
world and making good progress. If you install jane-build [1] you
should be already be able to build our packages using jenga. Soon
you'll be able to run the tests by doing:

jane-build .runtest

in any of our git repositories. There are a few reasons why it doesn't work yet:

- many of our tests are using libraries that are not yet released such
as expect_test_helpers. They will be released in the coming weeks
- the jbuild files might refer to libraries by their internal names
instead of the findlib ones. For instance ppx_assert_lib instead of
ppx_assert.runtime-lib. This is being worked on as well

[1] https://github.com/janestreet/jane-build
Jeremie

Markus Mottl

unread,
Oct 2, 2016, 11:49:51 PM10/2/16
to ocaml...@googlegroups.com
Hi Jeremie,

thanks for the help. Indeed, the "git clean -dfx" fixed the
compilation problem with the stable release tag (not with the master
branch, though). It was probably due to stale files that weren't
reported with "git status". I'll just wait for your jenga build rules
to fully support everything before I'll try test suits. I guess for
the while being any worthwhile submissions can be easily tested by you
internally anyway.

Regards,
Markus

Markus Mottl

unread,
Oct 4, 2016, 3:16:37 PM10/4/16
to ocaml...@googlegroups.com
As I have just noticed, the OASIS downgrade was also necessary in
addition to "git clean -dfx". There were actually two problems.

I've just submitted a pull request to core_kernel to improve the
union-find implementation. The code will likely build with the master
branch, but I cannot say for sure as long as I can only build the last
release.

Yaron Minsky

unread,
Oct 4, 2016, 3:26:50 PM10/4/16
to ocaml...@googlegroups.com
Awesome! Thanks Markus. Sorry the build process wasn't entirely smooth, but we're working on it.

y


>>>>> >> For more options, visit https://groups.google.com/d/optout.
>>>>> >
>>>>> > --
>>>>> > You received this message because you are subscribed to the Google
>>>>> > Groups "ocaml-core" group.
>>>>> > To unsubscribe from this group and stop receiving emails from it, send

>>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Markus Mottl        http://www.ocaml.info        markus...@gmail.com
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups
>>>>> "ocaml-core" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an

>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "ocaml-core" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an

>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> Markus Mottl        http://www.ocaml.info        markus...@gmail.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+unsubscribe@googlegroups.com.

>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Jeremie
>>
>> --
>> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+unsubscribe@googlegroups.com.

>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Markus Mottl        http://www.ocaml.info        markus...@gmail.com



--
Markus Mottl        http://www.ocaml.info        markus...@gmail.com

--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages