Bug 22523 – DRuntime options passed after -- affect current process

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-18T16:46:25Z
Last change time
2021-11-19T07:33:33Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-11-18T16:46:25Z
[1] changed Druntime's argument parsing to forward `--DRT-` options after `--` to `main`. But those options still affect the current process! Example: ============================================================== // test.d import core.stdc.stdio; int main() { puts("Executed main although it should be skipped!"); return 1; } unittest {} // Prevents main to be executed by default ============================================================== > dmd -unittest test.d > ./test -- --DRT-testmode=run-main Executed main although it should be skipped! [1] https://github.com/dlang/druntime/pull/2881
Comment #1 by dlang-bot — 2021-11-18T16:56:53Z
@MoonlightSentinel created dlang/druntime pull request #3628 "Fix 22523 - Ensure that `rt_cmdlineOption` stops at `--`" fixing this issue: - Fix 22523 - Ensure that `rt_cmdlineOption` stops at `--` Otherwise configuration options passed after the `--` will still affect the current process. Signed-off-by: MoonlightSentinel <[email protected]> https://github.com/dlang/druntime/pull/3628
Comment #2 by dlang-bot — 2021-11-19T07:33:33Z
dlang/druntime pull request #3628 "Fix 22523 - Ensure that `rt_cmdlineOption` stops at `--`" was merged into master: - ce4ae1dedeeeb349179139fc90d1829ae214929d by MoonlightSentinel: Fix 22523 - Ensure that `rt_cmdlineOption` stops at `--` Otherwise configuration options passed after the `--` will still affect the current process. Signed-off-by: MoonlightSentinel <[email protected]> https://github.com/dlang/druntime/pull/3628