Closed rbvermaa closed 1 year ago
Seems fine. Doesn't Pkg have the same problem though? Perhaps there should be generic flag that also Pkg uses?
We haven't run into issues with Pkg, fortunately.
@fredrikekre Applied the rename you suggested. Thanks!
Just to confirm, the problem here is that Scratch.jl writes the logfile when accessing it, i.e. during "runtime", whereas Pkg only prints usage logs in Pkg.instantiate?
Just to confirm, the problem here is that Scratch.jl writes the logfile when accessing it, i.e. during "runtime", whereas Pkg only prints usage logs in Pkg.instantiate?
I think that is the case, yes.
@fredrikekre Anything preventing this from being merged?
Could maybe use the get_bool_env
thing in Base to also support setting it to false
etc.
Add JULIA_TRACK_SCRATCH_ACCESS env variable, to allow disabling tracking of scratch access. Set to JULIA_TRACK_SCRATCH_ACCESS=0 to disable.
Rationale: we use PackageCompiler.jl to generate a readonly build artifact for deployment. PackageCompiler sets the depot path in the created executable, here: https://github.com/JuliaLang/PackageCompiler.jl/blob/master/src/embedding_wrapper.c#L96 When building the package, we make sure the scratchspaces are filled as expected, however, Scratch.jl wants to write a log of the usage, which we do not want. This PR would allow us to disable this logging. We also tried running the PackageCompiler binary with an extended DEPOT_PATH (where the first path in would be writable), however, this will cause the scratchspaces to be created on the first runtime execution, which is not desirable (wrt reproducibility and possible runtime errors, eg. download/network issues ).