[Issue 19684] New: DMD 2.085.0-beta.1: DMD cannot find dmd.conf if invoked via symlink (OSX)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 17 23:42:30 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19684

          Issue ID: 19684
           Summary: DMD 2.085.0-beta.1: DMD cannot find dmd.conf if
                    invoked via symlink (OSX)
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: jrdemail2000-dlang at yahoo.com

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.

--


More information about the Digitalmars-d-bugs mailing list