JuliaPackaging / Scratch.jl

Scratch spaces for all your persistent mutable data needs
MIT License
58 stars 11 forks source link

Option to disable scratch_usage.toml #32

Closed tp2750 closed 2 years ago

tp2750 commented 2 years ago

The function track_scratch_access writes an entry to joinpath(first(Base.DEPOT_PATH), "logs", "scratch_usage.toml") when it is called.

This breaks my workflow, where I have several users sharing a common read-only DEPOT_PATH.

Would it be acceptable to make it possible to disable this writing by setting an environment variable (e.g. DISABLE_SCRATCH_JL_LOG=1)?

I'll be happy to send a PR.

fredrikekre commented 2 years ago

Does that even work in practice? There is a lot of code, in Pkg and other places, that assume the first entry in DEPOT_PATH is writeable. Shared depots should usually be lower in DEPOT_PATH.

giordano commented 2 years ago

That's also documented: https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT_PATH

tp2750 commented 2 years ago

Thank you @giordano I did not find that. I'll update my setup to be less constrained.

I have not run into problems with this before @fredrikekre , but it has also not been tested a lot. The problem came up with https://github.com/JuliaTime/TimeZones.jl

I'll close and fix my setup :smile:

Thank you for your input.