|Anonymous | Login | Signup for a new account||2016-08-29 05:49 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005406||OCaml||OCamlbuild (the tool)||public||2011-11-22 23:55||2014-08-19 13:23|
|Target Version||4.02.0+dev||Fixed in Version||4.02.0+dev|
|Summary||0005406: tag does not expect a parameter, but is used with parameter ...|
|Description||ocamlbuild warns for something strange. For example :|
# ocamlbuild -pkgs lablgtk2 -tags warn_s tree.byte
Warning: tag "package" does not expect a parameter, but is used with parameter "lablgtk2"
Finished, 3 targets (0 cached) in 00:00:00.
Attached is file tree.ml taken from lablgtk2
|Attached Files||tree.ml [^] (3,352 bytes) 2011-11-22 23:55 [Show Content]|
This is not really a bug; if you use any ocamlfind feature,
you should pass the "-use-ocamlfind" command-line
switch to ocamlbuild. It will make the warning disappear.
|ok that works. But we are not supposed to know that using "pkgs" option also requires "use-ocamlfind" option. If "pkgs" is an ocamlfind feature, then why not activate "use-ocamlfind" at the same time? Or why not activate ocamlfind all the time?|
|or make the warning say what it means. I.e. when tag with unexpected parameter is "package" hint the user that -use-ocamlfind is required.|
|Since the problem will go away after we implement -use-ocamlfind by default, I think the good fix for that would be to document the command line options that are not available with -no-ocamlfind, but also implement proper messages for all of them, and just halt the compilation with error if they are used with -no-ocamlfind.|
|Recording which command-line options and tags depend on the `-use-ocamlfind` option and reporting an error when they're used otherwise should be reasonably easy (marked as "junior job"). The trunk now uses -use-ocamlfind by default, but supporting -no-ocamlfind scenarios will still be useful for 4.01 (and possibly bugfixes releases).|
|The problem should go away on trunk even when not using -use-ocamlfind, william, could you test it, and indeed see it's working?|
edited on: 2013-08-01 00:56
* ocamlbuild -pkgs lablgtk2 -tags warn_s tree.byte
* ocamlbuild -no-ocamlfind -pkgs lablgtk2 -tags warn_s tree.byte
gets the same strange warning : tag "package" does not expect a parameter, but is used with parameter "lablgtk2".
then there is an error (as modules from lablgtk2 are not found).
raising error explaining that "-pkgs" is not compatible with "-no-ocamlfind" would be more expressive for an end user point of view.
Right, it's not so obvious how to do this, and I'd like to postpone it for the next release. I care about the quality of such patches. If you write a good patch for it I will apply it straight away. And we need proper testing of these, preferable through the ocamlbuild testsuite.
There are two things that matter here:
* with the switches certain order is important, some of the flags just preclude other ones, but still you have a space for detecting these, and marking them redundant
* with the tags, the predicates might not trigger the tags to be included, especially the check might happen dynamically as the dependencies come.
so proper fix, is to just use proper heuristics, and just be simple.
Patches are always warmly welcome. Thank you.
> with the tags, the predicates might not trigger the tags to be included,
> especially the check might happen dynamically as the dependencies come.
I think that a tag that is never triggered by any dependency of any reasonable target for the project should ultimately trigger a warning, because it may be a typo (and is useless). I mentioned this in PR#5212, and I think that would an important but difficult improvement to OCamlbuild's usability.
So I think it's fine if we warn on cases where the tag would actually never have been used. I would be of the opinion to have a way to mark dependencies of some tags over some configuration options (may also be useful for, say, potential menhir-specific tags), and simply refuse to work (with a proper error message) when those dependencies are not satisfied.
Fixed in 4.02@15112.
There is something subtle here, which is that the -pkg option *can work* without -use-ocamlfind, it only uses a different (and somewhat complex and possibly fragile that I'm glad most users don't rely on anymore) way to do things, which is to call Findlib internally instead of offloading the work to ocamlfind. So the patch disables the warning, but it does not make mandatory to pass -use-ocamlfind in these circumstances.
|2011-11-22 23:55||william||New Issue|
|2011-11-22 23:55||william||File Added: tree.ml|
|2011-11-23 10:39||xclerc||Note Added: 0006208|
|2011-11-23 10:39||xclerc||Status||new => closed|
|2011-11-23 10:39||xclerc||Resolution||open => no change required|
|2011-11-26 12:17||william||Note Added: 0006210|
|2011-11-26 12:17||william||Status||closed => feedback|
|2011-11-26 12:17||william||Resolution||no change required => reopened|
|2011-11-28 13:56||ygrek||Note Added: 0006211|
|2012-02-02 15:17||protz||Category||OCamlbuild => OCamlbuild (the tool)|
|2012-03-29 19:14||gasche||Relationship added||related to 0005547|
|2012-07-10 13:08||doligez||Target Version||=> 4.01.0+dev|
|2012-07-31 13:36||doligez||Target Version||4.01.0+dev => 4.00.1+dev|
|2012-09-10 05:30||meyer||Assigned To||=> meyer|
|2012-09-10 05:30||meyer||Status||feedback => assigned|
|2012-09-10 05:36||meyer||Note Added: 0008044|
|2012-09-20 16:50||doligez||Target Version||4.00.1+dev => 4.01.0+dev|
|2013-07-29 09:09||gasche||Note Added: 0009972|
|2013-07-29 09:09||gasche||Tag Attached: junior_job|
|2013-07-30 19:18||meyer||Note Added: 0010011|
|2013-07-30 19:18||meyer||Status||assigned => feedback|
|2013-08-01 00:55||william||Note Added: 0010046|
|2013-08-01 00:55||william||Status||feedback => assigned|
|2013-08-01 00:56||william||Note Edited: 0010046||View Revisions|
|2013-08-03 00:28||meyer||Note Added: 0010084|
|2013-08-03 06:46||gasche||Note Added: 0010086|
|2013-08-14 09:22||doligez||Target Version||4.01.0+dev => 4.01.1+dev|
|2014-01-21 14:01||doligez||Assigned To||meyer =>|
|2014-05-25 20:20||doligez||Target Version||4.01.1+dev => 4.02.0+dev|
|2014-08-19 13:23||gasche||Note Added: 0012020|
|2014-08-19 13:23||gasche||Status||assigned => resolved|
|2014-08-19 13:23||gasche||Fixed in Version||=> 4.02.0+dev|
|2014-08-19 13:23||gasche||Resolution||reopened => fixed|
|2014-08-19 13:23||gasche||Assigned To||=> gasche|
|Copyright © 2000 - 2011 MantisBT Group|