aufflick has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I'm preparing a little webserver module (yes really, another one) aimed at prototyping a-la Ruby's WEBrick. It fits a niche (well, it fits my niche anyway) so I thought I'd submit it to CPAN.

While I'm waiting for my password and/or email to be reset on PAUSE (must have made a typo 3 years ago on my email!) I thought it might be good to get one or two of my fellow monks to cast their eyes over my (0.0.5) release to see if I've made any obvious CPAN faux par.

You can get a tar file of the files I plan to release from my CVS: HTTP-Server-Brick.tar.gz or browse them: HTTP-Server-Brick

Thanks for your time.

  • Comment on Hoping for some beady eyes on my first CPAN submission

Replies are listed 'Best First'.
Re: Hoping for some beady eyes on my first CPAN submission
by syphilis (Archbishop) on Jun 23, 2007 at 15:28 UTC
    Hi,
    Two things:
    1) When it hits CPAN it should arrive as HTTP-Server-Brick-0.0.5.tar.gz (not HTTP-Server-Brick.tar.gz);
    2) The '.cvsignore' file should be missing.

    Of course, you might already have been on top of both those issues .... (mumble, mumble ... apologies :-)

    On Windows, I get:
    C:\_32\comp\HTTP-Server-Brick>perl Makefile.PL # running Build.PL C:\perl58_M\bin\perl.exe Build.PL Checking whether your kit is complete... Looks good Checking prerequisites... Looks good Creating new 'Build' script for 'HTTP-Server-Brick' version '0.0.5' Unknown 'build_class', defaulting to 'Module::Build' C:\_32\comp\HTTP-Server-Brick>dmake test C:\perl58_M\bin\perl.exe Build --makefile_env_macros 1 test Copying lib\HTTP\Server\Brick.pm -> blib\lib\HTTP\Server\Brick.pm t\00.load.........ok 1/1# Testing HTTP::Server::Brick v0.0.5 t\00.load.........ok t\pod-coverage....skipped all skipped: Test::Pod::Coverage 1.04 required for testing POD + cover t\pod.............skipped all skipped: Test::Pod 1.14 required for testing POD t\serving.........ok 1/59# # # Using port: 85432 and host: localhost for test server. # If these are not suitable settings on your machine, set the environm +ent # variables HSB_TEST_PORT and HSB_TEST_HOST to something suitable. # # Starting server t\serving.........ok 7/59 t\serving.........NOK 8# Failed test 'Directory indexing (result cod +e as e ted).' # in t\serving.t at line 182. # got: 500 # expected: 200 t\serving.........NOK 9# Failed test 'Directory indexing (content ma +tched) # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown e ) # ' # doesn't match '(?s-xim:static/test.*foo.html.*foo.txt)' t\serving.........NOK 10# Failed test 'Directory indexing (Mime type +)' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' t\serving.........ok 46/59 t\serving.........NOK 47# Failed test 'Fully qualified Redirect (res +ult co s expected).' # in t\serving.t at line 182. # got: 500 # expected: 200 t\serving.........NOK 48# Failed test 'Fully qualified Redirect (con +tent m ed).' # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown e ) # ' # doesn't match '(?-xism:<html><body>No wildcards here</body></htm +l>)' t\serving.........NOK 49# Failed test 'Fully qualified Redirect (Mim +e type # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' t\serving.........ok 50/59# Failed test 'Relative Redirect (result c +ode as ected).' t\serving.........NOK 51# in t\serving.t at line 182. # got: 500 # expected: 200 t\serving.........NOK 52# Failed test 'Relative Redirect (content ma +tched) # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown e ) # ' # doesn't match '(?-xism:Path info: /flubber</p>)' t\serving.........NOK 53# Failed test 'Relative Redirect (Mime type) +' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' Your vendor has not defined POSIX macro SIGHUP, used at t\serving.t li +ne 191 # Looks like you planned 59 tests but only ran 57. # Looks like you failed 9 tests of 57 run.
    At which point the process (apparently) hangs. When I finally hit Ctrl-C I get the additional output:
    Terminating on signal SIGINT(2) Caught SIGINT. Trying to quit ... C:\_32\comp\HTTP-Server-Brick>
    I have no idea how that matches up against your expectations - I'm merely providing it for your information :-)

    Cheers,
    Rob (the exceedingly-beading-eyesed-one)
      I'm all over 1 & 2 - the tar file you downloaded is auto generated by viewcvs.cgi, I'll be uploading the one generated by Build.PL.

      The hang at the end seems to be because windows doesn't know about SIGHUP - I can look into that.

      Hadn't tested at all on windows (don't have one handy). It looks like HTTP::Daemon is returning the error "500 Can't connect to desktop2:19896". I wonder if you could try one thing for me? At the top of t/serving.t replace 'localhost' with '127.0.0.1' and see if that helps? If the connection is not going through the loopback address then perhaps windows firewalling is coming into play.

        At the top of t/serving.t replace 'localhost' with '127.0.0.1' and see if that helps?

        I wouldn't expect that to make any difference (and I don't think it did). And running both with and without the firewall activated produces the same output (AFAICT):
        C:\_32\comp\HTTP-Server-Brick>perl -Mblib t\serving.t 1..59 ok 1 - use HTTP::Server::Brick; # # # Using port: 85432 and host: 127.0.0.1 for test server. # If these are not suitable settings on your machine, set the environm +ent # variables HSB_TEST_PORT and HSB_TEST_HOST to something suitable. # ok 2 - Created server object. ok 3 - The object isa HTTP::Server::Brick [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard directory at /static +/test [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /exotic_error [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /another_exotic_er +ror [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /static/test/more_ +specific_m ount [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/non_wildcard +_handler [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard handler at /test/wil +dcard_hand ler [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/redirect [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/relative_red +irect [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard handler at /test/dat +a # Starting server [Sun Jun 24 02:41:32 2007] [-3992] Server started on http://desktop2:1 +9896/ ok 4 - Pathological case - mount doesn't exist (LWP request worked) ok 5 - Pathological case - mount doesn't exist (result code as expecte +d). ok 6 - Pathological case - mount doesn't exist (content matched). ok 7 - Directory indexing (LWP request worked) not ok 8 - Directory indexing (result code as expected). # Failed test 'Directory indexing (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 9 - Directory indexing (content matched). # Failed test 'Directory indexing (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?s-xim:static/test.*foo.html.*foo.txt)' ok 10 - Directory indexing (Mime type) ok 11 - Static file not found (LWP request worked) ok 12 - Static file not found (result code as expected). ok 13 - Static file not found (content matched). ok 14 - Plain text static file (LWP request worked) not ok 15 - Plain text static file (result code as expected). # Failed test 'Plain text static file (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 16 - Plain text static file (content matched). # Failed test 'Plain text static file (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?-xism:Hello Everybody)' not ok 17 - Plain text static file (Mime type) # Failed test 'Plain text static file (Mime type)' # in t\serving.t at line 185. # got: 'text/html' # expected: 'text/plain' ok 18 - HTML static file (LWP request worked) not ok 19 - HTML static file (result code as expected). # Failed test 'HTML static file (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 20 - HTML static file (content matched). # Failed test 'HTML static file (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?-xism:<html><body><h1>Hi Dr Nick</h1></body></h +tml>)' ok 21 - HTML static file (Mime type) ok 22 - HTTP Return code via handler return value (LWP request worked) ok 23 - HTTP Return code via handler return value (result code as expe +cted). ok 24 - HTTP Return code via handler return value (content matched). ok 25 - HTTP Return code via HTTP::Response->code() (LWP request worke +d) ok 26 - HTTP Return code via HTTP::Response->code() (result code as ex +pected). ok 27 - HTTP Return code via HTTP::Response->code() (content matched). ok 28 - More specific mount matched first (LWP request worked) ok 29 - More specific mount matched first (result code as expected). ok 30 - More specific mount matched first (content matched). ok 31 - Regular HTML mounted handler (LWP request worked) ok 32 - Regular HTML mounted handler (result code as expected). ok 33 - Regular HTML mounted handler (content matched). ok 34 - Regular HTML mounted handler (Mime type) ok 35 - Handlers default to non-wildcard (LWP request worked) ok 36 - Handlers default to non-wildcard (result code as expected). ok 37 - Handlers default to non-wildcard (content matched). ok 38 - Wildcard mounted handler root (LWP request worked) ok 39 - Wildcard mounted handler root (result code as expected). ok 40 - Wildcard mounted handler root (content matched). ok 41 - Wildcard mounted handler root (Mime type) ok 42 - Wildcard mounted handler with extra path (LWP request worked) ok 43 - Wildcard mounted handler with extra path (result code as expec +ted). ok 44 - Wildcard mounted handler with extra path (content matched). ok 45 - Wildcard mounted handler with extra path (Mime type) ok 46 - Fully qualified Redirect (LWP request worked) not ok 47 - Fully qualified Redirect (result code as expected). # Failed test 'Fully qualified Redirect (result code as expected).' # in t\serving.t at line 182. # got: 500 # expected: 200 not ok 48 - Fully qualified Redirect (content matched). # Failed test 'Fully qualified Redirect (content matched).' # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown error ) # ' # doesn't match '(?-xism:<html><body>No wildcards here</body></htm +l>)' not ok 49 - Fully qualified Redirect (Mime type) # Failed test 'Fully qualified Redirect (Mime type)' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' ok 50 - Relative Redirect (LWP request worked) not ok 51 - Relative Redirect (result code as expected). # Failed test 'Relative Redirect (result code as expected).' # in t\serving.t at line 182. # got: 500 # expected: 200 not ok 52 - Relative Redirect (content matched). # Failed test 'Relative Redirect (content matched).' # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown error ) # ' # doesn't match '(?-xism:Path info: /flubber</p>)' not ok 53 - Relative Redirect (Mime type) # Failed test 'Relative Redirect (Mime type)' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' ok 54 - HTTP::Response custom mime type (LWP request worked) ok 55 - HTTP::Response custom mime type (result code as expected). ok 56 - HTTP::Response custom mime type (content matched). ok 57 - HTTP::Response custom mime type (Mime type) [Sun Jun 24 02:41:35 2007] [432] [die] Your vendor has not defined POS +IX macro S IGHUP, used at t\serving.t line 191 Your vendor has not defined POSIX macro SIGHUP, used at t\serving.t li +ne 191 # Looks like you planned 59 tests but only ran 57. # Looks like you failed 13 tests of 57 run.
        At which point it hangs.

        (Sheesh ... is it really that late ? ... it is :-)

        Btw, if you're not concerned about windows there are ways and means of ensuring that no Win32 cpan-tester will ever report a 'FAIL' for your module.

        Cheers,
        Rob
      2) The '.cvsignore' file should be missing.
      I thought you were being kind of picky at first, but I see that the ".cvsignore" file *is* actually listed in the "MANIFEST". That's probably a mistake.

Re: Hoping for some beady eyes on my first CPAN submission
by doom (Deacon) on Jun 24, 2007 at 04:17 UTC
    I think you need to check your test files (e.g. serving.t) to make sure you've entered their dependencies into Build.PL in the requires list. I don't see any entries for these:
    use LWP; use LWP::UserAgent;

      Good point, thanks. Practically it won't make any difference since libwww-perl will be installed due to other dependancies, but it's better to be correct.