www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Output of dmd and dmd.conf location

reply Moritz Warning <moritzwarning web.de> writes:
Can dmd output the location of it's binary and the dmd.conf it uses?
It would be really helpful to solve a lot of problems and confusion that 
arises in #D.

People use different installers, packages and what else not when some 
installation doesn't work right away.
Usually it makes every other attempts to find the problem a nightmare.

Thanks.
Mar 24 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/24/2010 01:33 PM, Moritz Warning wrote:
 Can dmd output the location of it's binary and the dmd.conf it uses?
 It would be really helpful to solve a lot of problems and confusion that
 arises in #D.

 People use different installers, packages and what else not when some
 installation doesn't work right away.
 Usually it makes every other attempts to find the problem a nightmare.

 Thanks.

You mean in -v builds? I also think that would be very useful. Also having the module name, whether express or deduced, would be great. Andrei
Mar 24 2010
next sibling parent reply Moritz Warning <moritzwarning web.de> writes:
On Wed, 24 Mar 2010 13:55:12 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 01:33 PM, Moritz Warning wrote:
 Can dmd output the location of it's binary and the dmd.conf it uses? It
 would be really helpful to solve a lot of problems and confusion that
 arises in #D.

 People use different installers, packages and what else not when some
 installation doesn't work right away. Usually it makes every other
 attempts to find the problem a nightmare.

 Thanks.

You mean in -v builds? I also think that would be very useful. Also having the module name, whether express or deduced, would be great. Andrei

dmd -v doesn't outputs the absolute path of the dmd binary. Information about the path that must be used in dmd.conf needs some deduction from the dmd -v output (when the dmd.conf is working). But when there is a wrong dmd.conf (with wrong paths inside) picked up by dmd, then there is no information at all: dmd main.d -v parse main importall main import object (object.d) object.d: Error: module object cannot read file 'object.d' Having the absolute path to dmd and dmd.conf would help a lot at this point. I've seen countless people struggling and also failing with this problem..
Mar 24 2010
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Moritz Warning wrote:
 Smth. like this would be helpful.

I like it. It's a good idea.
Mar 24 2010
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/24/2010 02:11 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 13:55:12 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 01:33 PM, Moritz Warning wrote:
 Can dmd output the location of it's binary and the dmd.conf it uses? It
 would be really helpful to solve a lot of problems and confusion that
 arises in #D.

 People use different installers, packages and what else not when some
 installation doesn't work right away. Usually it makes every other
 attempts to find the problem a nightmare.

 Thanks.

You mean in -v builds? I also think that would be very useful. Also having the module name, whether express or deduced, would be great. Andrei

dmd -v doesn't outputs the absolute path of the dmd binary. Information about the path that must be used in dmd.conf needs some deduction from the dmd -v output (when the dmd.conf is working). But when there is a wrong dmd.conf (with wrong paths inside) picked up by dmd, then there is no information at all: dmd main.d -v parse main importall main import object (object.d) object.d: Error: module object cannot read file 'object.d' Having the absolute path to dmd and dmd.conf would help a lot at this point. I've seen countless people struggling and also failing with this problem..

Absolutely. I never know the full logic by which dmd.conf is found, it's quite convoluted. You may want to submit a bugzilla enhancement request. I don't think the dmd binary is essential, after all you launched it so you can do a which dmd or whatever. But the name of the module being compiled would help. Andrei
Mar 24 2010
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/24/2010 04:35 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 16:06:02 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 02:11 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 13:55:12 -0500, Andrei Alexandrescu wrote:


 Absolutely. I never know the full logic by which dmd.conf is found, it's
 quite convoluted. You may want to submit a bugzilla enhancement request.
 I don't think the dmd binary is essential, after all you launched it so
 you can do a which dmd or whatever.

Linux beginners might have the problem on Linux. - That one additional line wouldn't hurt.
 But the name of the module being compiled would help.

Do you mean "dmd -v" should write out the module name that is compiled at that moment? Sounds good.

Yes. If there's a module declaration output that, otherwise output the module name as inferred from the file name. Andrei
Mar 24 2010
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 I never know the full logic by which dmd.conf is found, it's quite convoluted.

From dmd compiler source inifile.c: /* Look for inifile in the following sequence of places: * o current directory * o home directory * o directory off of argv0 * o /etc/ */ argv0 is where the dmd binary is. From the documentation http://www.digitalmars.com/d/2.0/dmd-linux.html#dmd_conf 1.current working directory 2.directory specified by the HOME environment variable 3.directory dmd resides in 4./etc/
Mar 24 2010
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/24/2010 04:42 PM, Walter Bright wrote:
 Andrei Alexandrescu wrote:
 I never know the full logic by which dmd.conf is found, it's quite
 convoluted.

From dmd compiler source inifile.c: /* Look for inifile in the following sequence of places: * o current directory * o home directory * o directory off of argv0 * o /etc/ */ argv0 is where the dmd binary is. From the documentation http://www.digitalmars.com/d/2.0/dmd-linux.html#dmd_conf 1.current working directory 2.directory specified by the HOME environment variable 3.directory dmd resides in 4./etc/

I know. What I meant to say is that I need to go look it up whenever I need to figure something out. It would be much simpler to just issue dmd -v and see the thing at work in my environment. Andrei
Mar 24 2010
prev sibling parent Michel Fortin <michel.fortin michelf.com> writes:
On 2010-03-24 17:42:49 -0400, Walter Bright <newshound1 digitalmars.com> said:

 argv0 is where the dmd binary is.

Not if you are calling dmd from a symbolic link; in this case, it'll be where the symbolic link is. That's why the D for Xcode installer puts a trampoline program to call dmd in /usr/local/bin/ instead of a symbolic link. The trampoline can adjust argv0 correctly. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Mar 24 2010
prev sibling next sibling parent Moritz Warning <moritzwarning web.de> writes:
Smth. like this would be helpful.

dmd main.d -v
Binary: /usr/bin/dmd [1.057]
Config: /etc/dmd.conf
parse     main
importall main
import    object        (object.d)
object.d: Error: module object cannot read file 'object.d'
Mar 24 2010
prev sibling next sibling parent Moritz Warning <moritzwarning web.de> writes:
On Wed, 24 Mar 2010 16:06:02 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 02:11 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 13:55:12 -0500, Andrei Alexandrescu wrote:


 
 Absolutely. I never know the full logic by which dmd.conf is found, it's
 quite convoluted. You may want to submit a bugzilla enhancement request.
 I don't think the dmd binary is essential, after all you launched it so
 you can do a which dmd or whatever.

Linux beginners might have the problem on Linux. - That one additional line wouldn't hurt.
 But the name of the module being compiled would help.

Do you mean "dmd -v" should write out the module name that is compiled at that moment? Sounds good.
Mar 24 2010
prev sibling next sibling parent Moritz Warning <moritzwarning web.de> writes:
On Wed, 24 Mar 2010 16:40:51 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 04:35 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 16:06:02 -0500, Andrei Alexandrescu wrote:

 On 03/24/2010 02:11 PM, Moritz Warning wrote:
 On Wed, 24 Mar 2010 13:55:12 -0500, Andrei Alexandrescu wrote:


 Absolutely. I never know the full logic by which dmd.conf is found,
 it's quite convoluted. You may want to submit a bugzilla enhancement
 request. I don't think the dmd binary is essential, after all you
 launched it so you can do a which dmd or whatever.

the problem on Linux. - That one additional line wouldn't hurt.
 But the name of the module being compiled would help.

Do you mean "dmd -v" should write out the module name that is compiled at that moment? Sounds good.

Yes. If there's a module declaration output that, otherwise output the module name as inferred from the file name. Andrei

I would suggest to put it in a separate ticket. Cupcakes are easier to sell than cake. :>
Mar 24 2010
prev sibling parent Moritz Warning <moritzwarning web.de> writes:
On Wed, 24 Mar 2010 13:34:05 -0700, Walter Bright wrote:

 Moritz Warning wrote:
 Smth. like this would be helpful.

I like it. It's a good idea.

http://d.puremagic.com/issues/show_bug.cgi?id=4002
Mar 24 2010