Bug 14255 – Since DMD is used to build idgen, one can't have dmd.conf for dev and system wide.

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-07T23:37:09Z
Last change time
2024-12-13T18:40:59Z
Assigned to
No Owner
Creator
deadalnix
Moved to GitHub: dmd#18953 →

Comments

Comment #0 by deadalnix — 2015-03-07T23:37:09Z
A common practice is to have dmd.conf in the dev folder of dmd to be able to use druntime and phobos in dev version rather than system ones (different version can be incompatible). Since system's dmd is used to build idgen, it is picking up the dev's dmd.conf and fail miserably.
Comment #1 by bugzilla — 2015-03-08T22:20:39Z
I propose a switch: -conf pick up dmd.conf from where the dmd.exe is -conf=filename use filename as the dmd.conf
Comment #2 by deadalnix — 2015-03-08T23:19:06Z
That forces to have the system's dmd, or dev's dmd to be always used with -conf . The default build do NOT use the flag. Meaning any use of the dev version of dmd must use the flag (or it is gonna use phobos from the system and explode in flight). That is effectively break most build out there for dev.
Comment #3 by yebblies — 2015-03-08T23:52:15Z
If you want to have a config file, yet ignore it, you need to use -conf. That is why it was added. In most cases that's as simple as set HOST_DC=path\to\dmd.exe -conf=path\to\sc.ini or export HOST_DC=path/to/dmd -conf=path/to/dmd.conf I'm aware of one issue with doing this on windows which will be fixed shortly. Adding '-conf' would work just fine too.
Comment #4 by temtaime — 2015-03-09T00:11:17Z
Can you say why there's no config files for gcc/mingw and only with dmd there's firstly dmd.conf, then -conf flags ?
Comment #5 by yebblies — 2015-03-09T00:22:19Z
(In reply to Temtaime from comment #4) > Can you say why there's no config files for gcc/mingw and only with dmd > there's firstly dmd.conf, then -conf flags ? Because gcc/mingw relies on environment variables and relative paths instead. You can do the same with dmd if you really want to.
Comment #6 by hsteoh — 2015-12-30T00:31:48Z
Got bitten by this today. I have an old version of dmd for bootstrapping purposes in /usr/src/d/install, and git checkout of dmd in /usr/src/d/dmd. This setup used to work fine, except that recently, due to changes in druntime/phobos, they no longer compile with the bootstrap version of dmd. So the solution is to put a dmd.conf in /usr/src/d/install so that the old compiler uses its own version of druntime/phobos, which it can compile. Now /usr/src/d/dmd successfully compiles... except that now it can't link anything, because it can't find the right dmd.conf, so it fails to find the correct version of object.d. Solution: put another dmd.conf in /usr/src/d/dmd so that the new compiler can find the right paths, right? Yes, it works... however, now dmd cannot be recompiled, because when posix.mak is running in /usr/src/d/dmd/src, it tries to invoke HOST_DMD, and the old compiler picks up ./dmd.conf instead of the correct one in /usr/src/d/install. Worse, attempting to remedy this by specifying -conf doesn't work, because posix.mak assumes HOST_DMD contains only the pathname to the host dmd executable; any extra parameters appended to HOST_DMD causes the existence check to fail and it refuses to run. So now I'm stuck. The only way out I can see is to put dmd.conf in /etc or $HOME, but that overrides the system-wide dmd.conf. So this is not workable either. I need a way to tell posix.mak to run HOST_DMD with additional flags. Is there a way to do this??
Comment #7 by hsteoh — 2015-12-30T00:47:21Z
Comment #8 by robert.schadek — 2024-12-13T18:40:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18953 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB