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 rebuild some targets even though dependencies are rebuilt #4422

Closed
vicuna opened this issue Oct 16, 2007 · 1 comment
Closed

Comments

@vicuna
Copy link

vicuna commented Oct 16, 2007

Original bug ID: 4422
Reporter: jessicah
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2015-12-11T18:20:55Z)
Resolution: unable to duplicate
Priority: normal
Severity: major
Version: 3.10.0
Target version: 4.01.0+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues

Bug description

This is probably user-error, as I can't find quite enough documentation on ocamlbuild, being how new and experimental it is... ;-)

I have a myocamlbuild plugin that replaces the link step using ocamlopt to a custom command using ld, but sometimes it doesn't perform this part of the build even if dependencies were rebuilt.

My ocamlbuild plugin looks something like:

let ld_linker tags deps out =
Cmd (S [A"ld"; A"-nostdlib"; A"-export-dynamic"; A"-T";
A"../libkernel/kernel.lds"; flags_of_pathname out;
A"-s"; P"startup/stage1.o"; P"startup/stage2.o";
P"libasmrun/libasmrun.a";
atomize_paths deps; T tags; A"-o"; Px out]);;

let ld_native_link x =
OComp.link_gen "cmx" "cmxa" "a" ["o"; "cmi"] ld_linker
(fun tags -> tags++"ocaml"++"link"++"native"++"program") x;;

rule "cmx* & o* -> native"
~tags:["ocaml"; "native"; "program"]
~prod:"%.native"
~deps:["%.cmx"; "%.o"; "%.startup"]
~insert:`top
(ld_native_link "%.cmx" "%.native");;

Pathname.define_context "" ["snowflake"; "snowflake/net"];;

In the root dir, I have snowflake.ml, that calls a function in a module, snowflake/soundblaster16.ml.

Often times, when I make changes to soundblaster16.ml and run ocamlbuild, it will rebuild soundblaster16.ml, but it doesn't rebuild snowflake.native.

I often end up having to clean my tree and start building from scratch to get a successful build, which is frustrating. Things like changing the values of constants always fails to trigger a rebuild of snowflake.native.

Thanks,

Jessica

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @lefessan

I cannot reproduce the bug. Please provide sources and a method to trigger the bug, i.e. some changes that are not detected by ocamlbuild.

There used to be a problem because .cmx files don't change when you just modify constants in the code, so digest-base build tools don't rebuild in this case, but this is fixed in ocamlbuild thanks to a dependency towards the .o file.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 19, 2019
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