Loading ...
Sorry, an error occurred while loading the content.

Ocamlbuild dependency

Expand Messages
  • Jianzhou Zhao
    Hi, How does Ocamlbuild know that it needs to recompile a target if the dependent libs of the target were updated? I set the dependent libs in myocamlbuld.ml
    Message 1 of 4 , Mar 30, 2011
    • 0 Attachment
      Hi,

      How does Ocamlbuild know that it needs to recompile a target if the
      dependent libs of the target were updated? I set the dependent libs in
      myocamlbuld.ml as
      ocaml_lib ~extern:true
      and also explicitly use the libs in _tags. But Ocamlbuild does not recompile
      the code if those libs were changed. I have to clean the target to force it
      to rebuild. Is there a better way to solve the problem?

      Thanks.
      --
      Jianzhou


      [Non-text portions of this message have been removed]
    • ygrek
      On Wed, 30 Mar 2011 14:06:54 -0400 ... Currently - no. But one can easily automate this : write myocamlbuild.ml to look into all included directories and
      Message 2 of 4 , Mar 30, 2011
      • 0 Attachment
        On Wed, 30 Mar 2011 14:06:54 -0400
        Jianzhou Zhao <jianzhou@...> wrote:

        > How does Ocamlbuild know that it needs to recompile a target if the
        > dependent libs of the target were updated? I set the dependent libs in
        > myocamlbuld.ml as
        > ocaml_lib ~extern:true
        > and also explicitly use the libs in _tags. But Ocamlbuild does not recompile
        > the code if those libs were changed. I have to clean the target to force it
        > to rebuild. Is there a better way to solve the problem?

        Currently - no. But one can "easily" automate this : write myocamlbuild.ml to look
        into all included directories and compute hash of all *.cm* files there and when the
        hash changes - trigger 'clean' target.
        See also http://caml.inria.fr/mantis/view.php?id=5101

        --
        ygrek
        http://ygrek.org.ua
      • Jianzhou Zhao
        ... What is the best way to compute such hash of these Ocaml objects? ... -- Jianzhou [Non-text portions of this message have been removed]
        Message 3 of 4 , Mar 30, 2011
        • 0 Attachment
          On Wed, Mar 30, 2011 at 3:27 PM, ygrek <ygrekheretix@...> wrote:

          >
          >
          > On Wed, 30 Mar 2011 14:06:54 -0400
          > Jianzhou Zhao <jianzhou@...> wrote:
          >
          > > How does Ocamlbuild know that it needs to recompile a target if the
          > > dependent libs of the target were updated? I set the dependent libs in
          > > myocamlbuld.ml as
          > > ocaml_lib ~extern:true
          > > and also explicitly use the libs in _tags. But Ocamlbuild does not
          > recompile
          > > the code if those libs were changed. I have to clean the target to force
          > it
          > > to rebuild. Is there a better way to solve the problem?
          >
          > Currently - no. But one can "easily" automate this : write myocamlbuild.mlto look
          > into all included directories and compute hash of all *.cm* files there and
          > when the
          >
          What is the best way to compute such hash of these Ocaml objects?


          > hash changes - trigger 'clean' target.
          > See also http://caml.inria.fr/mantis/view.php?id=5101
          >
          > --
          > ygrek
          > http://ygrek.org.ua
          >
          >



          --
          Jianzhou


          [Non-text portions of this message have been removed]
        • ygrek
          On Wed, 30 Mar 2011 16:59:39 -0400 ... Any reasonable hash will do, e.g. MD5 (implemented by Digest module in stdlib). -- ygrek http://ygrek.org.ua
          Message 4 of 4 , Mar 31, 2011
          • 0 Attachment
            On Wed, 30 Mar 2011 16:59:39 -0400
            Jianzhou Zhao <jianzhou@...> wrote:

            > What is the best way to compute such hash of these Ocaml objects?

            Any reasonable hash will do, e.g. MD5 (implemented by Digest module in stdlib).

            --
            ygrek
            http://ygrek.org.ua
          Your message has been successfully submitted and would be delivered to recipients shortly.