Skip to content

Commit

Permalink
Merge branch 'prerelease'
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Feb 11, 2023
2 parents 1e74978 + 69a9a33 commit 42ec105
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CxxWrap"
uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
authors = ["Bart Janssens <bart@bartjanssens.org>"]
version = "0.13.1"
version = "0.13.2"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,17 @@ mod.method("getSecondaryWorldVector", [](const World* p)->const std::vector<Worl

Linking wrappers using STL support requires adding `JlCxx::cxxwrap_julia_stl` to the `target_link_libraries` command in `CMakeLists.txt`.

## Release procedure

Often, new releases of `CxxWrap` also require a new release of the C++ component `libcxxwrap-julia`, and a rebuild of its JLL package. To make sure everything is tested properly, the following procedure should be followed for each release that requires changing both the Julia and the C++ component:

1. Merge the changes to `CxxWrap` into the `testjll` branch
2. Create a PR in `libcxxwrap-julia` with the required changes there and make sure it passes all tests. These tests will run using the `CxxWrap#testjll` branch.
3. Merge the `libcxxwrap-julia` PR. This will build and publish a JLL, available through the [CxxWrapTestRegistry](/~https://github.com/barche/CxxWrapTestRegistry)
4. Make a PR in `CxxWrap` to merge `testjll` into `prerelease`. Verify that the tests pass (rerun them if needed, since the first push to `testjll` will have used the old JLL version). Don't merge this PR yet.
5. Tag the next `libcxxwrap-julia` release and update to this new release in Yggdrasil
6. Wait for the new JLL to appear in the registry and then merge the PR from point 4. Verify that the tests running on the `prerelease` branch pass, by merging the PR from point 4. The difference with the tests in the `testjll` branch is that the `prerelease` branch tests using the JLL in the Julia General repository.
7. Merge the CxxWrap `prerelease` branch into `main` and create a new release using Registrator.

## Breaking changes for CxxWrap 0.7

Expand Down
4 changes: 4 additions & 0 deletions src/CxxWrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ map_julia_arg_type(t::Type{ConstCxxRef{T}}, ::Type{IsNormalType}) where {T} = Un
map_julia_arg_type(t::Type{ConstCxxPtr{T}}, ::Type{IsNormalType}) where {T} = Union{ConstPtrTypes{T},Ptr{Cvoid}}
map_julia_arg_type(t::Type{CxxRef{T}}, ::Type{IsNormalType}) where {T} = PtrTypes{T}
map_julia_arg_type(t::Type{CxxPtr{T}}, ::Type{IsNormalType}) where {T} = Union{PtrTypes{T},Ptr{Cvoid}}
map_julia_arg_type(t::Type{CxxPtr{CxxPtr{CxxChar}}}, ::Type{IsNormalType}) = Union{PtrTypes{CxxPtr{CxxChar}},Ptr{Cvoid},Vector{String}}

map_julia_arg_type(t::Type{ConstCxxRef{T}}, ::Type{IsNormalType}) where {T<:CxxNumber} = Union{ConstPtrTypes{julia_int_type(T)},map_julia_arg_type(T)}
map_julia_arg_type(t::Type{ConstCxxPtr{T}}, ::Type{IsNormalType}) where {T<:CxxNumber} = Union{ConstPtrTypes{julia_int_type(T)},Ptr{Cvoid}}
Expand Down Expand Up @@ -560,6 +561,9 @@ Base.cconvert(to_type::Type{<:CxxBaseRef{T}}, v::CxxBaseRef{T}) where {T} = to_t
Base.unsafe_convert(to_type::Type{<:CxxBaseRef{T}}, v::CxxBaseRef) where {T} = to_type(v.cpp_object)
Base.unsafe_convert(to_type::Type{<:CxxBaseRef}, v::Base.RefValue) = to_type(pointer_from_objref(v))

Base.cconvert(::Type{CxxPtr{CxxPtr{CxxChar}}}, v::Vector{String}) = Base.cconvert(Ptr{Ptr{Cchar}}, v)
Base.unsafe_convert(to_type::Type{CxxPtr{CxxPtr{CxxChar}}}, a::Base.RefArray{Ptr{Int8}, Vector{Ptr{Int8}}, Any}) = to_type(Base.unsafe_convert(Ptr{Ptr{Cchar}}, a))

cxxconvert(to_type::Type{<:CxxBaseRef{T}}, x, ::Type{IsNormalType}) where {T} = Ref{T}(convert(T,x))
cxxconvert(to_type::Type{<:CxxBaseRef{T}}, x::Base.RefValue, ::Type{IsNormalType}) where {T} = x
cxxconvert(to_type::Type{<:CxxBaseRef{T}}, x::Ptr{T}, ::Type{IsNormalType}) where {T} = to_type(x)
Expand Down
4 changes: 4 additions & 0 deletions test/basic_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,8 @@ let (intnames, inttypes) = BasicTypes.julia_integer_mapping()
end
end

let argv = ["one", "two", "three"]
@test BasicTypes.test_argv(Cint(length(argv)), argv) == join(argv)
end

end

0 comments on commit 42ec105

Please sign in to comment.