Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004387OCaml-for ocamlbuild use 11:362011-05-29 12:20
Assigned Toertai 
PlatformOSOS Version
Product Version3.10.0 
Target VersionFixed in Version3.11.2+dev 
Summary0004387: ocamlbuild doesn't use build directory properly
DescriptionI try to use ocamlbuild to make two versions of an OCaml program. The two commands are

ocamlbuild -build-dir _buildi386 -lib unix main.native

ocamlbuild -build-dir _buildppc -lib unix -ocamlopt '/usr/local/bin/ocamloptppc -ccopt "-arch ppc" -nostdlib -I /usr/local/lib/ocamlppc' main.native

To make the second work, I must do ocamlbuild -clean between them. Without that, the second compilation terminates immediately without doing any work. I can't see what's being recorded to stop the compilations being independent.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
ertai (developer)
2007-09-17 16:32

I cannot reproduce the bug (at least with the last version).

Can you reproduce it on a tiny example?

Do you have a plugin?
rbornat (reporter)
2007-09-19 17:51

I don't have a plugin, so far as I know. (Actually I don't know what you are asking). Here's a little terminal log: nothing happens in the second build, and the main.native in _buildppc has the wrong architecture. After a -clean I get the right effect.

[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ls -a
. ..
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ocamlbuild -build-dir _buildi386 -lib unix main.native
Finished, 4 targets (0 cached) in 00:00:01.
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ocamlbuild -build-dir _buildppc -lib unix -ocamlopt '/usr/local/bin/ocamloptppc -ccopt "-arch ppc" -nostdlib -I /usr/local/lib/ocamlppc' main.native
Finished, 0 targets (0 cached) in 00:00:00.
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ls -Ra
. .. _buildi386 _buildppc _log main.native

. .. _digests main.cmi main.cmo main.cmx main.native main.o

. .. _digests main.native
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% cat
output_string stderr "hello world"
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% lipo !*
lipo -info */main.native
Non-fat file: _buildi386/main.native is architecture: i386
Non-fat file: _buildppc/main.native is architecture: i386
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ocamlbuild -clean
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% ocamlbuild -build-dir _buildppc -lib unix -ocamlopt '/usr/local/bin/ocamloptppc -ccopt "-arch ppc" -nostdlib -I /usr/local/lib/ocamlppc' main.native
Finished, 4 targets (0 cached) in 00:00:01.
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard% lipo -info */main.native Non-fat file: _buildi386/main.native is architecture: i386
Non-fat file: _buildppc/main.native is architecture: ppc
[Richard-Bornats-MacBook:~/Desktop/ocamlbuild bug] richard%
ertai (developer)
2007-09-20 14:19

Ok, I got it!

Thats the `link' feature that is mess up the whole thing.

As a workaround you can use the -no-links option to avoid creating these stupid links.

I've also fixed in CVS by automatically put -no-links when -build-dir is set.

- Issue History
Date Modified Username Field Change
2007-09-13 11:36 rbornat New Issue
2007-09-17 16:32 ertai Note Added: 0004149
2007-09-17 16:32 ertai Assigned To => ertai
2007-09-17 16:32 ertai Status new => assigned
2007-09-19 17:29 rbornat Note Added: 0004154
2007-09-19 17:42 rbornat Note Deleted: 0004154
2007-09-19 17:51 rbornat Note Added: 0004155
2007-09-20 14:19 ertai Note Added: 0004157
2008-10-06 11:40 ertai Category OCaml general => OCamlbuild
2009-12-07 09:58 xclerc Status assigned => resolved
2009-12-07 09:58 xclerc Fixed in Version => 3.11.2+dev
2009-12-07 09:58 xclerc Resolution open => fixed
2011-05-29 12:20 xleroy Status resolved => closed
2012-02-02 15:17 protz Category OCamlbuild => OCamlbuild (the tool)
2017-02-23 16:34 doligez Category OCamlbuild (the tool) => for ocamlbuild use [^]
2017-02-23 16:44 doligez Category for ocamlbuild use [^] => -for ocamlbuild use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker