From f2520ef413b4c81ed32536285dba736269b9740d Mon Sep 17 00:00:00 2001 From: Christopher Rowley Date: Fri, 14 Aug 2026 15:58:04 +0100 Subject: [PATCH] avoid precompile cache miss from check-bounds option --- CHANGELOG.md | 3 +++ pyproject.toml | 2 +- pysrc/juliacall/__init__.py | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0aedc8..76236185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Unreleased +* Bug fix: avoid precompilation cache miss when `check_bounds` option set. + ## 0.9.35 (2026-06-08) * Add option `lib` to JuliaCall. Setting this will skip the discovery subprocess. * Add support for using a system image in `juliacall` that has `PythonCall` baked in. diff --git a/pyproject.toml b/pyproject.toml index 4307ed18..74a07b03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "Operating System :: OS Independent", ] requires-python = ">=3.10, <4" -dependencies = ["juliapkg >=0.1.24, <0.2"] +dependencies = ["juliapkg >=0.1.26, <0.2"] [dependency-groups] dev = [ diff --git a/pysrc/juliacall/__init__.py b/pysrc/juliacall/__init__.py index 97df0e51..7eaf4648 100644 --- a/pysrc/juliacall/__init__.py +++ b/pysrc/juliacall/__init__.py @@ -198,6 +198,18 @@ def args_from_config(config): # `exepath` and `project` are set by the user. import juliapkg + # Explicitly resolve so we can pass through julia_args. This ensures that any + # precompilation done by juliapkg matches how we launch julia, avoiding + # cache misses. + julia_args = [ + "--" + opt[4:].replace("_", "-") + "=" + CONFIG[opt] + for opt in [ + "opt_check_bounds", + ] + if CONFIG[opt] is not None + ] + juliapkg.resolve(julia_args=julia_args) + # Find the Julia executable and project CONFIG['exepath'] = exepath = juliapkg.executable() CONFIG['project'] = project = juliapkg.project()