From 9f7801f900d710653386e2647cd68954dbc4cdd4 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Thu, 13 Jun 2024 14:05:48 +0200 Subject: [PATCH 1/2] Close the default Context in the precompilation workload --- docs/src/_changelog.md | 5 +++++ src/ZMQ.jl | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/docs/src/_changelog.md b/docs/src/_changelog.md index 1baff64..63dc32e 100644 --- a/docs/src/_changelog.md +++ b/docs/src/_changelog.md @@ -13,6 +13,11 @@ Changelog](https://keepachangelog.com). - [`lib_version()`](@ref) to get the libzmq version ([#240]). +### Fixed + +- Fixed a precompilation bug that would cause creating a sysimage with + PackageCompiler.jl on Julia 1.6 to fail ([#242]). + ## [v1.2.5] - 2024-05-28 ### Fixed diff --git a/src/ZMQ.jl b/src/ZMQ.jl index 8805754..9a74306 100644 --- a/src/ZMQ.jl +++ b/src/ZMQ.jl @@ -85,6 +85,13 @@ import PrecompileTools: @compile_workload unsafe_string(ZMQ.recv(s2)) ZMQ.close(s1) ZMQ.close(s2) + + # Using the library like this workload will initialize ZMQ._context, which + # contains a pointer. This doesn't seem to play well with serialization on + # Julia 1.6 with PackageCompiler so we explicitly close it to reset the + # pointer. + # See: https://github.com/JuliaLang/julia/issues/46214 + close(ZMQ._context) end end From fe20fa428e6a6257e0cafec97a54c73b32e509d3 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Thu, 13 Jun 2024 15:35:37 +0200 Subject: [PATCH 2/2] Bump version to 1.2.6 --- Project.toml | 2 +- docs/src/_changelog.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index ea8ef60..11e97cf 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ZMQ" uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1" -version = "1.2.5" +version = "1.2.6" [deps] FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" diff --git a/docs/src/_changelog.md b/docs/src/_changelog.md index 63dc32e..367e16c 100644 --- a/docs/src/_changelog.md +++ b/docs/src/_changelog.md @@ -7,7 +7,7 @@ CurrentModule = ZMQ This documents notable changes in ZMQ.jl. The format is based on [Keep a Changelog](https://keepachangelog.com). -## Unreleased +## [v1.2.6] - 2024-06-13 ### Added