Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006968OCamltools (ocaml{lex,yacc,dep,debug,...})public2015-08-24 17:212017-03-15 15:29
Reporterdbuenzli 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version4.02.3 
Target VersionFixed in Version 
Summary0006968: ocamldep -one-line doesn't work with -sort
Description> ocamldep -sort -one-line src/*.mli
src/uunf.mli src/uunf_string.mli
Tagsjunior_job
Attached Files

- Relationships

-  Notes
(0014379)
gasche (developer)
2015-08-24 17:33

The --help documentation is rather bad, but the semantics are as follow:

  -sort enabled: just output the list of files in topological order 
  -sort not enabled: output pairs (target_files : dependencies)
     -one-line enabled: all dependencies on one line
     -one-line not enabled: with line cuts to not overflow 80 columns


The semantics of (-sort -one-line) is currently not defined, and in fact the current implementation of -sort will always print the list of files on one line only.

Would you prefer the combination -sort -one-line to be rejected, or some other semantics to be given to it?
(0014380)
dbuenzli (reporter)
2015-08-24 17:49

I think it would be nice that it does what it is supposed to do. For example this could be useful for tools to correctly handle the cases when paths have spaces in them.
(0014381)
gasche (developer)
2015-08-24 18:01

I don't follow: what is `-sort -one-line` supposed to do? Can you explain why it does not do it?
(0014382)
dbuenzli (reporter)
2015-08-24 18:20

> ocamldep -sort -one-line src/*.mli
src/uunf.mli
src/uunf_string.mli
(0014383)
dbuenzli (reporter)
2015-08-24 18:21

Ah sorry just completely misundestood.
(0014384)
dbuenzli (reporter)
2015-08-24 18:21

My brain was reading one-per-line.
(0014385)
dbuenzli (reporter)
2015-08-24 18:24

Well actually it's not only my brain :

> ocamldep -help | grep "one-line"
  -one-line Output one line per file, regardless of the length
(0014386)
gasche (developer)
2015-08-24 18:39

The "one line per file" comment is trying to say that for each target, all its dependencies are displayed on the same line (instead of having line cuts to not overflow 80 columns).

Regardless of what the documentation says or the implementation does, I find the output you suggest rather counter-intuitive for an option whose name suggest that the output will be "on one line" -- and it would be contradictory with the behaviour of -one-line in absence of -sort, which is the one that is actually implemented and that (I suppose) some people use.

I'm open to suggestions of how to fix the documentation and/or implementation.
(0014392)
dbuenzli (reporter)
2015-08-25 15:46

Well I don't really care about the name but at least documentation should be fixed since reading:

> ocamldep -help | grep "sort\|one-line"
  -one-line Output one line per file, regardless of the length
  -sort Sort files according to their dependencies

You can legitimately see why I understand this that way. Besides I really think that what I understood should be provided. In the current state it's impossible to use ocamldep with file paths that have spaces in them.
(0014396)
gasche (developer)
2015-08-25 18:24

I do understand your point, and I agree the documentation should be fixed.

How does make handle files with spaces in them? ocamldep should be Makefile-compatible, but if for example always quoting filenames that have spaces preserves compatibility, we could do that.

(I would also be fine with changing "ocamldep -sort -one-line" to do as you expect. In that case, I would be interested in a suggestion for a -help message for -one-line and/or -sort that would clarify the behavior of -one-line both with and without -sort. Don't be shy, I know you rock at documentation.)
(0014397)
dbuenzli (reporter)
2015-08-25 19:27

> I would be interested in a suggestion for a -help message for -one-line and/or -sort that would clarify the behavior of -one-line both with and without -sort.

Well if you fix it for `-sort` then it makes all sense as it is no ?
(0014398)
gasche (developer)
2015-08-25 19:32

Fair enough. Thanks!

- Issue History
Date Modified Username Field Change
2015-08-24 17:21 dbuenzli New Issue
2015-08-24 17:33 gasche Note Added: 0014379
2015-08-24 17:49 dbuenzli Note Added: 0014380
2015-08-24 18:01 gasche Note Added: 0014381
2015-08-24 18:20 dbuenzli Note Added: 0014382
2015-08-24 18:21 dbuenzli Note Added: 0014383
2015-08-24 18:21 dbuenzli Note Added: 0014384
2015-08-24 18:24 dbuenzli Note Added: 0014385
2015-08-24 18:39 gasche Note Added: 0014386
2015-08-25 15:46 dbuenzli Note Added: 0014392
2015-08-25 18:24 gasche Note Added: 0014396
2015-08-25 19:27 dbuenzli Note Added: 0014397
2015-08-25 19:32 gasche Note Added: 0014398
2015-08-25 19:43 gasche Tag Attached: junior_job
2015-08-25 19:43 gasche Status new => confirmed
2016-02-03 12:51 doligez Target Version => 4.03.0+dev / +beta1
2016-04-15 15:50 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2016-12-07 16:37 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser,debug}) => OCaml tools (ocaml{lex,yacc,dep,debug})
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:45 doligez Category OCaml tools (ocaml{lex,yacc,dep,debug}) => tools (ocaml{lex,yacc,dep,debug,...})
2017-03-15 15:29 doligez Target Version undecided =>


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker