summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2024-10-14 16:08:21 +0200
committerJoe Orton <jorton@apache.org>2024-10-14 16:08:21 +0200
commite8518dc75d39e9ffb55334b51315dec688c8d8b5 (patch)
treed799f880406dca44c4fbf29f62d62aaac5439ca8 /test
parentCI: Flush the CPAN cache if /usr/bin/perl has been updated since (diff)
downloadapache2-e8518dc75d39e9ffb55334b51315dec688c8d8b5.tar.xz
apache2-e8518dc75d39e9ffb55334b51315dec688c8d8b5.zip
CI: Second attempt to fix stale XS cache issue.
Cache the "perl -V" output and flush the cache if it changes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921308 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rwxr-xr-xtest/travis_before_linux.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh
index 1c0f301893..e2a42d593d 100755
--- a/test/travis_before_linux.sh
+++ b/test/travis_before_linux.sh
@@ -67,10 +67,18 @@ if ! test -v SKIP_TESTING -o -v NO_TEST_FRAMEWORK; then
# Clear CPAN cache if necessary
if [ -v CLEAR_CACHE ]; then rm -rf ~/perl5; fi
- # Also flush if the system Perl is newer than the cache, otherwise
- # it may refuse to load the (older) XS modules.
- if [ /usr/bin/perl -nt ~/perl5/.key ]; then
- : Purging cache since /usr/bin/perl has been updated
+ if perl -V > perlver; then
+ : Perl binary broken
+ perl -V
+ exit 1
+ fi
+
+ # Compare the current "perl -V" output with the output at the time
+ # the cache was built; flush the cache if it's changed to avoid
+ # failure later when /usr/bin/perl refuses to load a mismatched XS
+ # module.
+ if ! cmp -s perlver ~/perl5/.perlver; then
+ : Purging cache since "perl -V" output has changed
rm -rf ~/perl5
fi
@@ -85,11 +93,11 @@ if ! test -v SKIP_TESTING -o -v NO_TEST_FRAMEWORK; then
# CC=gcc, e.g. for the CC="gcc -m32" case the builds are not correct
# otherwise.
CC=gcc cpanm --notest $pkgs
-
- # Set cache key.
- echo $pkgs > ~/perl5/.key
unset pkgs
+ # Cache the perl -V output for future verification.
+ mv perlver ~/perl5/.perlver
+
# Make a shallow clone of httpd-tests git repo.
git clone -q --depth=1 https://github.com/apache/httpd-tests.git test/perl-framework