Thread overview
Any workaround for bug 24118?
Sep 05, 2023
Paolo Invernizzi
Sep 05, 2023
RazvanN
Sep 05, 2023
user1234
Sep 05, 2023
Paolo Invernizzi
Sep 05, 2023
Paolo Invernizzi
Sep 05, 2023
RazvanN
Sep 06, 2023
Paolo Invernizzi
Sep 06, 2023
RazvanN
Sep 06, 2023
Paolo Invernizzi
Sep 06, 2023
RazvanN
September 05, 2023

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

September 05, 2023

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

I have run the code with a debug build (without -release) which does not exclude asserts and I get:

core.exception.AssertError@src/dmd/e2ir.d(1725): This case should have been rewritten to _d_arraycatnTX in the semantic phase

Walter has recently made it so that the lowerings to the druntime hooks are not emitted in ctfe contexts. I bet that's why this code is failing. I'm investigating further, hopefully will be able to come up with a fix shortly. Stay tuned.

September 05, 2023

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

Hello, I have just found that if( __ctfe && true) works.

>

We are not even sure about the root cause of it ...

That's an assertion failure in the backend which happens when a conditional expression is processed.

>

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

September 05, 2023

On Tuesday, 5 September 2023 at 14:32:17 UTC, user1234 wrote:

>

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

Hello, I have just found that if( __ctfe && true) works.

That's a perfect workaround for here and now, thank you!

I've just tested that the code is compiling fine on dmd-nightly, so I guess it was fixed somehow in main.

/P

September 05, 2023

On Tuesday, 5 September 2023 at 14:39:07 UTC, Paolo Invernizzi wrote:

>

On Tuesday, 5 September 2023 at 14:32:17 UTC, user1234 wrote:

>

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

Hello, I have just found that if( __ctfe && true) works.

That's a perfect workaround for here and now, thank you!

Nope, still crashing on our codebase

September 05, 2023

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

PR fixing the issue: https://github.com/dlang/dmd/pull/15578

September 06, 2023

On Tuesday, 5 September 2023 at 15:34:36 UTC, RazvanN wrote:

>

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

PR fixing the issue: https://github.com/dlang/dmd/pull/15578

Thank you Razvan, I'll follow the progress of the PR

September 06, 2023

On Wednesday, 6 September 2023 at 07:54:41 UTC, Paolo Invernizzi wrote:

>

On Tuesday, 5 September 2023 at 15:34:36 UTC, RazvanN wrote:

>

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

PR fixing the issue: https://github.com/dlang/dmd/pull/15578

Thank you Razvan, I'll follow the progress of the PR

@Paolo: If you want to compile your code before my PR gets in, putting the ctfe code in a function will get rid of the ice:

import std.algorithm : map;
import std.range : zip;
import std.typecons : tuple;

void mock()
{
    zip([1,2,3], ["a", "b", "c"])
            .map!( i => tuple("", i[1]) )
            .map!( a => a[0] ? a[0] : " " ~ a[1] )
            ;

}

void foo()
{
    if( __ctfe )
    {
        mock();
    }
}
September 06, 2023

On Wednesday, 6 September 2023 at 10:57:24 UTC, RazvanN wrote:

>

On Wednesday, 6 September 2023 at 07:54:41 UTC, Paolo Invernizzi wrote:

>

On Tuesday, 5 September 2023 at 15:34:36 UTC, RazvanN wrote:

>

On Tuesday, 5 September 2023 at 13:19:15 UTC, Paolo Invernizzi wrote:

>

Hi all,

Actually we are unable to build any tools on Apple Silicon due to issue 24118 [1]:
Someone can suggest a workaround?

We are not even sure about the root cause of it ...

Thank you,
Paolo

[1] https://issues.dlang.org/show_bug.cgi?id=24118

PR fixing the issue: https://github.com/dlang/dmd/pull/15578

Thank you Razvan, I'll follow the progress of the PR

@Paolo: If you want to compile your code before my PR gets in, putting the ctfe code in a function will get rid of the ice:

import std.algorithm : map;
import std.range : zip;
import std.typecons : tuple;

void mock()
{
    zip([1,2,3], ["a", "b", "c"])
            .map!( i => tuple("", i[1]) )
            .map!( a => a[0] ? a[0] : " " ~ a[1] )
            ;

}

void foo()
{
    if( __ctfe )
    {
        mock();
    }
}

Thanks Razvan, that's really appreciated, especially because on macOS we mainly rely on LDC not only for releases as usuals, but also for the edit-compile-debug cycle (DMD x86_64 is actually slower than LDC arm64).

/P

September 06, 2023

On Wednesday, 6 September 2023 at 11:03:31 UTC, Paolo Invernizzi wrote:

>

On Wednesday, 6 September 2023 at 10:57:24 UTC, RazvanN wrote:

>

[...]

Thanks Razvan, that's really appreciated, especially because on macOS we mainly rely on LDC not only for releases as usuals, but also for the edit-compile-debug cycle (DMD x86_64 is actually slower than LDC arm64).

/P

You're welcome! Let me know if there is anything else I could of assistance with.