Bug 19684 – DMD 2.085.0-beta.1: DMD cannot find dmd.conf if invoked via symlink (OSX)
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2019-02-17T23:42:30Z
Last change time
2019-02-24T23:38:17Z
Assigned to
No Owner
Creator
Jon Degenhardt
Comments
Comment #0 by jrdemail2000-dlang — 2019-02-17T23:42:30Z
DMD cannot find its dmd.conf file when it is invoked via a symlink. The dmd.conf file is in the same directory as the dmd executable. If DMD is invoked via an absolute path then it finds the dmd.conf file. This is a change in behavior from 2.084.0. I've tried this only on OSX.
Further explanation:
I install DMD by retrieving the tar.xz file and unpacking it. Then I symlink the executable to ~/bin, which is in my path. This allows me to have multiple dmd versions installed simultaneously. As an example, I symlinked:
~/bin/dmd -> ~/devtools/dmd2-2.085.0-beta.1/osx/bin/dmd
Now compiling a hello world app results in the following:
------------------
$ dmd helloworld.d
Error: cannot find source code for runtime library file 'object.d'
dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
config file: /etc/dmd.conf
Specify path to file 'object.d' with -I switch
------------------
It's not an issue with PATH or home directory expansion. Invoking via an absolute path to the ~/bin/dmd symlink results in the same behavior. However, using a direct path to the executable with no symlinks works fine:
------------------
$ ~/devtools/dmd2-2.085.0-beta.1/osx/bin/dmd helloworld.d
$ ./helloworld
Hello World!
------------------
I looked through recent PRs and saw one candidate: https://github.com/dlang/dmd/pull/9261.
Comment #1 by doob — 2019-02-19T10:09:50Z
(In reply to Jon Degenhardt from comment #0)
> This allows me to have multiple dmd versions installed simultaneously.
I highly recommend using DVM [1] to install multiple versions of DMD. It allows to use different versions in different terminal sessions at the same time. It's also cross-platform.
[1] https://github.com/jacob-carlborg/dvm
Comment #2 by greeenify — 2019-02-19T17:16:53Z
(In reply to Jacob Carlborg from comment #1)
> (In reply to Jon Degenhardt from comment #0)
> > This allows me to have multiple dmd versions installed simultaneously.
>
> I highly recommend using DVM [1] to install multiple versions of DMD. It
> allows to use different versions in different terminal sessions at the same
> time. It's also cross-platform.
>
> [1] https://github.com/jacob-carlborg/dvm
FWIW alternatively the official install script also supports multiple versions out of the box:
https://dlang.org/install
Comment #3 by jrdemail2000-dlang — 2019-02-20T04:44:28Z
Jacob, Seb - Thanks for the info. I was unaware of these capabilities. I chose the approach I used as an alternative to the OS X dmg-based installer (installs to a system wide location.)
That these facilities is exist is orthogonal to the bug though. dmd has for quite a while been able to find files in its bin directory, even if launched through a symlink.
Comment #4 by jrdemail2000-dlang — 2019-02-20T04:46:17Z