From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C130E7EE78 for ; Tue, 12 Apr 2016 15:15:58 +0200 (CEST) IronPort-PHdr: 9a23:LG8H9x150ZTs45XHsmDT+DRfVm0co7zxezQtwd8ZsegeI/ad9pjvdHbS+e9qxAeQG96Lu7QZ0qGK7OjJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZnunLzts7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYjck87NZNWrnWeKExTLoQTGh3cjN92Mq+nhnZTBCT4WMcZUWInRdSS1zO7Av7RYv2qiu8tu1w1ySAFdHrCLo5QzCj6eFnRUm7pj0AMmsQ62HWkcw4pa1Sug2oo1QryoHdep6cMKMvIf71ctYTRG4HVcFUAX8SSrigZpcCWrJSdd1TqJPw8gdfoA== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=agarwal1975@gmail.com; spf=Pass smtp.mailfrom=agarwal1975@gmail.com; spf=None smtp.helo=postmaster@mail-qg0-f41.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.192.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.192.41 as permitted sender) identity=mailfrom; client-ip=209.85.192.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qg0-f41.google.com) identity=helo; client-ip=209.85.192.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-qg0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CQAADI9AxXiynAVdFeg1U1fQaoNYFRhV2DS4JAhHMBDYF0IYVsAoEqBzgUAQEBAQEBAQERAQEBCAsLCR8xgi2CFQEBBBIRHQEbEgsBAwwGAwILDQ0dAgIiAREBBQEKEgYTEhCHbwEDEg6RJ49BgTE+MYs2gWqCV4dtChknAwpRhE4BAQEBAQEBAwEBAQEBAQETAQUKBYpdhGyCU4JWAQSGMQyRQggBgSGEVogWgjWMW41qER6BDg8PAQGCOR6BbiAwigUBAQE X-IPAS-Result: A0CQAADI9AxXiynAVdFeg1U1fQaoNYFRhV2DS4JAhHMBDYF0IYVsAoEqBzgUAQEBAQEBAQERAQEBCAsLCR8xgi2CFQEBBBIRHQEbEgsBAwwGAwILDQ0dAgIiAREBBQEKEgYTEhCHbwEDEg6RJ49BgTE+MYs2gWqCV4dtChknAwpRhE4BAQEBAQEBAwEBAQEBAQETAQUKBYpdhGyCU4JWAQSGMQyRQggBgSGEVogWgjWMW41qER6BDg8PAQGCOR6BbiAwigUBAQE X-IronPort-AV: E=Sophos;i="5.24,474,1454972400"; d="scan'208,217";a="213670248" Received: from mail-qg0-f41.google.com ([209.85.192.41]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 12 Apr 2016 15:15:55 +0200 Received: by mail-qg0-f41.google.com with SMTP id f52so14940337qga.3 for ; Tue, 12 Apr 2016 06:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eq7RUnxnjcyO48zzrX8VqQ8V8e+GRu/4qUHOnMtmUMU=; b=lSDp7u/UpSFEeLX6/ZkGuKjVnPE1v+frcD4wAgUTx5JNUL8TOB+KubdWE8yoBTNptn ou7AaPDd/+7XHidu7AThhmb+KeppU3swAqx5tL1z9g8Pi+5EtIWeH3DE2xpcshts7hjr ZVJM4D44gbyPeVmkIuZi3fnDu1oF2gPtkK7DMD0mUs4zDdX4VQ9rF1o5AY/a64780yzJ ZSynU5loqroySz4hg8p5s+5crHqJ2ffHzmrAYZkvHuODgt7b+k4H4CjqUQIazDMRssiA P0aw9WTLMo891qAHa06km4aA4vZazbzBbVHnt2Y/DkW+ofdqNucKRpXJEPyt6AN9qVF4 uCfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eq7RUnxnjcyO48zzrX8VqQ8V8e+GRu/4qUHOnMtmUMU=; b=JdKgoF4zTheamwLPHLYZBhvZgNPegOO0UW519oLwzwJgqEXMQYL3BCurLqcZRh7y7X seVE+esSPjINMQXfUOry+anAp0OYS1oaLmEFmWQsmp4Dr85sn2z+kMlon6m+2jFE7w2q sSsg/ywnftcMFXs3My+oXen8SsaPMnNn8GQKoKMH+xzNa7X3aNTv0CcQHkol9odi57cr 0zbNMqPYGrsZE3OOJ64gr2nX6Vum6a3eZe7O8DoNIh+a0wW5YFge8KPfNvCmeaKUXmTI +hD488NojguTqHqkrKBVuhKZgGQusHKaGnTm7t33liDVONfb3ANCDluLfLm37LBHrFwe 8tSw== X-Gm-Message-State: AOPr4FWyUE/LZLWY8d1Ul15zNZC/X52LcvtC22YJWBlzE8rgvhQWqymslxkeYhXrUrsUPoNgcz7+8+8XvIlf2g== X-Received: by 10.140.179.15 with SMTP id z15mr3863563qhz.79.1460466953262; Tue, 12 Apr 2016 06:15:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.158.20 with HTTP; Tue, 12 Apr 2016 06:15:33 -0700 (PDT) In-Reply-To: <570CF14F.3080801@tu-berlin.de> References: <570CE35A.4090709@tu-berlin.de> <570CF14F.3080801@tu-berlin.de> From: Ashish Agarwal Date: Tue, 12 Apr 2016 09:15:33 -0400 Message-ID: To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: caml users Content-Type: multipart/alternative; boundary=001a113aab0ef49ae00530497598 Subject: Re: [Caml-list] glob-ing dependencies for a custom ocamlbuild rule --001a113aab0ef49ae00530497598 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Apr 12, 2016 at 8:59 AM, Christoph H=C3=B6ger < christoph.hoeger@tu-berlin.de> wrote: _all_ source files in I think that is Gabriel's point. The definition of _all_ depends on when you think this pattern will be evaluated. It would be a major PITA to add all these files manually... > Not really. The nice thing about ocamlbuild is that you can write arbitrary OCaml code, so just compute deps by traversing the directory yourself. Am 12.04.2016 um 14:48 schrieb Gabriel Scherer: > > Ocamlbuild distinguishes "static dependencies", which are expressed in > > the ~deps argument of the rule declaration, and "dynamic dependencies" > > which are files required by the rule command. > > > > The notion of pattern accepted for static dependencies is indeed > > rather rigid (less expressive than the patterns used in the _tags > > file), and what you have in mind does not work. The supported patterns > > are deterministic: given one file, there is a unique way a pattern can > > match, and a pattern is instantiated into a single file by any > > substitution environment. There is a good reason for that: it is not > > clear what the semantics of your proposal would be. Indeed, ocamlbuild > > tries to recursively build all static dependencies before deciding to > > apply a rule, but what does it mean to build all **/*.mo? Listing the > > one that exist in the source directory is easy, but how would you > > guess which one to try to build recursively using other rules? > > > > Notions such as "all files matching P in this directory" are not > > stable to the replacement of a source file by an intermediate target: > > for example if tomorrow you decide that one of the .mo file will be > > itself pre-processed from a .mo.pp file, it won't be seen by a > > existing-file globbing technique anymore. You have a lot of > > flexibility in the behaviors you implement in the build command, so > > you can easily do the matching there and "build" those files, but it > > will result in a relatively fragile rule; this is you decision to > > make, and not in the path of least resistance. > > > > > > On Tue, Apr 12, 2016 at 8:00 AM, Christoph H=C3=B6ger > > wrote: > >> Dear all, > >> > >> I want to write a custom ocamlbuild rule that basically combines all > >> source files from a given (sub-)directory and thus depends on these > files. > >> > >> However, the following does not work: > >> > >> rule "normalize (preprocess) a Modelica library" > >> ~prods:["%.modlib.impl"; "%.modlib.sign"] > >> ~deps:["%.modlib/**/*.mo"; "%.modlib.depends"] > >> ~doc:"Preprocesses a Modelica library" > >> modlibc_command > >> > >> It seems that the rule does not expand the pattern in the dependency. = Is > >> there a way to achieve something similar? It would be a major PITA to > >> add all these files manually... > >> > >> regards, > >> > >> Christoph > >> -- > >> Christoph H=C3=B6ger > >> > >> Technische Universit=C3=A4t Berlin > >> Fakult=C3=A4t IV - Elektrotechnik und Informatik > >> =C3=9Cbersetzerbau und Programmiersprachen > >> > >> Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > >> > >> Tel.: +49 (30) 314-24890 > >> E-Mail: christoph.hoeger@tu-berlin.de > >> > >> -- > >> Caml-list mailing list. Subscription management and archives: > >> https://sympa.inria.fr/sympa/arc/caml-list > >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > >> Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > -- > Christoph H=C3=B6ger > > Technische Universit=C3=A4t Berlin > Fakult=C3=A4t IV - Elektrotechnik und Informatik > =C3=9Cbersetzerbau und Programmiersprachen > > Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > > Tel.: +49 (30) 314-24890 > E-Mail: christoph.hoeger@tu-berlin.de > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a113aab0ef49ae00530497598 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Apr 12, 2016 at 8:59 AM, Christoph H=C3=B6ger <christoph.h= oeger@tu-berlin.de> wrote:

_all_ source files in <dir>

I think = that is Gabriel's point. The definition of _all_ depends on when you th= ink this pattern will be evaluated.


It would be a major PITA to=C2=A0add all these files manu= ally...

Not really. The nice thing abou= t ocamlbuild is that you can write arbitrary OCaml code, so just compute de= ps by traversing the directory yourself.



Am 12.04.2016 um 14:48 schrieb Gabriel Scherer:
> Ocamlbuild distinguishes "static dependencies", which are ex= pressed in
> the ~deps argument of the rule declaration, and "dynamic dependen= cies"
> which are files required by the rule command.
>
> The notion of pattern accepted for static dependencies is indeed
> rather rigid (less expressive than the patterns used in the _tags
> file), and what you have in mind does not work. The supported patterns=
> are deterministic: given one file, there is a unique way a pattern can=
> match, and a pattern is instantiated into a single file by any
> substitution environment. There is a good reason for that: it is not > clear what the semantics of your proposal would be. Indeed, ocamlbuild=
> tries to recursively build all static dependencies before deciding to<= br> > apply a rule, but what does it mean to build all **/*.mo? Listing the<= br> > one that exist in the source directory is easy, but how would you
> guess which one to try to build recursively using other rules?
>
> Notions such as "all files matching P in this directory" are= not
> stable to the replacement of a source file by an intermediate target:<= br> > for example if tomorrow you decide that one of the .mo file will be
> itself pre-processed from a .mo.pp file, it won't be seen by a
> existing-file globbing technique anymore. You have a lot of
> flexibility in the behaviors you implement in the build command, so
> you can easily do the matching there and "build" those files= , but it
> will result in a relatively fragile rule; this is you decision to
> make, and not in the path of least resistance.
>
>
> On Tue, Apr 12, 2016 at 8:00 AM, Christoph H=C3=B6ger
> <christoph.hoeger@= tu-berlin.de> wrote:
>> Dear all,
>>
>> I want to write a custom ocamlbuild rule that basically combines a= ll
>> source files from a given (sub-)directory and thus depends on thes= e files.
>>
>> However, the following does not work:
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rule "normalize (preprocess)= a Modelica library"
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~prods:["%.modlib.imp= l"; "%.modlib.sign"]
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~deps:["%.modlib/**/*= .mo"; "%.modlib.depends"]
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~doc:"Preprocesses a = Modelica library"
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0modlibc_command
>>
>> It seems that the rule does not expand the pattern in the dependen= cy. Is
>> there a way to achieve something similar? It would be a major PITA= to
>> add all these files manually...
>>
>> regards,
>>
>> Christoph
>> --
>> Christoph H=C3=B6ger
>>
>> Technische Universit=C3=A4t Berlin
>> Fakult=C3=A4t IV - Elektrotechnik und Informatik
>> =C3=9Cbersetzerbau und Programmiersprachen
>>
>> Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin
>>
>> Tel.: +49 (30) 314-24890
>> E-Mail: christoph= .hoeger@tu-berlin.de
>>
>> --
>> Caml-list mailing list.=C2=A0 Subscription management and archives= :
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/g= roup/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


--
Christoph H=C3=B6ger

Technische Universit=C3=A4t Berlin
Fakult=C3=A4t IV - Elektrotechnik und Informatik
=C3=9Cbersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: = +49 (30) 314-24890
E-Mail: christoph.hoeger@t= u-berlin.de

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a113aab0ef49ae00530497598--