From aa232cc61653f509d791fa41b7f15e0ffc3f6693 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Mon, 30 Oct 2023 16:30:58 -0400 Subject: [PATCH 1/2] Fix breakage due to JuliaLang/julia#51319 `cconvert` does not return an array anymore and cannot be used with `reinterpret`. Fix to use the underlying `transcode` function directly, which is also consistent with the `Cstring` version. --- deps/depsutils.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deps/depsutils.jl b/deps/depsutils.jl index 35ed1e12..73ae2946 100644 --- a/deps/depsutils.jl +++ b/deps/depsutils.jl @@ -64,8 +64,10 @@ function _preserveas!(dest::Vector{UInt8}, ::Type{Cstring}, x::AbstractString) end function _preserveas!(dest::Vector{UInt8}, ::Type{Cwstring}, x::AbstractString) - s = reinterpret(UInt8, Base.cconvert(Cwstring, x)) - copyto!(resize!(dest, length(s)), s) + s = reinterpret(UInt8, transcode(Cwchar_t, String(x))) + len = length(s) + copyto!(resize!(dest, len + sizeof(Cwchar_t)), s) + dest[len + 1:len + sizeof(Cwchar_t)] .= 0 return pointer(dest) end From f54a801fc94f273c9f2d371918c27d2c704047fe Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Mon, 30 Oct 2023 16:45:07 -0400 Subject: [PATCH 2/2] Fix doc test --- Project.toml | 3 ++- test/runtests.jl | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 413c2820..565f73fb 100644 --- a/Project.toml +++ b/Project.toml @@ -20,6 +20,7 @@ julia = "1.4" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [targets] -test = ["Test"] +test = ["Test", "REPL"] diff --git a/test/runtests.jl b/test/runtests.jl index 96dc4fa3..bc124a52 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,7 @@ using PyCall using PyCall: hasproperty using Test, Dates, Serialization +using REPL # for Docs.doc methods filter(f, itr) = collect(Iterators.filter(f, itr)) filter(f, d::AbstractDict) = Base.filter(f, d)