Ticket #406 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

t/examples/library.t - pcre check flawed

Reported by: coke Owned by: jkeenan
Priority: normal Milestone:
Component: library Version:
Severity: medium Keywords:
Cc: coke, notfound, petdance Language:
Patch status: new Platform:

Description

config/auto/pcre.pm controls whether parrot is configured with pcre or not; however t/examples/library.t simply calls 'pcre-config' instead of asking parrot if it was configured with PCRE.

This causes the test to fail if a version of pcre-config is available but not suitable for usage with the parrot PCRE library.

Test should be updated to respect the parrot config instead of checking again.

Attachments

pcre.library.patch Download (466 bytes) - added by jkeenan 5 years ago.
Check Parrot configuration data before running test of PCRE

Change History

  Changed 5 years ago by coke

Test skipped in r37497.

  Changed 5 years ago by jkeenan

  • cc jkeen@… added

follow-up: ↓ 5   Changed 5 years ago by coke

This also affects the test in t/library/pcre.t - the pcre test in library.t should be moved to that file (assuming it's not a duplicate)

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

Replying to coke:

This also affects the test in t/library/pcre.t - the pcre test in library.t should be moved to that file (assuming it's not a duplicate)

Looking at the test, makes sense to keep them separate. (one is testing the library, one is test the example (that uses the library))

Changed 5 years ago by jkeenan

Check Parrot configuration data before running test of PCRE

  Changed 5 years ago by jkeenan

  • cc jkeenan added; jkeen@… removed
  • component changed from none to library
  • patch set to new

I have attached a patch ... but one that is so simple I can't believe no one thought of it in the past four months:

Index: t/examples/library.t
===================================================================
--- t/examples/library.t        (revision 40067)
+++ t/examples/library.t        (working copy)
@@ -57,7 +57,7 @@
 
 SKIP:
 {
-    skip( 'no pcre-config', 1 ); # Original check for PCRE flawed (TT #406)
+    skip 'no pcre-config', 1 unless $PConfig{HAS_PCRE};
 
     my $pcre_fn  = File::Spec->catfile(qw( examples library pcre.pir ));
     my $test_out = `$PARROT $pcre_fn asdf as`;

For me, the test is skipped on Darwin/PPC, where HAS_PCRE is 0, but is run -- and passes -- on Linux/i386 where HAS_PCRE is 1.

kid51

  Changed 5 years ago by coke

  • owner set to petdance

  Changed 5 years ago by NotFound

I added a test for the library loading and initialization in r40353

  Changed 5 years ago by NotFound

In r40354 I added attempts to ldopen using the names libpcre.so and libpcre.so.3 if the plain libpcre fails. I think the last attempt will fix the problem, not because of the soname of the library but because of a dynamic link with that name exists, and the libpcre.so link is provided by the libpcre devel packages, not the plain libpcre ones, in a lot of systems.

This is a generic problem for runtime linking, pkg-config and friends are intended for compile time linking, not for dlopen'ing. Anyway, providing the major version number of the intended library is not such a bad thing, it can avoid attempts to use abi incompatible versions.

  Changed 4 years ago by jkeenan

  • status changed from new to assigned
  • cc coke, notfound, petdance added; jkeenan removed
  • owner changed from petdance to jkeenan

It appears that no one has complained in 19 months about the patch I applied.

So I am taking the ticket and will close it in 2-3 days unless someone objects.

Thank you very much.

kid51

  Changed 4 years ago by jkeenan

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

No comments or complaints received in the 3-day period. Closing.

Thank you very much.

kid51

Note: See TracTickets for help on using tickets.