Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004422OCamlOCamlbuild (the tool)public2007-10-16 05:172013-07-09 14:04
Reporterjessicah 
Assigned Toxclerc 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionunable to reproduce 
PlatformOSOS Version
Product Version3.10.0 
Target Version4.01.0+devFixed in Version 
Summary0004422: ocamlbuild doesn't rebuild some targets even though dependencies are rebuilt
DescriptionThis 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
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007740)
lefessan (developer)
2012-07-12 17:34

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.
 

- Issue History
Date Modified Username Field Change
2007-10-16 05:17 jessicah New Issue
2007-11-10 14:09 xleroy Status new => assigned
2007-11-10 14:09 xleroy Assigned To => ertai
2008-10-06 11:46 ertai Category OCaml general => OCamlbuild
2010-07-22 11:45 ertai Assigned To ertai => xclerc
2012-02-02 15:17 protz Category OCamlbuild => OCamlbuild (the tool)
2012-07-04 17:15 doligez Target Version => 4.00.0+dev
2012-07-12 17:34 lefessan Note Added: 0007740
2012-07-12 17:34 lefessan Status assigned => feedback
2012-07-12 21:59 doligez Target Version 4.00.0+dev => 4.01.0+dev
2012-07-31 13:37 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-06 19:22 frisch Target Version 4.00.1+dev => 4.00.2+dev
2013-07-09 14:04 doligez Status feedback => resolved
2013-07-09 14:04 doligez Resolution open => unable to reproduce
2013-07-09 14:04 doligez Target Version 4.00.2+dev => 4.01.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker