February 29

On Thursday, 29 February 2024 at 21:27:13 UTC, Lance Bachmeier wrote:

>

I think Rikki is suggesting replacing

const(char)* cc = getenv("CC");

with

const(char)* cc = getenv("DMD_CC");
if (!cc) {
  const(char)* cc = getenv("CC");
}

or something like that. Then you'd set DMD_CC to whatever cc should be used inside DMD.

Good logic. I just want anything that's done to satisfy assert(cc!="dmd"); after it's done.

March 01
On 01/03/2024 10:41 AM, Lance Bachmeier wrote:
> On Thursday, 29 February 2024 at 21:34:03 UTC, Richard (Rikki) Andrew Cattermole wrote:
> 
>> There are two separate issues here, my ticket is to prevent invasive changes in a build script. What Carl's ticket is for, is to prevent an accidental infinite recursion.
>>
>> Both are needed :)
> 
> What you're proposing would prevent infinite recursion, wouldn't it? Maybe I'm missing something. The source of the problem is grabbing the `CC` environment variable inside link.d.

No.

DMD_CC=dmd

That'll still be recursive.
February 29

On Thursday, 29 February 2024 at 21:52:50 UTC, Richard (Rikki) Andrew Cattermole wrote:

> >

What you're proposing would prevent infinite recursion, wouldn't it? Maybe I'm missing something. The source of the problem is grabbing the CC environment variable inside link.d.

No.

DMD_CC=dmd

That'll still be recursive.

Yes, so here's a combined proposal for the underlying logic (pseudo-code):

cc = getenv("DMD_CC")

if( cc=="" || cc=="dmd" ){  // DMD_CC effectively undefined
  cc = getenv("CC")

  if( cc=="" || cc=="dmd" ) {  // CC effectively undefined as well
    cc = platform_default_compiler
  }
}
assert( cc!="dmd" )
February 29

On Thursday, 29 February 2024 at 21:52:50 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

On 01/03/2024 10:41 AM, Lance Bachmeier wrote:

>

On Thursday, 29 February 2024 at 21:34:03 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

There are two separate issues here, my ticket is to prevent invasive changes in a build script. What Carl's ticket is for, is to prevent an accidental infinite recursion.

Both are needed :)

What you're proposing would prevent infinite recursion, wouldn't it? Maybe I'm missing something. The source of the problem is grabbing the CC environment variable inside link.d.

No.

DMD_CC=dmd

That'll still be recursive.

You'd be telling the compiler you want an infinite recursion if you do that, so it would be the intended behavior. Your original proposal was

DMD_CC=$CC
CC=dmd

which wouldn't do that.

March 01
On 01/03/2024 12:30 PM, Lance Bachmeier wrote:
> On Thursday, 29 February 2024 at 21:52:50 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 01/03/2024 10:41 AM, Lance Bachmeier wrote:
>>> On Thursday, 29 February 2024 at 21:34:03 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>>
>>>> There are two separate issues here, my ticket is to prevent invasive changes in a build script. What Carl's ticket is for, is to prevent an accidental infinite recursion.
>>>>
>>>> Both are needed :)
>>>
>>> What you're proposing would prevent infinite recursion, wouldn't it? Maybe I'm missing something. The source of the problem is grabbing the `CC` environment variable inside link.d.
>>
>> No.
>>
>> DMD_CC=dmd
>>
>> That'll still be recursive.
> 
> You'd be telling the compiler you want an infinite recursion if you do that, so it would be the intended behavior. Your original proposal was

Exactly.

This is why its two separate tickets, two separate problems.

1 2
Next ›   Last »