Re: D and SCons [ was Re: bigint - python long ]

2012-09-10 Thread Johannes Pfau
Am Sun, 09 Sep 2012 12:55:19 -0700
schrieb Brad Roberts bra...@puremagic.com:

 On 9/9/2012 1:15 AM, Johannes Pfau wrote:
  Am Sat, 08 Sep 2012 16:25:49 +0100
  schrieb Russel Winder rus...@winder.org.uk:
  
  On Sat, 2012-09-08 at 07:20 -0700, Ellery Newcomer wrote:
  […]
  Okay, here:
  https://bitbucket.org/ariovistus/deimos-elfutils/overview
 
  I have some code with a working makefile and a nonworking
  SConstruct file.
 
  I believe the issue is the header files have pragma(lib, X) in
  them, and a single call to dmd links the appropriate lib in, but
  scons' link step loses that information.
 
  Do you have any intention of supporting pragma(lib) in scons?
 
  If that is valid Dv2 and SCons doesn't deal with it then the SCons
  D tools are broken and need fixing.
 
  Is there a tiny project replicating this that I can turn into a
  unit/system test. The red so caused will necessitate action :-)
 
  
  Please note that pragma(lib) is an evil feature. For example it will
  never work in gdc.
  
 
 It's not impossible and never is rather defeatist.  Using the
 frontend as is and grabing the json output, part of which includes
 the pragmas, would be easy.  Then invoking gdc with the appropriate
 options to get the library linked in.  rdmd is a good example of this
 sort of process.
 
 

Is there a special flag to enable pragmas for the json output? It does
not work with gdc right now, but it should be possible to make it work.

Sorry, I should have said 'It'll _probably_ never be supported in gdc'.
There are some possible solutions but:

* It must be good enough to get approved when gdc is merged into gcc.
  (remember it must be portable and gpl and you can't use
  stdout/stdin...)
* Someone would have to implement the solution. I guess Iain had his
  reasons not to implement it so somebody else would have to do that.

Of course you can always try to make it work with external build
tools. But a solution _in_ gdc seems not very likely.


I don't want to badmouth the pragma(lib) feature, in some cases it's
nice to have (mainly building simple script-like programs with few
source files). But for bigger projects, pragma(lib) makes things
difficult (incremental compilation; build tools usually check if a
library is available before trying to link against it so they can put
out a nice warning. pragma(lib) in dmd subverts this feature; can't
specify linker path with pragma lib, can't specify static vs dynamic
linking, ...).

The C/C++ architecture splits compilation and linking. Trying to
conflate those concepts as pragma(lib) does, might even be a good
idea(other languages have done it for some time now). But as we have to
deal with tools that were designed for C/C++ (linkers, gcc) we'll
always hit some issues with pragma(lib).



Re: D and SCons [ was Re: bigint - python long ]

2012-09-10 Thread Johannes Pfau
Am Mon, 10 Sep 2012 14:48:30 +0200
schrieb Johannes Pfau nos...@example.com:

 Sorry, I should have said 'It'll _probably_ never be supported in
 gdc'. There are some possible solutions but:
 
 * It must be good enough to get approved when gdc is merged into gcc.
   (remember it must be portable and gpl and you can't use
   stdout/stdin...)
 * Someone would have to implement the solution. I guess Iain had his
   reasons not to implement it so somebody else would have to do that.
 
 Of course you can always try to make it work with external build
 tools. But a solution _in_ gdc seems not very likely.

For reference: Here's the gdc bug report for pragma(lib):
http://d.puremagic.com/issues/show_bug.cgi?id=1690

Filed 2007, closed 2012 as RESOLVED/WONTFIX.


Re: D and SCons [ was Re: bigint - python long ]

2012-09-09 Thread Johannes Pfau
Am Sat, 08 Sep 2012 16:25:49 +0100
schrieb Russel Winder rus...@winder.org.uk:

 On Sat, 2012-09-08 at 07:20 -0700, Ellery Newcomer wrote:
 […]
  Okay, here:
  https://bitbucket.org/ariovistus/deimos-elfutils/overview
  
  I have some code with a working makefile and a nonworking
  SConstruct file.
  
  I believe the issue is the header files have pragma(lib, X) in
  them, and a single call to dmd links the appropriate lib in, but
  scons' link step loses that information.
  
  Do you have any intention of supporting pragma(lib) in scons?
 
 If that is valid Dv2 and SCons doesn't deal with it then the SCons D
 tools are broken and need fixing.
 
 Is there a tiny project replicating this that I can turn into a
 unit/system test. The red so caused will necessitate action :-)
 

Please note that pragma(lib) is an evil feature. For example it will
never work in gdc.



Re: D and SCons [ was Re: bigint - python long ]

2012-09-09 Thread Russel Winder
On Sun, 2012-09-09 at 10:15 +0200, Johannes Pfau wrote:
[…]
 Please note that pragma(lib) is an evil feature. For example it will
 never work in gdc.

So this is a DMD-only (*) feature and not a feature of the D programming
language per se?

(*) and hence LDC.
-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: D and SCons [ was Re: bigint - python long ]

2012-09-09 Thread Brad Roberts
On 9/9/2012 1:15 AM, Johannes Pfau wrote:
 Am Sat, 08 Sep 2012 16:25:49 +0100
 schrieb Russel Winder rus...@winder.org.uk:
 
 On Sat, 2012-09-08 at 07:20 -0700, Ellery Newcomer wrote:
 […]
 Okay, here:
 https://bitbucket.org/ariovistus/deimos-elfutils/overview

 I have some code with a working makefile and a nonworking
 SConstruct file.

 I believe the issue is the header files have pragma(lib, X) in
 them, and a single call to dmd links the appropriate lib in, but
 scons' link step loses that information.

 Do you have any intention of supporting pragma(lib) in scons?

 If that is valid Dv2 and SCons doesn't deal with it then the SCons D
 tools are broken and need fixing.

 Is there a tiny project replicating this that I can turn into a
 unit/system test. The red so caused will necessitate action :-)

 
 Please note that pragma(lib) is an evil feature. For example it will
 never work in gdc.
 

It's not impossible and never is rather defeatist.  Using the frontend as is 
and grabing the json output, part of which
includes the pragmas, would be easy.  Then invoking gdc with the appropriate 
options to get the library linked in.  rdmd
is a good example of this sort of process.




Re: D and SCons [ was Re: bigint - python long ]

2012-09-08 Thread Russel Winder
On Sat, 2012-09-08 at 07:20 -0700, Ellery Newcomer wrote:
[…]
 Okay, here: https://bitbucket.org/ariovistus/deimos-elfutils/overview
 
 I have some code with a working makefile and a nonworking SConstruct file.
 
 I believe the issue is the header files have pragma(lib, X) in them, and 
 a single call to dmd links the appropriate lib in, but scons' link step 
 loses that information.
 
 Do you have any intention of supporting pragma(lib) in scons?

If that is valid Dv2 and SCons doesn't deal with it then the SCons D
tools are broken and need fixing.

Is there a tiny project replicating this that I can turn into a
unit/system test. The red so caused will necessitate action :-)

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part