How to correctly deal with dmd.conf with multiple dmd installations - [ref osx, brew, digger]

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Sep 25 19:23:54 UTC 2018


On Tue, Sep 25, 2018 at 09:00:57PM +0200, Jacob Carlborg via Digitalmars-d wrote:
> On 2018-09-25 13:55, Jonathan M Davis wrote:
> 
> > Yes. You want dmd.conf, or certain paths won't be set correctly
> > (like where to find Phobos). Personally, I'd strongly suggest
> > against having multiple copies of dmd installed at the same time. It
> > just sounds like a recipe for disaster. Regardless, here's the
> > description for how dmd finds dmd.conf:
> > 
> > https://dlang.org/dmd-linux.html#dmd-conf
> 
> Having multiple copies of DMD (or rather multiple versions) works
> perfectly fine. That's the entire point of DVM [1]. But I've never
> used a global dmd.conf file either.
[...]

Unlike many other similar software, dmd works remarkably well when
installed with multiple copies of itself.  Provided you setup a suitable
dmd.conf in the same directory as the executable, and pointing to the
appropriate versions of druntime/phobos.  (The latter two are more
liable to cause headaches if you point dmd to the wrong versions
thereof. When in doubt, run dmd -v to see exactly which dmd.conf and
which druntime/phobos are being used.)

If you're using multiple versions of dmd, though, I'd highly recommend
*not* having a /etc/dmd.conf (nor a $HOME/dmd.conf), because all
versions of dmd will look there, and all except one will pick up the
wrong settings. Save yourself the ensuing headache.


T

-- 
If the comments and the code disagree, it's likely that *both* are wrong. -- Christopher


More information about the Digitalmars-d mailing list