Branch: refs/heads/yves/robust_inc_unsquash
  Home:   https://github.com/Perl/perl5
  Commit: 2b4e2dd47aa36249559ad81770badb1253faa280
      
https://github.com/Perl/perl5/commit/2b4e2dd47aa36249559ad81770badb1253faa280
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 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: 2fa9a9014f94eff0af43b6efcdb3dc820bbb489e
      
https://github.com/Perl/perl5/commit/2fa9a9014f94eff0af43b6efcdb3dc820bbb489e
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 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: 27d8cb88fcd0733c82bec66e3182d540f8589026
      
https://github.com/Perl/perl5/commit/27d8cb88fcd0733c82bec66e3182d540f8589026
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 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: 8a85f7a0177349a51ed134314771b51d5e237da6
      
https://github.com/Perl/perl5/commit/8a85f7a0177349a51ed134314771b51d5e237da6
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pp_ctl.c

  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: 5b4cbb01c872f9084793f98802532b73cde1a295
      
https://github.com/Perl/perl5/commit/5b4cbb01c872f9084793f98802532b73cde1a295
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 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.


  Commit: ea29cd16ab01ed2ba58901d64cb2f824406b19f4
      
https://github.com/Perl/perl5/commit/ea29cd16ab01ed2ba58901d64cb2f824406b19f4
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pp_ctl.c

  Log Message:
  -----------
  pp_ctl.c - require_file: ensure error message are truthful

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 buggers" stuff where a tie might report one value
to the code doing the directory check and another in the error message.


  Commit: 7db0008bedef28e08a8581f9e545b978b08b88f8
      
https://github.com/Perl/perl5/commit/7db0008bedef28e08a8581f9e545b978b08b88f8
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pp_ctl.c

  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: d6e4fd1f3e37664cda47598c44b5ea4335dcfb7d
      
https://github.com/Perl/perl5/commit/d6e4fd1f3e37664cda47598c44b5ea4335dcfb7d
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pp_ctl.c

  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: 678af218521fad7084f41d079d8793d87704bfa3
      
https://github.com/Perl/perl5/commit/678af218521fad7084f41d079d8793d87704bfa3
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pp_ctl.c

  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: 05d095b55007b76adb6c1057196c5001d7c26d69
      
https://github.com/Perl/perl5/commit/05d095b55007b76adb6c1057196c5001d7c26d69
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 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: ef4902b28d9e1095b7b6035dedcb6cb08384daac
      
https://github.com/Perl/perl5/commit/ef4902b28d9e1095b7b6035dedcb6cb08384daac
  Author: Yves Orton <[email protected]>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M pod/perldelta.pod
    M pod/perldiag.pod
    M pod/perlfunc.pod
    M pod/perlvar.pod
    M t/op/inccode.t
    M t/op/require_errors.t

  Log Message:
  -----------
  pod/ and t/ - INC hook hardening tests and documentation

These are tests and documentation for the new INC changes.

Document $INC, INCDIR, and related changes. Add or fix tests for the
various cases and new functionality.


Compare: https://github.com/Perl/perl5/compare/2b4e2dd47aa3%5E...ef4902b28d9e

Reply via email to