Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005653OCamlOCamlbuild (the tool)public2012-06-18 23:252013-06-13 07:17
Reporterhongboz 
Assigned Tomeyer 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version4.01.0+devFixed in Version4.01.0+dev 
Summary0005653: unnecessary rebuild for some rules
DescriptionThis rule will rebuld cmxs everytime, as along as I don't have .so
rule "ocaml: mldylib & cmx* & o* -> cmxs & so"
  ~tags:["ocaml"; "native"; "shared"; "library"]
  ~prods:["%.cmxs"; x_dll]
  ~dep:"%.mldylib"
  (Ocaml_compiler.native_shared_library_link_mldylib "%.mldylib" "%.cmxs");;

This also applies this rule, when I only need build .cmx, it will rebuild .cmo
everytime since I need it to build cmi.
rule "ocaml: ml -> cmo & cmi"
  ~tags:["ocaml"]
  ~prods:["%.cmo"; "%.cmi"]
  ~deps:["%.ml"; "%.ml.depends"]
  (Ocaml_compiler.byte_compile_ocaml_implem "%.ml" "%.cmo");;
Since I switched to ocamlbuild, I found the performance degraded a lot.
It works, but it is really *slow*. It is possible to make the rules more customizable without introducing a big database with a lot of reduandance?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007572)
hongboz (developer)
2012-06-18 23:33

Just remove x_dll works, how do I tell ocamlbuild which rule is used first?
rule "ocaml: mldylib & cmx* & o* -> cmxs"
  ~tags:["ocaml"; "native"; "shared"; "library"]
  ~prods:["%.cmxs"]
  ~dep:"%.mldylib"
  (Ocaml_compiler.native_shared_library_link_mldylib "%.mldylib" "%.cmxs");;
  
Many thanks
(0007573)
gildor (developer)
2012-06-18 23:37

oasis 0.3 switches to always produce .cmxs and I see that rebuilding .cmxs is done everytime. This is quite annoying.

tip: set "./configure --override is_native false" to avoid that
(0008775)
meyer (developer)
2013-01-18 23:49
edited on: 2013-01-19 00:24

Use ~insert optional argument for rule to insert at given place the rule.

In your case:

rule "ocaml: mldylib & cmx* & o* -> cmxs"
  ~insert:`top
  ~tags:["ocaml"; "native"; "shared"; "library"]
  ~prods:["%.cmxs"]
  ~dep:"%.mldylib"
  (Ocaml_compiler.native_shared_library_link_mldylib "%.mldylib" "%.cmxs");;

should be enough to get your desired effect.

Another way of doing that would be to use Before_rules dispatch entry point.

Closing this PR, with a note that documentation should be updated reflecting this information.


- Issue History
Date Modified Username Field Change
2012-06-18 23:25 hongboz New Issue
2012-06-18 23:33 hongboz Note Added: 0007572
2012-06-18 23:37 gildor Note Added: 0007573
2012-06-18 23:41 hongboz Note Added: 0007574
2012-06-18 23:41 hongboz Note Deleted: 0007574
2012-07-06 15:22 doligez Target Version => 4.01.0+dev
2012-07-17 14:28 doligez Status new => acknowledged
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-10 05:10 meyer Assigned To => meyer
2012-09-10 05:10 meyer Status acknowledged => assigned
2012-09-21 14:32 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-01-18 23:49 meyer Note Added: 0008775
2013-01-18 23:49 meyer Note Edited: 0008775 View Revisions
2013-01-18 23:50 meyer Note Edited: 0008775 View Revisions
2013-01-18 23:50 meyer Status assigned => resolved
2013-01-18 23:50 meyer Resolution open => fixed
2013-01-19 00:24 meyer Note Edited: 0008775 View Revisions
2013-06-13 07:17 meyer Fixed in Version => 4.01.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker