[Scons-users] Building D release and tests

Bill Deegan bill at baddogconsulting.com
Tue Apr 11 12:23:39 EDT 2017


O.k. looking at your code now.

I'll send a pull request with a fix.
The issue is you're specifying the source as:
'#/source/main.d' which scons will try to build as #/source/main.o
This is not in a variant dir..

-Bill

On Tue, Apr 11, 2017 at 8:06 AM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> If you build the same binary into the same tree with different flag then
> you're doing something wrong and scons should and does flag this.
>
> In your example, you should use a diffferent build dir for tests if they
> need to e built with different flags..
>
> On Tue, Apr 11, 2017 at 6:48 AM, Russel Winder <russel at winder.org.uk>
> wrote:
>
>> OK, I think I finally twigged that the D tools are broken. Sorry I was
>> so slow.
>>
>> I shall construct a test and then a fix. And then a pull request which
>> hopefully can get accepted quickly.
>>
>>
>>
>> On Tue, 2017-04-11 at 09:56 +0100, Russel Winder wrote:
>> > If you try to use SCons to build release code and test code, life
>> > gets
>> > very complicated, and I think shows that whilst variant builds may
>> > not
>> > be broken, they are not easy to use. (Meson and CMake make this
>> > relatively easy.)
>> >
>> > To build out-of-tree (the only sane way) a release, I compile
>> > source/main.d with an environment that turns on all the
>> > optimisations.
>> >
>> > To build the unittests (out-of-tree obviously), I compile
>> > source/main.d
>> > with different environment.
>> >
>> > This causes problems because SCons sees the source/main.o twice in
>> > the
>> > tree and says
>> >
>> > scons: *** Two environments with different actions were specified for
>> > the same target:
>> > /home/users/russel/Repositories/Git/Masters/ApproxGC_D/source/main.o
>> > (action 1: ldc2
>> > -I=/home/users/russel/Repositories/Git/Masters/ApproxGC_D -O -c
>> > -of=main.o main.d)
>> > (action 2: ldc2
>> > -I=/home/users/russel/Repositories/Git/Masters/ApproxGC_D -unittest
>> > -c -of=main.o main.d)
>> > File
>> > "/home/users/russel/Repositories/Git/Masters/ApproxGC_D/SConscripts/U
>> > nitTests", line 3, in <module>
>> >
>> > The problem here seems to be that the fact that the rule is in the
>> > context of a variant build is not being taken into account. One rule
>> > is
>> > making Build/Release/source/main.o the other
>> > Build/UnitTests/source/main.o, but the build DAG appears not to know
>> > this.
>> >
>> > I have just put the code up on GitHub if anyone has time to take a
>> > peek
>> > at this.
>> >
>> > https://github.com/russel/ApproxGC
>> >
>> --
>> Russel.
>> ============================================================
>> =================
>> Dr Russel Winder      t: +44 20 7585 2200   voip:
>> sip:russel.winder at ekiga.net
>> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
>> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170411/1eaaed68/attachment.html>


More information about the Scons-users mailing list