oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
644 stars 248 forks source link

Avoid method redefinition warning #369

Closed deivid-rodriguez closed 2 months ago

deivid-rodriguez commented 5 months ago

We're getting some test failures in rubygems because we run gem commands in verbose mode, in situations where the default GEM_HOME is not writable.

I'm not sure of the root cause (why GEM_HOME is not writable), since it only happens sporadically so I guess some other specs may be leaking permission changes or something. Also we could probably switch those to run in non verbose mode, or manually skip the warnings. But it seems best to not let the warning be printed in the first place, since that's exactly what's intended here.

This PR is a hack to achieve that.

deivid-rodriguez commented 5 months ago

I'm now thinking that maybe the issue is multiple processes trying to write/delete this sentinel file concurrently? If that's the case, maybe adding the PID to the file name could help?

deivid-rodriguez commented 5 months ago

Oh, and one last thing! Similar logic has now landed to RubyGems, although it's slightly different in approach and functionally:

We may want to eventually unify all this!

deivid-rodriguez commented 5 months ago

Ooops, closed accidentally.

deivid-rodriguez commented 3 months ago

Fixed a typo and rebased.