nim-lang / RFCs

A repository for your Nim proposals.
136 stars 26 forks source link

support `--opt:lto,release,danger,strip`, typesafe and user config-friendly alternative to `-d:danger`+friends #278

Closed timotheecour closed 8 months ago

timotheecour commented 3 years ago

originally suggested here: https://github.com/nim-lang/Nim/pull/15614#issuecomment-713816279

proposal:

example

nim --opt:lto,danger --opt:lto:off results in --opt:strip

static:
  doAssert compileOption("opt", "danger")
  doAssert not compileOption("opt", "lto")

rationale

Araq commented 3 years ago

"-d:release -d:danger don't work as expected in user configs" is really a bad gotcha that we should fix somehow. Unfortunately adding opt doesn't "fix" it at all.

timotheecour commented 3 years ago

it would provide a viable workaround, a user would use: --opt:danger in his config instead of a non-working -d:danger

Araq commented 3 years ago

The people who know about the workaround are exactly the people who know about the problem and can avoid it... Sometimes you simply have to fix a gotcha, not hack around it.

github-actions[bot] commented 9 months ago

This RFC is stale because it has been open for 1095 days with no activity. Contribute a fix or comment on the issue, or it will be closed in 30 days.