Skip to content
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

compiler parameter order influences enabled flags (release/danger/quick special casing) #18921

Closed
stefantalpalaru opened this issue Sep 29, 2021 · 0 comments

Comments

@stefantalpalaru
Copy link
Contributor

This is a regression noticed in Nim-1.4.8, using the command line:

-d:release --debugger:native works as expected and generates -g3 -Og -O3
--debugger:native -d:release doesn't generate debugging info, producing only -O3

@xflywind found the PR causing this regression: #18051

An acceptable fix would be to not exclude any flag from conf.globalOptions in here:

Nim/compiler/commands.nim

Lines 489 to 496 in b74b914

elif cmpIgnoreStyle(key, "release") == 0 or cmpIgnoreStyle(key, "danger") == 0:
conf.options.excl {optStackTrace, optLineTrace, optLineDir, optOptimizeSize}
conf.globalOptions.excl {optExcessiveStackTrace, optCDebug}
conf.options.incl optOptimizeSpeed
if cmpIgnoreStyle(key, "danger") == 0 or cmpIgnoreStyle(key, "quick") == 0:
conf.options.excl {optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck,
optOverflowCheck, optAssert, optStackTrace, optLineTrace, optLineDir}
conf.globalOptions.excl {optCDebug}

The only downside is that people with those options in local config files (instead of on the command line) will get unexpected debugging info and verbose stack traces.

Araq added a commit that referenced this issue Sep 30, 2021
@Araq Araq closed this as completed in c38ab3e Sep 30, 2021
narimiran pushed a commit that referenced this issue Oct 1, 2021
(cherry picked from commit c38ab3e)
stefantalpalaru added a commit to status-im/nim-libbacktrace that referenced this issue Nov 3, 2021
PMunch pushed a commit to PMunch/Nim that referenced this issue Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants