[SERVER-44680] Improve build system help text Created: 16/Nov/19  Updated: 20/Nov/19  Resolved: 20/Nov/19

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 4.2.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ryan Schmidt Assignee: Andrew Morrow (Inactive)
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Dev Platform 2019-12-02
Participants:

 Description   

The help text for many of the scons flags is confusing. The help text for --use-system-mongo-c at least seems straightforward:

--use-system-mongo-c=[on|off|auto]

I'm clearly meant to write either --use-system-mongo-c=on or --use-system-mongo-c=off or --use-system-mongo-c=auto. Simple enough. But the help text for --use-system-icu is baffling:

--use-system-icu=USE-SYSTEM-ICU

Is this telling me to write literally --use-system-icu=USE-SYSTEM-ICU? Or am I supposed to use just --use-system-icu? Or am I meant to infer that USE-SYSTEM-ICU should be replaced with on, off, or auto?

I can probably experiment to figure out what I need to use, but it would be better if the help text were clearer.



 Comments   
Comment by Andrew Morrow (Inactive) [ 20/Nov/19 ]

ryandesign - I don't think there is a way to fix this, unfortunately. It is an issue with optparse, and that is built into SCons, not something we can change. I'm going to close the ticket as "Won't Fix", and hopefully future versions of SCons will behave better.

Comment by Andrew Morrow (Inactive) [ 19/Nov/19 ]

ryandesign - This appears to be an artifact of the fact that SCons uses the python optparse package internally. The optparse package allows one to set a "metavar" when declaring an option. If the metavar is set, it will be placed after an = on the help text for the option. If not set, the default value for metavar is the upper-case name of the option. This can make some sense for options that take arguments, like --build-dir. However, for flag like options like the various --use-system-x things, it doesn't make much sense. Oddly, there doesn't seem to be any way to disable this behavior of adding some metavar. I've experimented with explicitly setting nargs=0, and setting metavar=None. But so far, I can't find a way to convince optparse to stop producing this annoying text. And setting the `metavar` to something other than the default (which is the upper-case'd name of the flag) doesn't really improve the situation, because options that don't take arguments would still display as --some-option=SOME-METAVAR. I've checked in with the SCons developers to see if they can think of a way around it. Unfortunately, it may just be something we can't really control.

CC mathew.robinson in case he has any thoughts.

Comment by Andrew Morrow (Inactive) [ 17/Nov/19 ]

ryandesign - This is either an issue with how we we are declaring these options, or with how SCons presents the help text for properly declared options. I suspect it is the former.

Comment by Ryan Schmidt [ 16/Nov/19 ]

Sorry I messed up the formatting. It looked fine before I submitted it. The syntax for this editor is unusual. I also cannot find an Edit button for me to be able to try to fix it.

Generated at Thu Feb 08 05:06:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.