Conversation
$LOADED_FEATURES holds absolute paths for anything the real require loaded, so anchoring the check with \A made it unable to match them. require 'x' followed by irb_require 'x' re-evaluates x.rb in the session. Anchor on a path boundary instead, which still rejects the foo/foo2 substring match ruby#1253 was fixing.
The probe file read an uninitialized global, which warns on stderr under -w and tripped the test's own assert_empty(err) on the CI rows that enable warnings.
Author
|
Pushed a fix for the red rows, which were mine: the probe file read My local run had not enabled warnings, which is why I missed it; re-ran the whole matrix with
Full suite under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1253 anchored the already-loaded check with
\A, but$LOADED_FEATURESholds absolute paths for anything the realrequireloaded, so the guard can no longer match them:Measured against the shapes that actually appear in
$":file_name$"entryfoo/tmp/x/foo.rbfoofoo.rb(whatirb_requireitself pushes)foo/tmp/x/foo2.rbfoo/tmp/x/barfoo.rbAnchoring on a path boundary rather than the string start keeps both: absolute entries match again, and the
foo/foo2substring match #1253 was fixing stays rejected.Verification
Base
d05df55, Dockerruby:3.4.load.rbmd5test_irb_require_file_matches_exact_name3b81c5e261f15815509a\zec0bb20c9e4f7a97b201The two mutants are killed by different rows of the new test: the
\zby theirb_require 'irb_require'case, the boundary by theirb_require 'probe'case.Full suite with the fix: 409 tests, 2496 assertions, 1 failure. That one is
test_use_tracer_enabled_when_gem_is_available, which also fails on unmodifiedd05df55with the unmodified test file (408 tests, 1 failure) because thetracergem is not installed in the container;load.rbdoes not mention tracer.rubocop: 116 files inspected, no offenses.Not run here:
rake test_in_isolation, theyamatanoorotiintegration tests (need libvterm, no sudo), the debug-compat job, and the Ruby 2.7 to 3.3 and prism 1.3.0/1.7.0 matrix rows. The change is a regex literal, so cross-version risk is low, but I have not verified it.One observation while writing the test, offered as something worth extending rather than a complaint.
test_irb_require_file_matches_exact_namestill passes with the complete pre-#1253 regex restored, so it does not reproduce #1252: it loadsfoothenfoo2, andfoois not a substring offoo.rbat that point. Reproducing #1252 needsfoo2loaded first, sincefoois a substring offoo2.rb.I also left
irb_requirepushing relative names into$"atlib/irb/command/load.rb:55and:66alone, and did not widen the extension list beyond the existing(?:\.o|\.rb)?, so a.sofeature still will not match. Both seemed like separate scope.Disclosure: written with the help of Claude (an AI assistant). Every number above is from runs on my machine.