NickelEval.jl

Julia FFI bindings for Nickel configuration language
Log | Files | Refs | README | LICENSE

commit 4aa40f21d60e64452f05a03ca94e8528e71a5927
parent 091a0bab3f0b4bc4b253b835995e6fe85f4eb4ff
Author: Erik Loualiche <eloualic@umn.edu>
Date:   Sat,  7 Feb 2026 13:40:08 -0600

Fix artifact loading to use @artifact_str macro properly

The macro handles lazy download triggering correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Diffstat:
Msrc/ffi.jl | 21+++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/ffi.jl b/src/ffi.jl @@ -12,7 +12,7 @@ # - Direct memory sharing # - Better performance for repeated evaluations -using Artifacts +using Artifacts: artifact_hash using LazyArtifacts # Determine platform-specific library name @@ -26,19 +26,16 @@ end # Find library path: try artifact first, then local deps/ function _find_library_path() - artifact_toml = joinpath(@__DIR__, "..", "Artifacts.toml") - # Try artifact (Julia auto-selects platform based on arch/os in Artifacts.toml) - if isfile(artifact_toml) - try - artifact_dir = @artifact_str("libnickel_jl", artifact_toml) - lib_path = joinpath(artifact_dir, LIB_NAME) - if isfile(lib_path) - return lib_path - end - catch e - # Artifact not available (lazy artifact not downloaded, or platform not supported) + try + # @artifact_str triggers lazy download if needed + artifact_dir = @artifact_str("libnickel_jl") + lib_path = joinpath(artifact_dir, LIB_NAME) + if isfile(lib_path) + return lib_path end + catch e + # Artifact not available (platform not supported or download failed) end # Fall back to local deps/ folder (for development)