[SERVER-23668] scons abbreviated options do not work properly Created: 12/Apr/16  Updated: 22/Sep/20  Resolved: 02/Sep/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.7.0, 4.2.10, 4.4.2

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-48097 Typo in variables-files flag argument... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2
Sprint: Execution Team 2020-08-10, Dev Platform 2020-09-07
Participants:

 Description   

SCons apparently supports accepting unambiguous prefixes of valid options; see e.g. http://scons.org/doc/1.3.1/HTML/scons-api/SCons.compat._scons_optparse.OptionParser-class.html#_match_long_opt

However, if you pass an unambiguous abbreviated option on the command line, scons accepts it but GetOption(name) still returns None when our SConstruct code asks for the fully specified option name.

You can try this with --disable-warnings-as-errors:

Example:
$ scons mongod --disable-warnings-as-er

Expected behavior:
scons either returns an error, or proceeds normally as if --disable-warnings-as-errors had been passed on the command line.
Actual behavior:
scons proceeds normally as if --disable-warnings-as-errors had NOT been passed on the command line.



 Comments   
Comment by Githook User [ 09/Sep/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-23668 Cherry-pick upstream SCons fix for abbreviated options issue

See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c

(cherry picked from commit 36920786ecae139217f8ea1eed4274e77477b2d0)
(cherry picked from commit 59c563338ae7dc6106aff81071a3bfd7b7f0389c)
Branch: v4.2
https://github.com/mongodb/mongo/commit/3885be271487bf1849a1cd5da1215795a3e21477

Comment by Ryan Egesdahl (Inactive) [ 09/Sep/20 ]

(wrong ticket number in description, forgot to change it before sending it up)
Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-26338 Cherry-pick upstream SCons fix for abbreviated options issue

See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c

(cherry picked from commit 36920786ecae139217f8ea1eed4274e77477b2d0)
Branch: v4.4
https://github.com/mongodb/mongo/commit/59c563338ae7dc6106aff81071a3bfd7b7f0389c

Comment by Eric Milkie [ 02/Sep/20 ]

(NB: wrong server ticket in commit description)
Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-26338 Cherry-pick upstream SCons fix for abbreviated options issue

See https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c
Branch: master
https://github.com/mongodb/mongo/commit/36920786ecae139217f8ea1eed4274e77477b2d0

Comment by Andrew Morrow (Inactive) [ 01/Sep/20 ]

We might as well backport to the other SCons 3.1.2 based branches as well.

Comment by Andrew Morrow (Inactive) [ 01/Sep/20 ]

I'm piggy-backing on the existing LGTM to merge the effectively equivalent change that landed upstream at https://github.com/SCons/scons/commit/456428184f388eccccbcbc3d76866a8dce060b3c

Comment by Geert Bosch [ 01/Sep/20 ]

Sure, thanks. I'm happy my fix proved acceptable to upstram.

Comment by Andrew Morrow (Inactive) [ 01/Sep/20 ]

geert.bosch - Do you want to hand this ticket back to SDP and we will get it merged from upstream?

Comment by Daniel Moody [ 06/Aug/20 ]

upstream scons Issue for this: https://github.com/SCons/scons/issues/3653

Comment by Geert Bosch [ 05/Aug/20 ]

For the record: I got bitten by this bug today, where I misspelled the --variables-files option as --variables-file and got a mysterious link error related to missing delete and new operators and wasted more than an hour.

Comment by Andrew Morrow (Inactive) [ 30/Jul/20 ]

milkie - That's correct, we are still waiting on a change there. Hopefully this just gets solved by a SCons upgrade.

Comment by Eric Milkie [ 30/Jul/20 ]

Looks like someone has proposed a fix to SCons but it's still being evaluated.

Comment by Andrew Morrow (Inactive) [ 17/May/20 ]

milkie - To me, that sounds tricky, because the options parser would need to parse your option that affects how options get parsed. Let's give the SCons devs a little time to work on the issue now that it is flagged. Hopefully they come up with something we can cherry pick back.

Comment by Eric Milkie [ 15/May/20 ]

I wonder if it would be possible to just add an option for scons to disable abbreviations.

Comment by Andrew Morrow (Inactive) [ 15/May/20 ]

I raised this issue to the SCons developers. This is a SCons bug, and it looks like it might be pretty hard to fix: https://github.com/SCons/scons/issues/3653

Generated at Thu Feb 08 04:04:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.