Calling Pkg.PlatformEngines.probe_platform_engines! (probably probe_symlink_creation more specifically) results in the Logging subsystem getting mutated, causing issues with subsequent attempts to log messages. This is the cause of https://github.com/JuliaLang/julia/issues/37731
I was going to say that I'm about to replace that code, but realized that I'm doing a very similar thing here:
https://github.com/JuliaIO/Tar.jl/blob/77c0db7d17a86852b3eaa94176db968f4cbfabed/src/Tar.jl#L22-L37
What is the correct way to implement this that doesn't screw up the logging system?
That place in Base just shouldn't log, at least not with a level that is visible by default imo. Error or shut up.
The problem is that we expect symlink to fail and don't want it to spam the user.
Yes I know. That's why I am saying that Base shouldn't log so there would be no need to disable the logger.
Ok, but it does: specifically, when a symlink fails on Windows, it tells the user that one cannot create symlinks on Windows. Perhaps a better way to do this is to throw an error with an error message that includes that message. Then there wouldn't be any need for logging or printing a warning.
Yes, aka "error or shut up". ::D
It's precisely for reasons like this that (more or less) unconditional printing inside some library function is kinda dumb.
Yep "error or shut up", happy to have this thrown back onto being Base JuliaLang issues too. 馃憤
I think we should stop disabling logging here, bump Pkg, and make CI happy again. As a separate issue, we can get rid of the warning in symlink in Base.
I'm not against the changes already in the pipeline. But I guess it would have not caused the problem if we were using with_logge(f, NullLogger())?
Most helpful comment
I'm not against the changes already in the pipeline. But I guess it would have not caused the problem if we were using
with_logge(f, NullLogger())?