I love artifacts, but I think currently there are somehow fragile.
I am constantly using a certain artifact, which after some time gets automatically deleted and I get an error like:
Artifact "JuliaMono" was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] _artifact_str(__module__::Module, artifacts_toml::String, name::SubString{String}, path_tail::String, artifact_dict::Dict{String, Any}, hash::Base.SHA1, platform::Base.BinaryPlatforms.Platform, lazyartifacts::Any)
@ Artifacts ~/Downloads/Apps/julia/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:551
[3] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./essentials.jl:716
[4] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base ./essentials.jl:714
[5] top-level scope
@ ~/Downloads/Apps/julia/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:680
Unfortunately using Pkg; Pkg.instantiate()
doesn’t do the trick.
I used to delete the Artifact.toml and reinstall it and that would work, but right now it doesn’t do the job.
I use the ArtifactUtills package because I still find the Pkg API somehow complicated.
Currently I try to run the example but it also throws an error (didn’t used to):
julia> using ArtifactUtils, Artifacts # Artifacts provides the artifact string macro
julia> add_artifact!(
"Artifacts.toml",
"JuliaMono",
"https://github.com/cormullion/juliamono/releases/download/v0.030/JuliaMono.tar.gz",
force=true,
)
SHA1("6c460cf2eccecd24499618112adbbe7e403fa1ee")
julia> import Pkg; Pkg.instantiate()
julia> artifact"JuliaMono" #gives the error above
which gives the error above.
The Artifact.toml
file is being correctly generated.
If I manually add the folder in ~/julia/artifacts/
then it works normally
I didn’t want to raise an issue in ArtifactsUtils
because I suspect that it will not be this package’s problem. My guess would be that Pkg.instantiate()
doesn’t really download the artifact, although it should ?
Tested on a clean Julia 1.7.2 environment.