To reproduce, create an empty file ~/dmd.conf and attempt to build dlang.org:
$ touch ~/dmd.conf
$ cd /path/to/dlang.org
$ make -f posix.mak
...
.generated/stable_dmd-2.072.2/dmd2/linux/bin64/dub build --single --compiler=.generated/stable_dmd-2.072.2/dmd2/linux/bin64/dmd assert_writeln_magic.d
Failed to invoke the compiler .generated/stable_dmd-2.072.2/dmd2/linux/bin64/dmd to determine the build platform: 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: /home/andrei/dmd.conf
Specify path to file 'object.d' with -I switch
When dmd.conf contains (as is often the case) paths to some working directories, the error messages become correspondingly more confusing.
When dub takes the --compiler switch, it should invoke the compiler with the config found in its own path.
Comment #1 by robert.schadek — 2024-12-15T15:24:17Z