• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7796: TWiki with current Perl: Make CGI::Carp work from TWiki's distribution

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Being Worked On TWiki:Main.HaraldJoerg    

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

In TWiki's scripts, CGI::Carp is required before we have a chance to add TWiki's own lib directories which provide it. This breaks in Perl versions where CGI is no longer part of the Perl core because of incompatible changes in current CPAN versions. See TWiki:Codev.TWikiWithCurrentPerl for details.
  • Done in Rev. 30317 (not shown here??) and Rev. 30319. No problems so far, should be good to go. -- TWiki:Main/HaraldJoerg - 2017-05-26

-- TWiki:Main/HaraldJoerg - 2017-04-07

-- TWiki:Main.HaraldJoerg - 2017-07-06

Second try.... all files in the bin directory are patched as shown in the attachment nocgi.diff. Now, the procedure is like this:

  1. Immediately at start, activate Carp::confess as a die handler. Carp.pm is in Perl core since at least version 5.8.8. This works for CLI and CGI environment, regardless of whether CGI.pm comes with Perl, or is installed on the system, or neither of both.
  2. Set $TWiki::cfg{Engine} according to the environment, but do not switch to CGI::Carp for a CGI environment right now.
  3. Add the current directory to @INC and require 'setlib.cfg'.
    • Since we've already activated a die handler, problems in setlib.cfg or LocalLib.cfg will provide a stacktrace as confess does (unless suppressed by eval).
  4. Now, after setlib.cfg is done, it is safe to switch to CGI::Carp only in a CGI environment and establish CGI::Carp::confess as die handler. At this stage the fallback provided by TWiki's own copy of CGI::Carp is available!

The last step could also be factored out into the equivalent BEGIN block in TWiki.pm.

-- TWiki:Main.HaraldJoerg - 2017-11-02

ItemTemplate
Summary TWiki with current Perl: Make CGI::Carp work from TWiki's distribution
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4
SVN Range TWiki-6.0.2-trunk, Sun, 12 Feb 2017, build 30309
AppliesTo Engine
Component

Priority Normal
CurrentState Being Worked On
WaitingFor TWiki:Main.HaraldJoerg
Checkins TWikirev:30319 TWikirev:30371 TWikirev:30372 TWikirev:30402
TargetRelease

ReleasedIn

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdiff nocgi.diff r1 manage 0.4 K 2017-11-02 - 15:14 HaraldJoerg Diff file appied to every file in core/bin
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2017-11-02 - HaraldJoerg
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback