Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006098OCaml-for ocamlbuild use 14:042017-03-01 16:35
Assigned To 
PlatformOSOS Version
Product Version4.01.1+dev 
Target VersionFixed in Version 
Summary0006098: Global predicates
DescriptionIn ocamlbuild we use _tags to associate predicate with list of tags.
Sometimes it's useful to associate globally set tags, usually it's done in such way:

true: debug
<src/*>: package(foo)

here debug is universally global tag associated with any path in the source tree

Nothing stops us however say this:
<src/*>: package(foo)

this has the following advantage: it syntactically restrict the tag to work only in global scope. It might be useful for example when mirroring the commandline options as tags:


If the tags where defined using predicate, it might be more difficult to support it in a sane way.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
dbuenzli (reporter)
2013-07-28 14:21

I don't understand.
meyer (developer)
2013-07-28 14:32
edited on: 2013-07-28 14:33

OK. Let me explain.

Normally you define your tags using predicates like this:

<src/*.{ml,c}> and <**/test*>: debug

debug tag will be defined for every source file in src/ directory having an extension of ml or and prefixed with test.

Sometimes however we don't want to associate a predicate with the tag, but instead just want to define a global tag that always holds when it's possible:


for the first tag O3 the C compiler will receive an option -O3.
It's fine to say also:

<ccode/*>: O3

It would also allow to use the tags for ocamlbuild itself:


In the later case, it's not possible to associate any predicate, as ocamlbuild is invoked once for the source tree.

meyer (developer)
2013-07-28 14:49

Acutally hold on, it's still possible to do it for ocamlbuild, because the command line options might have the same name, and we specify targets in ocamlbuild, therefore

ocamlbuild bar/foo.cma
ocamlbuild baz/main.native

and for this _tags:

<bar/foo.cma>: copts(O3)
<baz/*>: ocamlopt(arm-gnueabi-linux-ocamlopt)

So we would have an isomorphism between tags and command line options, possibly dropping completely command line options and replacing with tags.
doligez (administrator)
2017-03-01 16:35

ocamlbuild is now a separate project that lives on GitHub.
PR transferred to [^]

- Issue History
Date Modified Username Field Change
2013-07-28 14:04 meyer New Issue
2013-07-28 14:21 dbuenzli Note Added: 0009934
2013-07-28 14:32 meyer Note Added: 0009936
2013-07-28 14:33 meyer Note Edited: 0009936 View Revisions
2013-07-28 14:33 meyer Note Edited: 0009936 View Revisions
2013-07-28 14:49 meyer Note Added: 0009937
2014-04-02 16:42 doligez Status new => acknowledged
2014-05-25 20:24 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-21 11:44 doligez Target Version 4.02.0+dev =>
2017-02-23 16:34 doligez Category OCamlbuild (the tool) => for ocamlbuild use [^]
2017-02-23 16:44 doligez Category for ocamlbuild use [^] => -for ocamlbuild use [^]
2017-03-01 16:35 doligez Note Added: 0017522
2017-03-01 16:35 doligez Status acknowledged => resolved
2017-03-01 16:35 doligez Resolution open => suspended

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker