SCons: Default optimize to auto, fixing target/dev_build inference for Web
#94107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-Osby default #94087.This is a bit awkward because we can't have both a custom default value provided by each platform's
get_opts, and still use some platform-agnostic "auto" behavior in SConstruct. So with this approach we go back to the 4.2 behavior where the web platform'sget_optssimply overrides whatever is inoptimize, unless it's specified on the command line.I think it's an ok compromise for now, especially given how the web platform is sensitive to binary size. But it's a quirk worth knowing and documenting for people trying to debug web exports. (See also #91800.)
@dsnopek @Faless @adamscott Could also be considered to fix - #93476 by reintroducing the previous behavior, i.e. dev builds for web will still use
-Oslike in 4.2. Web builds withoptimize=nonewill likely still be broken, but they're probably simply way too big for browsers to handle?