Ticket #2116 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

t/library/nciutils.t fails on a plain parrot

Reported by: dukeleto Owned by: jkeenan
Priority: normal Milestone:
Component: testing Version: 3.4.0
Severity: medium Keywords:
Cc: ligne Language:
Patch status: Platform: all

Description

$ prove -v t/library/nciutils.t 
t/library/nciutils.t .. 
1..13
ok 1 - load_bytecode
No NCI thunk available for signature `ptr (ptr, STRING)'
current instr.: 'parrot;NCI;Utils;nciwrap' pc 558 (runtime/parrot/library/NCI/Utils.pir:421)
called from Sub 'main' pc 87 (t/library/nciutils.t:49)
Dubious, test returned 1 (wstat 256, 0x100)
Failed 12/13 subtests 

Test Summary Report
-------------------
t/library/nciutils.t (Wstat: 256 Tests: 1 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 13 tests but ran 1.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.00 cusr  0.01 csys =  0.03 CPU)
Result: FAIL

This is most likely because my "plain parrot" script disables everything, including extra nci thunks:

$ cat /home/leto/bin/new_parrot_plain 
#!/bin/sh

new_parrot --without-gettext  --without-gmp --without-libffi \
            --without-extra-nci-thunks \
           --without-opengl --without-readline               \
           --without-pcre --without-zlib                     \
           --without-threads --without-icu $@

It is not clear to me how to detect if we have those from our tests.

Attachments

nci-errors.patch Download (2.1 KB) - added by ligne 4 years ago.
fix NCI errors, including those affecting the PCRE tests.

Change History

  Changed 4 years ago by pmichaud

The config hash has a 'has_extra_nci_thunks' entry -- perhaps the tests can use this to respond appropriately when thunks aren't enabled.

Pm

  Changed 4 years ago by jkeenan

  • cc ligne added

In the tt2116_2117_1979 branch, I configured with:

perl Configure.pl --without-gettext --without-gmp \
  --without-libffi --without-extra-nci-thunks \
  --without-opengl --without-readline --without-pcre \
  --without-zlib --without-threads --without-icu $@

then ran make test. I got past t/library/nciutils.t:

$ prove -v t/library/nciutils.t 
t/library/nciutils.t .. 
1..0 # SKIP No NCI thunks
skipped: No NCI thunks
Files=1, Tests=0,  1 wallclock secs 
  ( 0.03 usr +  0.00 sys =  0.03 CPU)
Result: NOTESTS

... but had these two test failures:

$ prove  t/src/checkdepend.t t/library/pcre.t 
t/src/checkdepend.t .. 
  # couldn't find /usr/include/malloc.h, included from src/gc/malloc.c
# couldn't find extra_thunks.str, included from src/nci/extra_thunks.c
t/src/checkdepend.t .. 1/159 
#   Failed test 'src/nci/extra_thunks.c (Makefile: line 1743).'
#   at t/src/checkdepend.t line 309.
#          got: 'src/nci/extra_thunks.str(1)
# '
#     expected: ''
# Looks like you failed 1 test of 159.
t/src/checkdepend.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests 
t/library/pcre.t ..... 1/2 
#   Failed test 'soup to nuts'
#   at t/library/pcre.t line 105.
# Exited with error code: 1
# Received:
# ok 1
# ok 2
# No NCI thunk available for signature `ptr (ptr, STRING)'
# current instr.: 'parrot;PCRE;NCI;compile' pc 23 
  (runtime/parrot/library/libpcre.pir:30)
# called from Sub 'parrot;PCRE;compile' pc 268 
  (runtime/parrot/library/pcre.pir:184)
# called from Sub 'main' pc 60 
  (/home/jimk/gitwork/parrot/t/library/pcre_2.pir:48)
# 
# Expected:
# ok 1
# ok 2
# ok 3
# ok 4
# ok 5
# 
# Looks like you failed 1 test of 2.
t/library/pcre.t ..... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 

Test Summary Report
-------------------
t/src/checkdepend.t (Wstat: 256 Tests: 159 Failed: 1)
  Failed test:  82
  Non-zero exit status: 1
t/library/pcre.t   (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=2, Tests=161,  1 wallclock secs 
  ( 0.02 usr  0.00 sys +  0.65 cusr  0.05 csys =  0.72 CPU)
Result: FAIL

  Changed 4 years ago by ligne

turns out i didn't have the PCRE dev stuff installed, so that script was being skipped entirely.

it should probably be skipped entirely if it was built without PCRE support. but that's already being tracked by #2024.

the test still fail when configured with --without-libffi --without-extra-nci-thunks. since (as far as i can tell) PCRE support is reliant on at least one of (ffi, extra_nci_thunks), i suppose that it should have a check like the one in t/pmc/nci.t here: < http://trac.parrot.org/parrot/attachment/ticket/2116/nci-errors.patch>

alternatively, --without-pcre should be forced if neither of those is available. is there a blessed way of doing that sort of thing?

Changed 4 years ago by ligne

fix NCI errors, including those affecting the PCRE tests.

  Changed 4 years ago by ligne

i've extended the patch to skip t/library/pcre.t if both FFI and EXTRA_NCI_THUNKS are absent.

when built with perl Configure.pl --without-gettext --without-gmp --without-libffi --without-extra-nci-thunks --without-opengl --without-readline --without-pcre --without-zlib --without-threads --without-icu, all tests pass apart from t/src/checkdepend.t (see #2118).

follow-up: ↓ 6   Changed 4 years ago by ligne

i forgot to close the pull request, and dukeleto has already merged the first half. PCRE-related fix has now been submitted as pull request 137  https://github.com/parrot/parrot/pull/137

in reply to: ↑ 5   Changed 4 years ago by jkeenan

Replying to ligne:

i forgot to close the pull request, and dukeleto has already merged the first half. PCRE-related fix has now been submitted as pull request 137  https://github.com/parrot/parrot/pull/137

    unless ($PConfig{HAS_EXTRA_NCI_THUNKS} || $PConfig{HAS_LIBFFI}) {$
        skip( 'Parrot built without libffi or extra NCI thunks',$
            Test::Builder->new()->expected_tests() );$
    }$

Are you sure that that should be a || in the first line rather than a &&?

Thank you very much.

kid51

  Changed 4 years ago by ligne

no, that's right. either of them is sufficient to interface with libpcre.

there are no errors from t/library/pcre.t when Parrot is built with any of the following configurations:

--without-extra-nci-thunks
--without-libffi
--without-libffi --without-extra-nci-thunks

  Changed 4 years ago by jkeenan

  • status changed from new to assigned
  • owner changed from plobsing to jkeenan

See patch submitted in  TT 2118 comment 4 and commit 9f6220f.

Thank you very much.

kid51

follow-up: ↓ 10   Changed 4 years ago by jkeenan

I will close this ticket on or before Sun Jun 12 if there is no further objection.

in reply to: ↑ 9   Changed 4 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

Replying to jkeenan:

I will close this ticket on or before Sun Jun 12 if there is no further objection.

No complaints received; closing as per plan.

Note: See TracTickets for help on using tickets.