Skip to content

Configure script accepts undefined options #4065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Nov 29, 2012 · 4 comments
Closed

Configure script accepts undefined options #4065

ghost opened this issue Nov 29, 2012 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@ghost
Copy link

ghost commented Nov 29, 2012

Rust's configure script accepts undefined options. For example:

./configure --abcdefgh

should terminate with an error.

@therealgymmy
Copy link
Contributor

just worked out a fix...

The current configure does not have a list of valid options whatsoever...
Is it okay to add one?

So, in the future if a new option is added, that option name will need to be added to the list of valid options.
I currently have something like the following:

# for --enable-OPTION or --disable-OPTION
BOOL_OPTIONS="sharedstd "\
"valgrind "\
#...

# for --OPTION=...
VAL_OPTIONS="prefix "\
"local-rust-root "\
#...

@catamorphism
Copy link
Contributor

I know very little about the build system, but I think configure must have a list of valid options somewhere, since ./configure --help prints out a list of options?

@therealgymmy
Copy link
Contributor

The --help parameter does not actually print out from a list of existing options. It sets $HELP to 1 so that opt and valopt, instead of setting environment variables, will simply print out whatever is passed to them. (So, our usual setting environment variable calls now become printing help message calls)

This is actually quite nice since setting environment variable calls are also help messages. :-)

So I just realized I could make it so that instead of having to maintain a separate list of valid options, we simply use opt and valopt to construct a list of valid options from our current setting environment variable calls. Then we use that to validate against any options passed from the commandline.

@therealgymmy
Copy link
Contributor

Instead of adding a separate list of valid options.
Now the existing "set envionrment variable" calls also populate the list of valid options.
An validation against user inputs is run after.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants