Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Clang_jll's version #465

Merged
merged 3 commits into from Mar 6, 2024
Merged

Bump Clang_jll's version #465

merged 3 commits into from Mar 6, 2024

Conversation

Gnimuc
Copy link
Member

@Gnimuc Gnimuc commented Jan 14, 2024

fix #464

@Gnimuc
Copy link
Member Author

Gnimuc commented Jan 14, 2024

There are some undocumented behavior changes introduced in Clang16...

C

typedef struct ImVector_ImDrawCmd {int Size;int Capacity;ImDrawCmd* Data;} ImVector_ImDrawCmd;

typedef struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx;

struct ImDrawChannel
{
    ImVector_ImDrawCmd _CmdBuffer;
    ImVector_ImDrawIdx _IdxBuffer;
};

Clang 16:

getTypeDeclaration(type) = CLCursor (Clang.CLStructDecl) ImDrawChannel
 Clang.CLStructDecl ImDrawChannel
    Clang.CLFieldDecl a Clang.CLElaborated ImVector_ImDrawCmd _CmdBuffer
    Clang.CLFieldDecl a Clang.CLElaborated ImVector_ImDrawIdx _IdxBuffer
(c, ty, getNamedType(ty)) = (CLCursor (Clang.CLFieldDecl) _CmdBuffer, CLType (Clang.CLElaborated) , CLType (Clang.CLTypedef) )
ERROR: LoadError: AssertionError: jlty isa JuliaCenum || jlty isa JuliaCrecord
Stacktrace:
 [1] tojulia(x::Clang.CLElaborated)
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/jltypes.jl:151
 [2] collect_dependent_system_nodes!(dag::ExprDAG, type::Clang.CLRecord, system_nodes::Dict{ExprNode, Int64})
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:133
 [3] collect_dependent_system_nodes!(dag::ExprDAG, node::ExprNode{Clang.Generators.StructForwardDecl, Clang.CLStructDecl}, system_nodes::Dict{ExprNode, Int64})
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:124

Clang 15

getTypeDeclaration(type) = CLCursor (Clang.CLStructDecl) ImDrawChannel
 Clang.CLStructDecl ImDrawChannel
    Clang.CLFieldDecl a Clang.CLTypedef ImVector_ImDrawCmd _CmdBuffer
    Clang.CLFieldDecl a Clang.CLTypedef ImVector_ImDrawIdx _IdxBuffer
ERROR: LoadError: MethodError: no method matching getNamedType(::Clang.CLTypedef)

Closest candidates are:
  getNamedType(::Clang.CLElaborated)
   @ Clang ~/.julia/dev/Clang/src/type.jl:152
  getNamedType(::Clang.LibClang.CXType)
   @ Clang ~/.julia/dev/Clang/src/type.jl:151

Stacktrace:
 [1] macro expansion
   @ ./show.jl:1181 [inlined]
 [2] collect_dependent_system_nodes!(dag::ExprDAG, type::Clang.CLRecord, system_nodes::Dict{ExprNode, Int64})
   @ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:132

@Gnimuc
Copy link
Member Author

Gnimuc commented Jan 14, 2024

I dont know why ImVector_ImDrawCmd needs to be represented as an elaborated type.

@JamesWrigley
Copy link
Member

MWE:

typedef int foo;

typedef struct X
{
    foo field;
} X;

Also, where is CLElaborated defined? 🤔 It's used in a couple places but I can't find the definition anywhere.

@JamesWrigley
Copy link
Member

Oh NVM, I see it's created automatically in cltypes.jl. Man, this is weird 😕 I might try doing a poor-mans bisect with the available Clang_jll versions: https://github.com/JuliaRegistries/General/blob/master/jll/C/Clang_jll/Versions.toml

@Gnimuc
Copy link
Member Author

Gnimuc commented Jan 30, 2024

Oh NVM, I see it's created automatically in cltypes.jl. Man, this is weird 😕 I might try doing a poor-mans bisect with the available Clang_jll versions: https://github.com/JuliaRegistries/General/blob/master/jll/C/Clang_jll/Versions.toml

it would be faster to check the source directly. but this is not urgent. one can always run the generator with the old Julia version .

@JamesWrigley
Copy link
Member

Actually I need it to fix more method ambiguities in 1.11 😅 Example failure: https://github.com/JuliaWeb/LibSSH.jl/actions/runs/7698581250/job/20978180881

Similar to #458. But you're right, it's not urgent yet.

ref: https://reviews.llvm.org/D112374
Co-Authored-By: James Wrigley <JamesWrigley@users.noreply.github.com>
@Gnimuc Gnimuc merged commit 1eb99ce into master Mar 6, 2024
12 of 22 checks passed
@Gnimuc Gnimuc deleted the clang16 branch March 6, 2024 13:45
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.

Unable to install Clang.jl on Julia master for 1.11-dev - needs new libLLVM_jll
2 participants