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

Update wrap.jl to use Clang.jl's new generator #7

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Update wrap.jl to use Clang.jl's new generator #7

merged 1 commit into from
Mar 5, 2021

Conversation

Gnimuc
Copy link
Contributor

@Gnimuc Gnimuc commented Mar 3, 2021

This PR only updates the generator script, bindings are not regenerated.

@vchuravy
Copy link
Collaborator

vchuravy commented Mar 5, 2021

Thanks @Gnimuc! Trying this out on JuliaInterop/Clang.jl#278 I get:

vchuravy@odin ~/s/F/res (pr/Gnimuc/7)> julia --project=. wrap.jl /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/flux.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/types.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/handle.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/message.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/reactor.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/buffer.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/msg_handler.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/connector.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/request.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/response.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/keepalive.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/rpc.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/future.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/flog.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/panic.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/event.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/module.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/attr.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/conf.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/heartbeat.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/content.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/barrier.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/service.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/version.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/plugin.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_dir.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_lookup.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_getroot.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_txn.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_commit.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/kvs_copy.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/job.h
[ Info: found dependent header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core/subprocess.h
[ Info: [CollectTopLevelNode]: processing header: /home/vchuravy/src/spack/opt/spack/linux-archrolling-zen2/gcc-10.2.0/flux-core-0.23.0-6ujxj27lrueqy7xxaqmhdc5kxmr6m6xg/include/flux/core.h
[ Info: Building the DAG...
[ Info: Emit Julia expressions...
┌ Warning: No Prototype for CLCursor (Clang.CLFunctionDecl) flux_plugin_arg_create() - assuming no arguments
└ @ Clang.Generators ~/.julia/packages/Clang/gRXNU/src/generator/codegen.jl:78
ERROR: LoadError: InexactError: check_top_bit(Int64, 18446744073709551615)
Stacktrace:
 [1] throw_inexacterror(::Symbol, ::Type{Int64}, ::UInt64) at ./boot.jl:558
 [2] check_top_bit at ./boot.jl:572 [inlined]
 [3] toInt64 at ./boot.jl:633 [inlined]
 [4] Int64 at ./boot.jl:708 [inlined]
 [5] convert at ./number.jl:7 [inlined]
 [6] value(::Clang.CLEnumConstantDecl) at /home/vchuravy/.julia/packages/Clang/gRXNU/src/cursor.jl:235
 [7] emit!(::ExprDAG, ::ExprNode{Clang.Generators.EnumAnonymous,Clang.CLEnumDecl}, ::Dict{String,Any}; args::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol},NamedTuple{(:idx,),Tuple{Int64}}}) at /home/vchuravy/.julia/packages/Clang/gRXNU/src/generator/codegen.jl:346
 [8] (::Codegen)(::ExprDAG, ::Dict{String,Any}) at /home/vchuravy/.julia/packages/Clang/gRXNU/src/generator/passes.jl:613
 [9] build!(::Context, ::Clang.Generators.BuildStage) at /home/vchuravy/.julia/packages/Clang/gRXNU/src/generator/context.jl:190
 [10] build!(::Context) at /home/vchuravy/.julia/packages/Clang/gRXNU/src/generator/context.jl:182
 [11] top-level scope at /home/vchuravy/src/FluxRM/res/wrap.jl:24
 [12] include(::Function, ::Module, ::String) at ./Base.jl:380
 [13] include(::Module, ::String) at ./Base.jl:368
 [14] exec_options(::Base.JLOptions) at ./client.jl:296
 [15] _start() at ./client.jl:506
in expression starting at /home/vchuravy/src/FluxRM/res/wrap.jl:24

@vchuravy
Copy link
Collaborator

vchuravy commented Mar 5, 2021

┌ Debug: enum
│   typeKind = CXType_ULong::CXTypeKind = 0x0000000a
│   c = CLCursor (Clang.CLEnumConstantDecl) FLUX_JOBID_ANY
└ @ Clang ~/.julia/packages/Clang/gRXNU/src/cursor.jl:235

Which is:

enum {
    FLUX_JOBID_ANY = 0xFFFFFFFFFFFFFFFF, // ~(uint64_t)0
};

Fixed by JuliaInterop/Clang.jl#282

@vchuravy
Copy link
Collaborator

vchuravy commented Mar 5, 2021

@Gnimuc still generates:

# Skipping MacroDefinition: FLUX_MATCH_ANY flux_match_init ( FLUX_MSGTYPE_ANY , FLUX_MATCHTAG_NONE , NULL \
)

# Skipping MacroDefinition: FLUX_MATCH_EVENT flux_match_init ( FLUX_MSGTYPE_EVENT , FLUX_MATCHTAG_NONE , NULL \
)

# Skipping MacroDefinition: FLUX_MATCH_REQUEST flux_match_init ( FLUX_MSGTYPE_REQUEST , FLUX_MATCHTAG_NONE , NULL \
)

# Skipping MacroDefinition: FLUX_MATCH_RESPONSE flux_match_init ( FLUX_MSGTYPE_RESPONSE , FLUX_MATCHTAG_NONE , NULL \
)

e.g JuliaInterop/Clang.jl#281, but other than that it looks good!

@vchuravy vchuravy merged commit 6a0906a into flux-framework:main Mar 5, 2021
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.

2 participants