julia-actions / cache

A shortcut action to cache Julia artifacts, packages, and registries.
MIT License
38 stars 8 forks source link

New cache causes DataDeps to crash #80

Closed rikhuijzer closed 8 months ago

rikhuijzer commented 9 months ago

I got the following error after switching to the new cache system:

┌ Error: No writable path exists to save the data. Make sure there exists as writable path in your DataDeps Load Path.
│ See https://www.oxinabox.net/DataDeps.jl/stable/z10-for-end-users/#The-Load-Path-1
│ The current load path contains:
│   cands =
│    8-element Vector{String}:
│     "/home/runner/.julia/datadeps"
│     "/opt/hostedtoolcache/julia/1.9.4/x64/local/share/julia/datadeps"
│     "/opt/hostedtoolcache/julia/1.9.4/x64/share/julia/datadeps"
│     "/home/runner/datadeps"
│     "/scratch/datadeps"
│     "/staging/datadeps"
│     "/usr/share/datadeps"
│     "/usr/local/share/datadeps"
└ @ DataDeps ~/.julia/packages/DataDeps/1KjBt/src/locations.jl:116
ERROR: LoadError: DataDeps.NoValidPathError("No writable path exists to save the data.")
Stacktrace:
  [1] determine_save_path(name::String, rel::String)
    @ DataDeps ~/.julia/packages/DataDeps/1KjBt/src/locations.jl:121
  [2] handle_missing
    @ ~/.julia/packages/DataDeps/1KjBt/src/resolution_automatic.jl:9 [inlined]
  [3] _resolve
    @ ~/.julia/packages/DataDeps/1KjBt/src/resolution.jl:83 [inlined]
  [4] resolve(datadep::DataDep, inner_filepath::String, calling_filepath::String)
    @ DataDeps ~/.julia/packages/DataDeps/1KjBt/src/resolution.jl:29
  [5] resolve(datadep_name::String, inner_filepath::String, calling_filepath::String)
    @ DataDeps ~/.julia/packages/DataDeps/1KjBt/src/resolution.jl:54
  [6] resolve
    @ ~/.julia/packages/DataDeps/1KjBt/src/resolution.jl:73 [inlined]
  [7] cancer()
    @ Main ~/work/SIRUS.jl/SIRUS.jl/test/preliminaries.jl:71
  [8] top-level scope
    @ ~/work/SIRUS.jl/SIRUS.jl/test/preliminaries.jl:183
  [9] include(fname::String)
    @ Base.MainInclude ./client.jl:478
 [10] top-level scope
    @ ~/work/SIRUS.jl/SIRUS.jl/test/runtests.jl:1
 [11] include(fname::String)
    @ Base.MainInclude ./client.jl:478
 [12] top-level scope
    @ none:6
in expression starting at /home/runner/work/SIRUS.jl/SIRUS.jl/test/preliminaries.jl:163

when calling datadep"SomeDep".

@IanButterworth do you know why this might start to fail now? Is ~/.julia now readonly while it wasn't?

I am quite sure that this is caused by the switch to the new system. I had this crash before and then I switched back to julia-actions/cache@v1.3.0 and removed all caches. Today, I tried the new julia-actions/cache again and got the same error.

Issue https://github.com/julia-actions/cache/issues/40 is slightly related. It also talks about DataDeps.

rikhuijzer commented 9 months ago

Maybe we should just cache .julia/datadeps by default too because my counterargument in https://github.com/julia-actions/cache/issues/40#issuecomment-1369791345 doesn't hold anymore now with the new system.

IanButterworth commented 9 months ago

Yeah I guess we could add a custom field. See #74

The same argument came up for the makie dir in the depot but people pointed out Makie should use scratchspaces.

Is there a reason why DataDeps doesn't use scratchspaces?

rikhuijzer commented 9 months ago

Is there a reason why DataDeps doesn't use scratchspaces?

It seems not https://github.com/oxinabox/DataDeps.jl/issues/135

IanButterworth commented 9 months ago

Ok. Let's do that then. Then we don't have to get people do a manual step.

rikhuijzer commented 9 months ago

Ok. Let's do that then. Then we don't have to get people do a manual step.

Yes you're right. That would be the best solution 👍 Do you have time to open a PR to DataDeps? Otherwise, I'll probably pick it up somewhere next week

IanButterworth commented 9 months ago

https://github.com/oxinabox/DataDeps.jl/pull/167

IanButterworth commented 8 months ago

Until that's fixed in DataDeps you can either downgrade to cache@v1.3 or keep v1 and force cache-compiled: false (but both require remembering to revert the change once it's fixed)

rikhuijzer commented 8 months ago

Until that's fixed in DataDeps you can either downgrade to cache@v1.3 or keep v1 and force cache-compiled: false (but both require remembering to revert the change once it's fixed)

Sounds good 👍 Thanks. I'll close this as the issue is at the DataDeps side.