www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1660] New: DFLAGS environment variables is not working

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660

           Summary: DFLAGS environment variables is not working
           Product: D
           Version: 1.023
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: baryluk mpi.int.pl


dmd is not respecting DFLAGS environment variable, this prevents from easy
switching beetwen phobos and tango.

example:

$ export DFLAGS="-I/usr/lib/dmd-tango/src -defaultlib=dtango-base-dmd
-debuglib=dtango-base-dmd -version=Tango -version=Posix"

$ ls /usr/lib/dmd-tango/src/tango/io/Console.d 
/usr/lib/dmd-tango/src/tango/io/Console.d

~/tango-0.99.2-src/example/console$ dmd hello.d 
hello.d(16): module Console cannot read file 'tango/io/Console.d'


CC environment variables is working, DFLAGS seems to not.


-- 
Nov 12 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660


baryluk mpi.int.pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major




-- 
Nov 12 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660






This is so simple bug, and fix is trivial. Please do something with it.


-- 
Jun 22 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID





The dmd.conf file overrides any DFLAGS environment variable setting prior to
running dmd. This is by design. You can set a local dmd.conf for each of your
projects, however.


-- 
Jun 23 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660






Config files are more inconvenient than env variables, thus env variables
should have higher priority. I'll leave it to the reporter whether it should be
reopened though.


-- 
Jun 23 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1660


baryluk smp.if.uj.edu.pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |





Most tools behaves in this way, gcc, make. IMHO environment variables should
have higher priority than /etc/dmd.conf. Practicly always we have configured
/etc/dmd.conf so is env. variable have smaller priority and it will be never
used.

Proposed order:
  1. DMD=`which dmd`; `dirname $DMD`/dmd.conf   - compiler settings
  2. /etc/dmd.conf                              - system settings
  3. $HOME/dmd.conf                             - user settings
  4. `pwd`/dmd.conf                             - project settings
  5. DFLAGS env variable                        - overrding them
  6. command line                               - from make/rebuild/manual
compilation

as oposed to current:
  1. DFLAGS env variable
  2. `pwd`/dmd.conf
  3. $HOME/dmd.conf
  4. DMD=`which dmd`; `dirname $DMD`/dmd.conf
  5. /etc/dmd.conf
  6. command line

which is very strange to me.

I want for example create wrapper dmd-tango:


export DFLAGS="override /etc/dmd.conf which have conf for dmd-phobos"
exec /usr/bin/dmd $*

Currently there is no easy way to do this.


I don't exactly understand phrase "This is handy to make dmd independent of
programs with conflicting use of environment variables." from
http://www.digitalmars.com/d/2.0/dmd-linux.html#dmd_conf

We are using only DFLAGS and CC, what programs will/can conflict with them?


-- 
Jun 23 2008