www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd.conf no longer working?

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Hi folks, I'm having trouble setting up dmd on a fresh system. The short 
of it is nothing in dmd.conf seems to be taken into account. 
Furthermore, sections such as [Environment] are rejected with the error 
message:

Error: Use 'NAME=value' syntax, not '[ENVIRONMENT]'

What happened?


Thanks,

Andrei
Oct 22 2015
next sibling parent reply ketmar <ketmar ketmar.no-ip.org> writes:
i believe that envs now should be:

[Environment32]

or

[Environment64]

seems that OS X version is the one with old [Environment], so it 
fails.
Oct 22 2015
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 10/22/2015 01:58 PM, ketmar wrote:
 i believe that envs now should be:

 [Environment32]

 or

 [Environment64]

 seems that OS X version is the one with old [Environment], so it fails.
Tried both of them, nothing works. Also, the preexisting dmd on ubuntu fails like this: dmd: inifile.c:141: void writeToEnv(StringTable*, char*): Assertion `p' failed. Could this be a problem with my environment? Andrei
Oct 22 2015
parent ketmar <ketmar ketmar.no-ip.org> writes:
hm. sorry, i forgot to mention that i'm using git HEAD. it seems 
to work ok in HEAD.

just checked 2.068.2, freshly downloaded, and it seems to work 
fine (at least 32-bit version). it looks like you have something 
weird with your system. maybe some environment var set to 
something strange?
Oct 22 2015
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-10-22 19:58, ketmar wrote:

 seems that OS X version is the one with old [Environment], so it fails.
There's no point in having different sections on OS X, because all libraries are universal. -- /Jacob Carlborg
Oct 22 2015
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
OK, I think I figured the problem: Unicode!

I have the following repro with DMD64 D Compiler v2.068.2 on Ubuntu 15 
(the default installation). If there's no ~/dmd.conf, running 'dmd' 
alone displays the options.

If there's a zero byte dmd.conf, things still work.

If there's a dmd.conf in Unicode format (I suspect with the two 
signature bytes), dmd crashes with:

dmd: inifile.c:141: void writeToEnv(StringTable*, char*): Assertion `p' 
failed.

This was caused by the MonoDevelop editor, which saves files in the 
format. Emacs also happily loads these files and signals the format with 
a "U" in the status bar.


Andrei
Oct 22 2015
next sibling parent reply ketmar <ketmar ketmar.no-ip.org> writes:
exactly! i just added BOM to dmd.conf, and got the same assertion.
Oct 22 2015
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 10/22/2015 12:31 PM, ketmar wrote:
 exactly! i just added BOM to dmd.conf, and got the same assertion.
Time to file in Bugzilla.
Oct 23 2015
parent ketmar <ketmar ketmar.no-ip.org> writes:
 Time to file in Bugzilla.
Andrei already did that: https://issues.dlang.org/show_bug.cgi?id=15237
Oct 23 2015
prev sibling parent Jesse Phillips <Jesse.K.Phillips+D gmail.com> writes:
On Thursday, 22 October 2015 at 19:25:43 UTC, Andrei Alexandrescu 
wrote:
 OK, I think I figured the problem: Unicode!

 I have the following repro with DMD64 D Compiler v2.068.2 on 
 Ubuntu 15 (the default installation). If there's no ~/dmd.conf, 
 running 'dmd' alone displays the options.

 If there's a zero byte dmd.conf, things still work.

 If there's a dmd.conf in Unicode format (I suspect with the two 
 signature bytes), dmd crashes with:

 dmd: inifile.c:141: void writeToEnv(StringTable*, char*): 
 Assertion `p' failed.

 This was caused by the MonoDevelop editor, which saves files in 
 the format. Emacs also happily loads these files and signals 
 the format with a "U" in the status bar.


 Andrei
The BOM was such a stupid thing. UTF-8 should have never allowed a BOM and the byte order should have been defined for the other formats.
Oct 22 2015
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-10-22 19:43, Andrei Alexandrescu wrote:
 Hi folks, I'm having trouble setting up dmd on a fresh system. The short
 of it is nothing in dmd.conf seems to be taken into account.
 Furthermore, sections such as [Environment] are rejected with the error
 message:

 Error: Use 'NAME=value' syntax, not '[ENVIRONMENT]'

 What happened?
A couple of things: * I recommend compiling with -v, it will output the path to dmd.conf * It should be Environment32 and/or Environment64 for Linux. For OS X it's Environment. It should _not_ be ENVIRONMENT * You might want to tell us on which platform and how you installed the compiler -- /Jacob Carlborg
Oct 22 2015
parent reply Marco Leise <Marco.Leise gmx.de> writes:
Am Thu, 22 Oct 2015 21:50:33 +0200
schrieb Jacob Carlborg <doob me.com>:

 On 2015-10-22 19:43, Andrei Alexandrescu wrote:
 Hi folks, I'm having trouble setting up dmd on a fresh system. The short
 of it is nothing in dmd.conf seems to be taken into account.
 Furthermore, sections such as [Environment] are rejected with the error
 message:

 Error: Use 'NAME=3Dvalue' syntax, not '=EF=BB=BF[ENVIRONMENT]'

 What happened?
=20 A couple of things: =20 * I recommend compiling with -v, it will output the path to dmd.conf =20 * It should be Environment32 and/or Environment64 for Linux. For OS X=20 it's Environment. It should _not_ be ENVIRONMENT =20 * You might want to tell us on which platform and how you installed the=20 compiler
You can also combine common options under [Environment] like this: [Environment] DFLAGS=3D-I/opt/dmd-2.069/import -L--export-dynamic -defaultlib=3Dphobos2 -= verrors=3D0 [Environment32] DFLAGS=3D%DFLAGS% -L-L/opt/dmd-2.069/lib32 -L-rpath -L/opt/dmd-2.069/lib32 [Environment64] DFLAGS=3D%DFLAGS% -L-L/opt/dmd-2.069/lib64 -L-rpath -L/opt/dmd-2.069/lib64 --=20 Marco
Oct 22 2015
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-10-22 23:05, Marco Leise wrote:

 You can also combine common options under [Environment] like
 this:

 [Environment]
 DFLAGS=-I/opt/dmd-2.069/import -L--export-dynamic -defaultlib=phobos2
-verrors=0
 [Environment32]
 DFLAGS=%DFLAGS% -L-L/opt/dmd-2.069/lib32 -L-rpath -L/opt/dmd-2.069/lib32
 [Environment64]
 DFLAGS=%DFLAGS% -L-L/opt/dmd-2.069/lib64 -L-rpath -L/opt/dmd-2.069/lib64
Aha, cool. -- /Jacob Carlborg
Oct 22 2015
prev sibling parent Kagamin <spam here.lot> writes:
Or ditch the whole thing and dogfood D parser for config:

enum Environment
{
   DFLAGS=`-I/opt/dmd-2.069/import -L--export-dynamic 
-defaultlib=phobos2 -verrors=0`
}
enum Environment32
{
   DFLAGS=`%DFLAGS% -L-L/opt/dmd-2.069/lib32 -L-rpath 
-L/opt/dmd-2.069/lib32`
}
enum Environment64
{
   DFLAGS=`%DFLAGS% -L-L/opt/dmd-2.069/lib64 -L-rpath 
-L/opt/dmd-2.069/lib64`
}
Oct 23 2015