Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006628OCamlmiscpublic2014-10-26 08:592016-12-07 11:49
Assigned Todoligez 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformallOSallOS Versionall
Product Version4.02.1 
Target VersionFixed in Version4.02.2+dev / +rc1 
Summary0006628: Configure script reject legitimate arguments
DescriptionThe configuration script says

if echo "$configure_options" | grep -q -e '--\?[a-zA-Z0-9-]\+='; then
  err "Arguments to this script look like '-prefix /foo/bar', not '-prefix=/foo/bar' (note the '=')."

This is broken because it matches legitimate arguments, like:

-cc "gcc48 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing"

Fix: Do not try to pseudo-validate input in a broken way. We could report suspicious arguments in the `case` analyse of these, if this is important.
Steps To Reproduce./configure -cc "gcc48 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing"
TagsNo tags attached.
Attached Filesdiff file icon patch-ocaml-configure.diff [^] (556 bytes) 2014-10-27 12:26 [Show Content]

- Relationships
has duplicate 0006867closedgasche configure script is not accepting compiler flags 

-  Notes
gasche (administrator)
2014-10-26 09:24

I suppose it is important for usability, because otherwise users could try to use this syntax and be surprised by obscure failures.

Would you propose a good patch to fix this issue?
michipili (reporter)
2014-10-27 12:29
edited on: 2014-10-27 12:29

Here it is!

I also propose another error message, as the previous is not very clear. Until I read the source, I understood it as if it referred to the *actual* arguments of the script. A more correct statement could have been “This script expects arguments looking like '-prefix /foo/bar', not '-prefix=/foo/bar' (note the '=').”.

gasche (administrator)
2014-10-30 11:41

Damien fixed this upstream (using a slightly different test and error message), thanks!
michi (reporter)
2015-05-03 15:15

Can we reopen this issue? The argument validation stroke two new FreeBSD users, and I asked them
to describe their use-case here.

Argument validation is expected to make people life's easier. Is there some of these people?
I am asking because there is a few people whose life is made a bit harder because of this
validation! :)
gasche (administrator)
2015-05-03 15:47

The reason I closed this issue is because of this commit by Damien: [^]

This change is not part of any released OCaml version so far (it should be part of the next release), so when you say "stroke two new users" I'm not sure whether you mean that even this refined test is not correct, or just that they were hit with the same old bug with the released version.

I tested that the configure command you provide works fine under not-yet-released versions (for example the stable 4.02 branch). If you are not sure whether the above patch fixes the issues that those two new users have, yet don't want to setup an experimental version just for this, I would be glad to test proposed inputs and report whether they are still problematic.
michi (reporter)
2015-05-03 16:13

> This change is not part of any released OCaml version so far

Ooooh, there is a bit of a misunderstanding here! Thank you for pointing out that!

I erroneously assumed the change would be in 4.02.1 – maybe I should have read better the “fixed in” field. So we can keep this issue closed, add the patch in FreeBSD and remove it as 4.02.2 arrives.

Thank you for the clarification!

- Issue History
Date Modified Username Field Change
2014-10-26 08:59 michipili New Issue
2014-10-26 09:24 gasche Note Added: 0012438
2014-10-27 12:27 michipili File Added: patch-ocaml-configure.diff
2014-10-27 12:29 michipili Note Added: 0012441
2014-10-27 12:29 michipili Note Edited: 0012441 View Revisions
2014-10-30 11:41 gasche Note Added: 0012471
2014-10-30 11:41 gasche Status new => resolved
2014-10-30 11:41 gasche Fixed in Version => 4.02.2+dev / +rc1
2014-10-30 11:41 gasche Resolution open => fixed
2014-10-30 11:41 gasche Assigned To => doligez
2015-05-03 15:15 michi Note Added: 0013802
2015-05-03 15:47 gasche Note Added: 0013803
2015-05-03 16:13 michi Note Added: 0013804
2015-05-13 14:37 gasche Relationship added has duplicate 0006867
2016-12-07 11:49 xleroy Status resolved => closed
2017-02-23 16:44 doligez Category Misc => misc

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker