make app.psgi runnable, fix static path regex to efficient, and make @INC contain absolute paths.

RESOLVED FIXED in Bugzilla 6.0



3 years ago
2 years ago


(Reporter: dylan, Assigned: dylanAtHome)


Bugzilla 6.0
Dependency tree / graph



(1 attachment, 5 obsolete attachments)

To use plackup for development, it is required to pass several paths using -R so that when files change, the service is restarted. Rather than burden the documentation with this, we should have a wrapper that runs it with the correct parameters for development.
Target Milestone: --- → Bugzilla 6.0
Version: 4.4 → 5.1
Severity: normal → enhancement
Component: Bugzilla-General → Installation & Upgrading
Flags: needinfo?(olga-github)
Attachment #8800489 - Attachment mime type: application/x-perl → text/plain
Summary: Add wrapper for plackup optimized for development → make app.psgi runnable
Attachment #8800489 - Attachment is obsolete: true
Assignee: dylan → dylan
Attachment #8841247 - Attachment is obsolete: true
Summary: make app.psgi runnable → make app.psgi runnable, fix static path regex to efficient, and make @INC contain absolute paths.
Comment on attachment 8841282 [details] [review]
[bugzilla] dylanwh:bug-1272673 > bugzilla:master

The pull request does three things that are pretty non-controversial:

1) it makes it so @INC contains only absolute paths, and also disables 'use lib' (copying the behavior from
2) For the static file handling, it sorts the regex by length, which gurantees that the regex match more efficiently. This was inspired by what the wonderful list2re() function of Data::Munge does.
3) Finally, it users caller() to detect if it is being run on the command line, and if so it runs itself. So we don't need the user to type a weird complicated command, they just run "perl app.psgi".

This is the recommended way of making a self-runnable psgi, per the documentation:
Attachment #8841282 - Flags: review?(jfearn)
Blocks: 1291006
Attachment #8841282 - Flags: review?(jfearn) → review+
   dfb688869..c6363140a  master -> master
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.