Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006098OCamlOCamlbuild (the tool)public2013-07-28 14:042014-04-02 16:42
Reportermeyer 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.01.1+dev 
Target Version4.01.1+devFixed 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:
debug
<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:

copts(-O3)
lopts(foo.cma)
I(ocamlbuild)

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
(0009934)
dbuenzli (reporter)
2013-07-28 14:21

I don't understand.
(0009936)
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:

O3

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:

ocamlopt(arm-gnueabi-linux-ocamlopt)
copts(-O3)

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

(0009937)
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.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker