Skip to content

Conversation

the-horo
Copy link

@the-horo the-horo commented Jul 1, 2025

Reboot of #775 using setup-dlang v2 for easier gdc setup

@the-horo
Copy link
Author

the-horo commented Jul 1, 2025

2025-07-01T19:39:14.5152409Z      Warning Warning: License in sub-package dcd:dsymbol is different than its parent package, this is discouraged.
2025-07-01T19:39:14.5171837Z     Starting Performing "profile-gc" build using dmd for x86_64.
2025-07-01T19:39:14.5176245Z     Building msgpack-d 1.0.5: building configuration [default]
2025-07-01T19:39:14.9188518Z     Building dcd:common 0.16.0-beta.3: building configuration [library]
2025-07-01T19:39:14.9188912Z    Pre-build Running commands
2025-07-01T19:39:15.8857434Z     Building emsi_containers 0.9.0: building configuration [library]
2025-07-01T19:39:16.0843952Z     Building libdparse 0.25.0: building configuration [library]
2025-07-01T19:39:18.3902646Z     Building dcd:dsymbol 0.16.0-beta.3: building configuration [library]
2025-07-01T19:39:19.2728615Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/druntime/import/core/internal/array/utils.d-mixin-94(98,830): Error: semicolon needed to end declaration of `name` instead of `trivia`
2025-07-01T19:39:19.2730965Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d-mixin-3002(3006,847): Error: semicolon needed to end declaration of `name` instead of `trivia`
2025-07-01T19:39:19.2743649Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/phobos/std/array.d(3588,16): Error: template instance `core.lifetime._d_newitemTTrace!(InPlaceAppender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[]))` error instantiating
2025-07-01T19:39:19.2750354Z         impl = new InPlaceAppender!A(arr);
2025-07-01T19:39:19.2750782Z                ^
2025-07-01T19:39:19.2756618Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/phobos/std/array.d(4494,1):        instantiated from here: `Appender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[])`
2025-07-01T19:39:19.2762360Z Appender!A appender(A)()
2025-07-01T19:39:19.2762707Z ^
2025-07-01T19:39:19.2768225Z ../../../.dub/packages/libdparse/0.25.0/libdparse/src/dparse/lexer.d(568,58):        instantiated from here: `appender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[])`
2025-07-01T19:39:19.2774470Z     auto leadingTriviaAppender = appender!(TriviaToken[])();
2025-07-01T19:39:19.2775003Z                                                          ^
2025-07-01T19:39:19.2775783Z dsymbol/src/dsymbol/modulecache.d(181,31):        instantiated from here: `getTokensForParser!(ubyte[])`
2025-07-01T19:39:19.2776632Z             tokens = getTokensForParser(
2025-07-01T19:39:19.2777074Z                                        ^
2025-07-01T19:39:19.4071408Z Error dmd failed with exit code 1.
2025-07-01T19:39:19.4077548Z DCD BUILD FAILED

Yet CI passed?

@the-horo
Copy link
Author

the-horo commented Jul 2, 2025

2025-07-01T19:39:14.5152409Z      Warning Warning: License in sub-package dcd:dsymbol is different than its parent package, this is discouraged.
2025-07-01T19:39:14.5171837Z     Starting Performing "profile-gc" build using dmd for x86_64.
2025-07-01T19:39:14.5176245Z     Building msgpack-d 1.0.5: building configuration [default]
2025-07-01T19:39:14.9188518Z     Building dcd:common 0.16.0-beta.3: building configuration [library]
2025-07-01T19:39:14.9188912Z    Pre-build Running commands
2025-07-01T19:39:15.8857434Z     Building emsi_containers 0.9.0: building configuration [library]
2025-07-01T19:39:16.0843952Z     Building libdparse 0.25.0: building configuration [library]
2025-07-01T19:39:18.3902646Z     Building dcd:dsymbol 0.16.0-beta.3: building configuration [library]
2025-07-01T19:39:19.2728615Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/druntime/import/core/internal/array/utils.d-mixin-94(98,830): Error: semicolon needed to end declaration of `name` instead of `trivia`
2025-07-01T19:39:19.2730965Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d-mixin-3002(3006,847): Error: semicolon needed to end declaration of `name` instead of `trivia`
2025-07-01T19:39:19.2743649Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/phobos/std/array.d(3588,16): Error: template instance `core.lifetime._d_newitemTTrace!(InPlaceAppender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[]))` error instantiating
2025-07-01T19:39:19.2750354Z         impl = new InPlaceAppender!A(arr);
2025-07-01T19:39:19.2750782Z                ^
2025-07-01T19:39:19.2756618Z /opt/hostedtoolcache/dc/dmd-2.111.0/x64/dmd2/linux/bin64/../../src/phobos/std/array.d(4494,1):        instantiated from here: `Appender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[])`
2025-07-01T19:39:19.2762360Z Appender!A appender(A)()
2025-07-01T19:39:19.2762707Z ^
2025-07-01T19:39:19.2768225Z ../../../.dub/packages/libdparse/0.25.0/libdparse/src/dparse/lexer.d(568,58):        instantiated from here: `appender!(TokenStructure!(ubyte, "\n    import dparse.lexer : Token;\n\n    this(Token token) pure nothrow @safe @nogc {\n        this(token.type, token.text, token.line, token.column, token.index);\n    }\n\n    int opCmp(size_t i) const pure nothrow @safe @nogc {\n        if (index < i) return -1;\n        if (index > i) return 1;\n        return 0;\n    }\n\n    int opCmp(ref const typeof(this) other) const pure nothrow @safe @nogc {\n        return opCmp(other.index);\n    }\n\n    string toString() const @safe pure\n    {\n        import std.array : appender;\n\n        auto sink = appender!string;\n        toString(sink);\n        return sink.data;\n    }\n\n    void toString(R)(auto ref R sink) const\n    {\n        import std.conv : to;\n        import dparse.lexer : str;\n\n        sink.put(`trivia!\"`);\n        sink.put(str(type));\n        sink.put(`\"(`);\n        sink.put(\"text: \");\n        sink.put([text].to!string[1 .. $ - 1]); // escape hack\n        sink.put(\", index: \");\n        sink.put(index.to!string);\n        sink.put(\", line: \");\n        sink.put(line.to!string);\n        sink.put(\", column: \");\n        sink.put(column.to!string);\n        sink.put(\")\");\n    }\n")[])`
2025-07-01T19:39:19.2774470Z     auto leadingTriviaAppender = appender!(TriviaToken[])();
2025-07-01T19:39:19.2775003Z                                                          ^
2025-07-01T19:39:19.2775783Z dsymbol/src/dsymbol/modulecache.d(181,31):        instantiated from here: `getTokensForParser!(ubyte[])`
2025-07-01T19:39:19.2776632Z             tokens = getTokensForParser(
2025-07-01T19:39:19.2777074Z                                        ^
2025-07-01T19:39:19.4071408Z Error dmd failed with exit code 1.
2025-07-01T19:39:19.4077548Z DCD BUILD FAILED

Yet CI passed?

Right, so this has been an issue for some time and is caused by a templated type that contains a ` in its .stringof, which then breaks this druntime mixin

@the-horo the-horo force-pushed the setup-dlang-v2 branch 2 times, most recently from eb4ed80 to 00ed6cb Compare July 2, 2025 17:03
the-horo added 3 commits July 2, 2025 20:04
ubuntu-20.04 has been retired

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Change the format in which errors are printed to keep it consistent
across all the three major compilers (a style that they all support is
the gnu style) and make the matching code in generate_tests.d more
readable by using a regex.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
@the-horo the-horo force-pushed the setup-dlang-v2 branch 2 times, most recently from 3f9f1b8 to 6047d9b Compare July 2, 2025 17:57
the-horo added 2 commits July 2, 2025 21:02
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
out of 200 runs 26 were above the current 5000 threshold, with the
highest being 5279.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
gdc can output error messages in the system language which can break
the regex mactches the code relies on.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant