Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clima_artifact for Julia 1.12 #123

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- '1.9'
- '1.10'
- '1.11'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
ClimaUtilities.jl Release Notes
===============================

main
------

### Bug fixes

- Fixed `@clima_artifact` for Julia 1.12. PR [#123](https://github.com/CliMA/ClimaUtilities.jl/pull/123)

v0.1.17
------

Expand Down
20 changes: 16 additions & 4 deletions src/ClimaArtifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ macro clima_artifact(name, context = nothing)
# If artifact_name is not a string (e.g., it is a variable), we have to do all the
# work at runtime
return quote
if VERSION >= v"1.12.0-DEV.1163"
local LazyArtifacts = Val($(lazyartifacts))
else
local LazyArtifacts = $(lazyartifacts)
end

local platform = $(esc(platform))
local artifact_name, artifact_path_tail, hash =
JuliaArtifacts.artifact_slash_lookup(
Expand All @@ -126,7 +132,7 @@ macro clima_artifact(name, context = nothing)
$(artifact_dict),
$(hash),
$(platform),
$(lazyartifacts),
LazyArtifacts,
)::String
end
push!(ACCESSED_ARTIFACTS, artifact_name)
Expand All @@ -139,13 +145,19 @@ macro clima_artifact(name, context = nothing)
$(artifact_dict),
$(hash),
$(platform),
$(lazyartifacts),
LazyArtifacts,
)::String
end
else
# If artifact_name is not a string (e.g., it is a variable), we have to do all the
# work at runtime
return quote
if VERSION >= v"1.12.0-DEV.1163"
local LazyArtifacts = Val($(lazyartifacts))
else
local LazyArtifacts = $(lazyartifacts)
end

local platform = $(esc(platform))
local artifact_name, artifact_path_tail, hash =
JuliaArtifacts.artifact_slash_lookup(
Expand Down Expand Up @@ -179,7 +191,7 @@ macro clima_artifact(name, context = nothing)
$(artifact_dict),
hash,
platform,
$(lazyartifacts),
LazyArtifacts,
)::String
end
push!(ACCESSED_ARTIFACTS, artifact_name)
Expand All @@ -193,7 +205,7 @@ macro clima_artifact(name, context = nothing)
$(artifact_dict),
hash,
platform,
$(lazyartifacts),
LazyArtifacts,
)::String
end
end
Expand Down
Loading