Bug 22987 – __traits(getLocation) needs a way to get an absolute path.

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-04T15:16:51Z
Last change time
2024-12-13T19:22:03Z
Keywords
industry, pull
Assigned to
No Owner
Creator
mhh
Moved to GitHub: dmd#20082 →

Comments

Comment #0 by maxhaton — 2022-04-04T15:16:51Z
Comment #1 by dlang-bot — 2022-04-04T16:05:13Z
@maxhaton created dlang/dmd pull request #13947 "Fix Issue 22987 - Make traits getLocation have an option to return an…" fixing this issue: - Fix Issue 22987 - Make traits getLocation have an option to return an absolute path The feature is required for an application of metaprogramming within Symmetry. A flag is added rather than changing the default in case it breaks something. https://github.com/dlang/dmd/pull/13947
Comment #2 by bugzilla — 2024-03-26T05:34:17Z
Comment #3 by alphaglosined — 2024-03-26T05:54:31Z
(In reply to Walter Bright from comment #2) > Why not use: > > https://dlang.org/phobos/std_path.html#absolutePath That would require knowing the base address to make absolute against. For build systems like dub, that information may very well not exist, or be assumable. You have to make assumptions to reconstruct information that the compiler could just tell you. That is not a good solution, it is a workaround at best. Not to mention cross compilation could result in a wrong result if it works at all.
Comment #4 by robert.schadek — 2024-12-13T19:22:03Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20082 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB