janestreet / jenga

Build system
90 stars 12 forks source link

js-build-style example #14

Open mattfair opened 9 years ago

mattfair commented 9 years ago

Trying to get the js-build-style working, when running setup.sh get the following error:

fatal: repository 'https://github.com/warrenharris/ounit/' not found

To fix this, you could change this to:

darcs get http://darcs.ocamlcore.org/repos/ounit

When I compile using jenga -progress examples I get:

clang: error: linker command failed with exit code 1 (use -v to see invocation)
- exit packages/core/lib core_config.mlh, 330ms, code 0
!!JengaRoot.ml : no .ml OR .mli for oUnit in packages/ounit
*** jenga: ERROR: packages/ounit/oUnit.pack-order: User-code raised exception
*** jenga: (Failure"no .ml OR .mli for oUnit in packages/ounit")
*** jenga: 108/169 targets are up to date
*** jenga: failed (#1, 2.558s, heap(Kb)= 15713/208640, major=1, stat=3371, digest=114, ls=201, db-save=1)
*** jenga: todo: 0 (108 / 169) !1 ~60 j=0+0 con=107 save=0 act=53, finished
*** jenga: ERROR: (summary) packages/ounit/oUnit.pack-order: User-code raised exception
*** jenga: (Failure"no .ml OR .mli for oUnit in packages/ounit")
*** jenga: build finished; not in polling mode so quitting
*** jenga: Quit; exit_code = 1

If I move x-files/ounit/jbuild to x-files/ounit/src/jbuild it seems to find the .ml files and get a little further in the compile process, but still seems to have a problem loading up lib module files like for oUnit2.

clang: error: linker command failed with exit code 1 (use -v to see invocation)
- exit packages/core/lib core_config.mlh, 333ms, code 0
*** jenga: ERROR: packages/ounit/src/oUnit2.cmi: No rule or source for: packages/ounit/src/oUnit2.cmi
*** jenga: 112/175 targets are up to date
*** jenga: failed (#1, 2.571s, heap(Kb)= 15724/208640, major=1, stat=3492, digest=118, ls=204, db-save=1)
*** jenga: todo: 0 (112 / 175) !1 ~62 j=0+0 con=111 save=0 act=57, finished
*** jenga: ERROR: (summary) packages/ounit/src/oUnit2.cmi: No rule or source for: packages/ounit/src/oUnit2.cmi
*** jenga: build finished; not in polling mode so quitting
*** jenga: Quit; exit_code = 1

To fix this, the x-files/ounit/src/jbuild file if I list each of the modules in the ounit/src directory in the (modules (list (....))), but it also works if I just remove the line (modules (list (oUnit))) with the exception of oUnitLoggerHTMLData.ml which is suppose to be a generated file from the myocamlbuild.ml file in the ounit package directory.

So my question is, how was this handled this file generation in the past or currently in other people's builds? If I manually build it from the command line, let the myocamlbuild.ml generate packages/ounit/_build/src/oUnitLoggerHTMLData.ml and copy it to x-files/ounit/src a clean build seems to works fine as it puts the missing file in the correct directory when setup.sh is run, but obviously this isn't an ideal solution. The ideal would to properly generate the file through Jenga.

As part of getting oUnit to compile I also had to set (extra_disabled_warnings (32 27 9 28 39 33))

ghost commented 9 years ago

I'm not surprised that this is broken. It was done as a proof of concept at some point but we haven't maintained it to follow external packages evolution. It might have been that oUnit was the only module at the time js-build-style was written.

mattfair commented 9 years ago

If you are interested, the js-build-style example fully builds using these changes:

1789e0a20bc9639ae745bffc20838c74be3ac83e 0f762334103944f7030d571758041f72082b4b42 51fb083ead8abc042512541f29ffd920d31393b3 6e74f6a105cdce80ad23ab7227514dde2dff6c44 1eca8f3f6c8e5ca7588fc1c26e9404c7748743bf

Changes:

Also to note for others who may see this and try to build it, it only compiles under linux.

jordwalke commented 8 years ago

Thank you for getting this example working @mattfair. I recall having trouble with it in the past.