Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006087OCamlOCamlbuild (the tool)public2013-07-26 14:512014-07-24 22:55
Reporterdbuenzli 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version4.00.0 
Target Version4.02.0+devFixed in Version 
Summary0006087: ocamlbuild, improve _tags parsing and error report
DescriptionGreat to see there are people willing to improve ocamlbuild !

So here are a few things:

1) The following _tags file works:

true : package(gg), \
package(vg)

2) But not the following one:

true : \
package(gg), package(vg)

3) Neither the following one:

true \
: package(gg), package(vg)

Could we

a)
Either be more consistant in the \ treatement or even better, avoid it altogether (I don't know if it would render the grammar ambiguous)

b)
Have a gnu-style error messages (http://www.gnu.org/prep/standards/standards.html#Errors [^])
so that we can easily jump to the location of the error from our editors. This is what is currently reported:

Lexical analysis error: _tags: Bad key in configuration line at line 1 (from file: "_tags")

Tagsjunior_job
Attached Files

- Relationships
related to 0005212assigned ocamlbuild does not warn for bad input 
related to 0004598assigneddoligez Loc.to_string: bad support for multiple lines 

-  Notes
(0009869)
gasche (developer)
2013-07-26 18:40

Thanks, this kind of bug report is indeed helpful to give us a concrete repro case to work on.

(a) should definitely be fixed (\ should not change the validity of the syntax unless it splits words)

I'm not sure about (b) GNU style error messages; I think we should rather follow the global convention of the OCaml compiler error messages (which means that if you run ocamlbuild from any place that knows how to parse those messages, such as Emacs "compile" mode, you'll get the location parsed as well). Enabling GNU style error messages instead of the current one OCaml uses is a distribution-wide issue that has been discussed in the past (I think having patches for this would be interesting, but it's not on my radar of urgent things to do right now).
(0009871)
meyer (developer)
2013-07-26 19:04

Regarding (b): Maybe we can provide a flag for GNU message format. It's additional maintainance cost but probably relaively minimal.

I'd do the same for the rest of the toolchain where it's possible, but not that that I don't like the current situation.
(0009872)
dbuenzli (reporter)
2013-07-26 19:12

(b) Having what the general toolchain does is fine with me and I'd rather avoid adding new flags to the tools for that kind of details.
(0009873)
meyer (developer)
2013-07-26 19:38

OK, we should then be fixing it, so it behaves like the rest of the system, along with the newline separator fix. Thanks for the report.
(0009874)
meyer (developer)
2013-07-26 19:41

Let's tentatively schedule the fix for the release, it might slip away, but at least better support for Emacs mode is important, and comes at minimal cost and risk.

The other interesing way of dealing it with newlines would be via identation, so the spaces in the begining of line would be significant. (my mistake I am reporting it at the moment)
(0009984)
dbuenzli (reporter)
2013-07-29 16:20

Note error also occurs when you have a space (0x20) at the end of a _tags file line. Could you also check that please.

> hexdump -C _tags
00000000 74 72 75 65 3a 20 70 61 63 6b 61 67 65 28 67 67 |true: package(gg|
00000010 29 20 |) |
00000012
> ocamlbuild test.native
Lexical analysis error: _tags: Bad values in configuration line at line 1 (from file: "_tags")
(0010199)
doligez (administrator)
2013-08-19 16:42

Note for the future: the toolchain's error report format will have to be changed at some point because it gives: (filename, line, char1, char2) where char1 and char2 relative to the beginning of line, while emacs wants (filename, line1, char1, line2, char2) where char2 is relative to the beginning of line2. (see 0004598)
(0010202)
dbuenzli (reporter)
2013-08-19 17:00

Since it has to change anyways why not switch GNU style error messages (which are detected by default by emacs's compilation mode) ?
(0011908)
doligez (administrator)
2014-07-24 22:55

That's what I intend to do.

- Issue History
Date Modified Username Field Change
2013-07-26 14:51 dbuenzli New Issue
2013-07-26 18:35 gasche Relationship added related to 0005212
2013-07-26 18:40 gasche Note Added: 0009869
2013-07-26 18:40 gasche Assigned To => gasche
2013-07-26 18:40 gasche Status new => confirmed
2013-07-26 18:40 gasche Assigned To gasche =>
2013-07-26 18:41 gasche Assigned To => gasche
2013-07-26 18:41 gasche Status confirmed => assigned
2013-07-26 18:41 gasche Target Version => 4.01.1+dev
2013-07-26 19:04 meyer Note Added: 0009871
2013-07-26 19:12 dbuenzli Note Added: 0009872
2013-07-26 19:38 meyer Note Added: 0009873
2013-07-26 19:38 meyer Target Version 4.01.1+dev => 4.01.0+dev
2013-07-26 19:41 meyer Note Added: 0009874
2013-07-28 09:05 gasche Tag Attached: junior_job
2013-07-29 16:20 dbuenzli Note Added: 0009984
2013-08-19 16:42 doligez Note Added: 0010199
2013-08-19 16:42 doligez Target Version 4.01.0+dev => 4.01.1+dev
2013-08-19 16:42 doligez Relationship added related to 0004598
2013-08-19 17:00 dbuenzli Note Added: 0010202
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-24 22:55 doligez Note Added: 0011908


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker