May 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #20 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2013-05-29 07:57:15 PDT ---
(In reply to comment #19)
> (In reply to comment #18)
> > (In reply to comment #17)
> > > I don't agree with this, because you need to change a whole set of flags depending on which runtime you are using. -L-l is just not good enough.
> > > 
> > True, but that's not what the compiler does at the moment.
> > 
> > > This will fix the debug vs. normal runtime, true, but it doesn't help to *easily* use a different runtime library, you have to mess with the config file, but I want a way to do it from the command line, so it can be integrated in the build system.
> > 
> > [Environment-tango-X86_64]
> > ...
> > 
> > dmd -m64 -version=tango ...
> 
> Mmmm, I don't like the idea of having to mess with the config file, but since you can actually create one even in your home, I think I ran out of technical arguments, so my only objection about that solution is purely aesthetic.
> 
> Summary: I'm sold.

Well, not a 100% really. How are you parsing/planning to parse this?
---
[Environment]
DFLAGS=-w -g

[Environment-X86]
DFLAGS+=-L-L/usr/lib32

[Environment-X86_64]
DFLAGS+=-L-L/usr/lib64

[Environment-release]
DFLAGS+=-L-lphobos

[Environment-debug]
DFLAGS+=-L-lphobos_d

[Environment-linux]
DFLAGS+=-L-lrt -L-lpthread -L-ldl

[Environment-myversion]
DFLAGS=
---

What do I get if I do:
dmd file.d
dmd -release file.d
dmd -debug file.d
?
I think we either need a new section:
---
[Environment-default]
DFLAGS+=-L-lphobos
---
or something (that can't be used in a -version), or a way to *replace* a flag
(the former seems more reasonable).

Or maybe I'm not getting this right.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #21 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2013-05-29 07:59:07 PDT ---
Another option would be to just eliminate the -release (or the -debug) flag. Having 3 modes to compile stuff (release, normal, debug) might be too much. But that's even a bigger and more disruptive change, I think.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #22 from Martin Nowak <code@dawg.eu> 2013-05-29 09:26:04 PDT ---
(In reply to comment #19)
I think the matching scheme should be similar to
http://registry.vibed.org/package-format#build-settings except that it uses
os-versions-debug/release-compiler.

> dmd file.d

matches [Environment]
    and [Environment-X86_64] or [Environment-X86]

> dmd -release file.d

matches [Environment]
    and [Environment-X86_64] or [Environment-X86]
    and [Environment-release]
but depending on your system it might also match
[Environment-linux-X86_64-D_SIMD-release-dmd]

> so my only objection about that solution is purely aesthetic.

Yeah, it's probably not the most beautiful solution but it's flexible enough for our needs and still reasonably simple.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #23 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2013-05-29 10:48:49 PDT ---
(In reply to comment #22)
> (In reply to comment #19)
> I think the matching scheme should be similar to
> http://registry.vibed.org/package-format#build-settings except that it uses
> os-versions-debug/release-compiler.
> 
> > dmd file.d
> 
> matches [Environment]
>     and [Environment-X86_64] or [Environment-X86]
> 
> > dmd -release file.d
> 
> matches [Environment]
>     and [Environment-X86_64] or [Environment-X86]
>     and [Environment-release]
> but depending on your system it might also match
> [Environment-linux-X86_64-D_SIMD-release-dmd]

Then, this is still no good enough. If I put:

[Environment]
DFLAGS+=-L-lphobos2

[Environment-debug]
DFLAGS+=-L-lphobos2-dbg

Then when compiling with -debug I get 2 different libraries linked. If I leave [Environment] empty, then I can't link a program without using -debug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #24 from Martin Nowak <code@dawg.eu> 2013-05-29 12:34:27 PDT ---
(In reply to comment #23)
> Then when compiling with -debug I get 2 different libraries linked. If I leave [Environment] empty, then I can't link a program without using -debug.

Mmh, the simplest solutions I can think of would be these.

[Environment-debug]
DFLAGS=-L-lphobos-dbg

or

[Environment]
LIB=phobos2

[Environment-debug]
LIB=phobos2-dbg

[Environment]
DFLAGS+=-L-l%LIB%


(In reply to comment #22)
> os-versions-debug/release-compiler.

Actually os and compiler is already handled by versions, so we'd just need to match versions and debug/release.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 30, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #25 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2013-05-30 01:05:00 PDT ---
(In reply to comment #24)
> (In reply to comment #23)
> > Then when compiling with -debug I get 2 different libraries linked. If I leave [Environment] empty, then I can't link a program without using -debug.
> 
> Mmh, the simplest solutions I can think of would be these.
> 
> [Environment-debug]
> DFLAGS=-L-lphobos-dbg
> 
> or
> 
> [Environment]
> LIB=phobos2
> 
> [Environment-debug]
> LIB=phobos2-dbg
> 
> [Environment]
> DFLAGS+=-L-l%LIB%

Interesting, so the file is interpreted in order and you can override variables like that and specify the same [Section] several times. Then again I'm out of technical arguments :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 15, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7044



--- Comment #26 from Martin Nowak <code@dawg.eu> 2013-10-15 04:13:29 PDT ---
I haven't yet got around to do this though the implementation is fairly simple
and similar to the Environment64 change.
https://github.com/D-Programming-Language/dmd/commit/190702057ff01819a55e8823fef7d3b5b2686cf2
It requires two passes over the command line and env arguments and should be
something like this.
The first scans any argument that affects version identifiers.
Then we can process the inifile.
Now the second pass processes the updated DFLAGS and any remaining argument.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2 3
Next ›   Last »