Skip to content
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

ocamlbuild doesn't use build directory properly #4387

Closed
vicuna opened this issue Sep 13, 2007 · 3 comments
Closed

ocamlbuild doesn't use build directory properly #4387

vicuna opened this issue Sep 13, 2007 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Sep 13, 2007

Original bug ID: 4387
Reporter: rbornat
Assigned to: ertai
Status: closed (set by @xavierleroy on 2011-05-29T10:20:07Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10.0
Fixed in version: 3.11.2+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: rbornat

Bug description

I 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.

@vicuna
Copy link
Author

vicuna commented Sep 17, 2007

Comment author: ertai

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

Can you reproduce it on a tiny example?

Do you have a plugin?

@vicuna
Copy link
Author

vicuna commented Sep 19, 2007

Comment author: rbornat

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
. .. main.ml
[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.ml main.native

./_buildi386:
. .. _digests main.cmi main.cmo main.cmx main.ml main.ml.depends main.native main.o

./_buildppc:
. .. _digests main.native
[Richard-Bornats-MacBook:/Desktop/ocamlbuild bug] richard% cat main.ml
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%

@vicuna
Copy link
Author

vicuna commented Sep 20, 2007

Comment author: ertai

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant