Branch: refs/heads/yves/robust_inc_unsquash
Home: https://github.com/Perl/perl5
Commit: f0532d63786f4eb8edf44b8ceab997410e27163d
https://github.com/Perl/perl5/commit/f0532d63786f4eb8edf44b8ceab997410e27163d
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M t/op/inccode.t
M t/op/require_errors.t
Log Message:
-----------
t/ - INC hardening tests
These tests are pretty much all marked TODO. In the
following patches we will remove the TODO as we fix
the bug or implement the feature.
Commit: 03555ca7c98d0b1bd31ba22120eb2c5f7580d949
https://github.com/Perl/perl5/commit/03555ca7c98d0b1bd31ba22120eb2c5f7580d949
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
Log Message:
-----------
pp_ctl.c - rename vars to something more descriptive in require_file()
"i" and "ar" is a bit too minimal, and I will be refactoring
this code somewhat in following patches, so this preps it for
future changes.
Commit: d13dea0a96e3595193167ffd59f419f64af15500
https://github.com/Perl/perl5/commit/d13dea0a96e3595193167ffd59f419f64af15500
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
Log Message:
-----------
pp_ctl.c - make ENTER debug data a bit more clear
We will have more than one INC hook in the future.
Commit: 98ddca27153b0a39cd69f8a3be9628f09d3c0d22
https://github.com/Perl/perl5/commit/98ddca27153b0a39cd69f8a3be9628f09d3c0d22
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
Log Message:
-----------
pp_ctl.c - refetch @INC from *INC after hook
The original value may have been freed by the time the hook
returns, so we have to refetch it immediately after execution.
We also move the declaration into a more minimal scope.
Commit: 59cb793964fc850369ed5052217fdbda5957b777
https://github.com/Perl/perl5/commit/59cb793964fc850369ed5052217fdbda5957b777
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
M t/op/require_errors.t
Log Message:
-----------
pp_ctl.c - eval INC hooks, and rethrow errors with more useful message
When an INC hook blows up debugging what is going on can be
somewhat difficult. This adds some debugging data if the error
message does not seem to be customized.
Commit: 7aa93d41a986119b7b83187f9343e47fc94b5226
https://github.com/Perl/perl5/commit/7aa93d41a986119b7b83187f9343e47fc94b5226
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
Log Message:
-----------
pp_ctl.c - dedupe @INC entries, especially hooks.
Allowing a hook to execute more than once opens up a bunch of failure
modes that are difficult to debug and potentially fatal. Simply skipping
anything seen twice makes all the pain go away. It also might save some
time in terms of not checking the same dir twice, but that is a side
benefit.
Currently this breaks a test, but that test is kinda broken anyway
and will be fixed in a follow up patch.
Commit: 11c1d1b486ed03b4f85a02a44f5dca5670329be7
https://github.com/Perl/perl5/commit/11c1d1b486ed03b4f85a02a44f5dca5670329be7
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
M t/op/inccode.t
M t/op/require_errors.t
Log Message:
-----------
pp_ctl.c - require_file: truthful errors and tests: ties are called once
We need to keep track of what we actually checked. We cannot simply
report the state of @INC at the end of the require, as it might have
changed, possibly several times during the require. This also accounts
for most "silly" stuff that might upset our internal assumptions, for
instance where a tie might report one value to the code doing the
directory check and another in the error message.
We had long standing tests to see that @INC tie elements where called
"once" but they actually tested they were called twice despite claiming
otherwise. This fixes all of those test so that a tied @INC entry is
called exactly once, and whatever it returned the first time is placed
in the error message.
Commit: f803e5f251baea7aa24a945153ebcc36065f66f7
https://github.com/Perl/perl5/commit/f803e5f251baea7aa24a945153ebcc36065f66f7
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
M t/op/require_errors.t
Log Message:
-----------
pp_ctl.c - support $INC in require_file @INC hook
$INC is localized to be the C level index of the loop over the @INC
array. At the end of the hook its value is assigned back to the C level
loop iterator (inc_idx). This allows a hook to control where in the @INC
array the loop should continue, for instance -1 represents "reprocess
from the beginning" (and as a convenience so does undef). This can be
useful if the @INC array is modified by a hook. Normally we would just
"continue along", but this may or may not be the right thing to do, so we
let the user decide.
Commit: 397782767e4dd7c478e765307bdbcf806e890e1d
https://github.com/Perl/perl5/commit/397782767e4dd7c478e765307bdbcf806e890e1d
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
M t/op/require_errors.t
Log Message:
-----------
pp_ctl.c - handle objects in @INC a bit more gracefully
If an object doesn't have an INC hook then don't call it. Either simply
stringify the ref (think overloads), OR, if it is a blessed coderef,
then just execute it like it was an unblessed coderef.
Also handle when an object is passed as the first argument of the
array form of call. Previously this would throw an exception as the
first argument on the stack when we call_method() would not be
blessed. When this is the scenario we pass in the array as the third
argument to the method.
Commit: 4a566853208a634def2a68f57f7d85d1fe065284
https://github.com/Perl/perl5/commit/4a566853208a634def2a68f57f7d85d1fe065284
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
M t/op/inccode.t
M t/op/require_errors.t
Log Message:
-----------
pp_ctl.c - add support for an INCDIR hook
This hook returns a list of directories for Perl to search.
If it returns an empty list it acts like a no-op (except for the
error message). The return from INCDIR is always stringified,
they are not treated the same as normal @INC entries so no hooks
returning hooks.
Commit: 04dcbc619fc0749ca94ab9a6c61f9cfd73310454
https://github.com/Perl/perl5/commit/04dcbc619fc0749ca94ab9a6c61f9cfd73310454
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pp_ctl.c
Log Message:
-----------
pp_ctl.c - move logic closer to where it is used
No sense doing something that has not effect.
Commit: 62bb8bceaf45c21ecb3365bcad4bb433ec1e1b71
https://github.com/Perl/perl5/commit/62bb8bceaf45c21ecb3365bcad4bb433ec1e1b71
Author: Yves Orton <[email protected]>
Date: 2022-11-26 (Sat, 26 Nov 2022)
Changed paths:
M pod/perldelta.pod
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlvar.pod
Log Message:
-----------
pod for INC hook changes, $INC and INCDIR hooks
Compare: https://github.com/Perl/perl5/compare/065d21429745...62bb8bceaf45