Skip to content

Instantly share code, notes, and snippets.

@truatpasteurdotfr
Created May 9, 2017 20:48
Show Gist options
  • Save truatpasteurdotfr/e20019cd06027775284e19779ed79d67 to your computer and use it in GitHub Desktop.
Save truatpasteurdotfr/e20019cd06027775284e19779ed79d67 to your computer and use it in GitHub Desktop.
alpine and failed perl Number-Format-1.75 test
FROM alpine:latest
MAINTAINER Tru Huynh <[email protected]>
RUN apk update && apk upgrade
RUN apk add \
perl \
make
RUN \
cpan install Number::Format
@truatpasteurdotfr
Copy link
Author

[tru@hpe840g1-1 docker-alpine-Number-Format]$ sudo docker build -t numberformat . 2>&1 | tee build.log

Sending build context to Docker daemon  2.56 kB
Step 1 : FROM alpine:latest
 ---> 4a415e366388
Step 2 : MAINTAINER Tru Huynh <[email protected]>
 ---> Using cache
 ---> c815caba950c
Step 3 : RUN apk update && apk upgrade
 ---> Using cache
 ---> 8360c4c09139
Step 4 : RUN apk add 	perl 	make
 ---> Using cache
 ---> b005b6a5f261
Step 5 : RUN cpan install Number::Format
 ---> Running in 8cc7eab3283f
Loading internal null logger. Install Log::Log4perl for logging messages

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] yes
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 09 May 2017 20:29:03 GMT
  HTTP::Date not available
.............
  New CPAN.pm version (v2.16) available.
  [Currently running version is v2.11]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............................................................DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.cpan/Metadata
Running install for module 'Number::Format'
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/W/WR/WRW/Number-Format-1.75.tar.gz
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/W/WR/WRW/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/W/WR/WRW/Number-Format-1.75.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring W/WR/WRW/Number-Format-1.75.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Number::Format
Writing MYMETA.yml and MYMETA.json
  WRW/Number-Format-1.75.tar.gz
  /usr/bin/perl Makefile.PL -- OK
Running make for W/WR/WRW/Number-Format-1.75.tar.gz
cp Format.pm blib/lib/Number/Format.pm
Manifying 1 pod document
  WRW/Number-Format-1.75.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/format_bytes.t ..... ok
t/format_negative.t .. ok
t/format_number.t .... ok
t/format_picture.t ... ok
t/format_price.t ..... ok

#   Failed test 'euros'
#   at t/locale.t line 37.
#          got: '123,456.79 USD'
#     expected: '123.456,79 USD'

#   Failed test 'rubles'
#   at t/locale.t line 56.
#                   'USD 123,456.79'
#     doesn't match '(?^:^123,456.79 RU[RB] $)'
# Looks like you failed 2 tests of 12.
t/locale.t ........... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/12 subtests 
t/object.t ........... ok
t/round.t ............ ok
t/unformat_number.t .. ok

Test Summary Report
-------------------
t/locale.t         (Wstat: 512 Tests: 12 Failed: 2)
  Failed tests:  3, 5
  Non-zero exit status: 2
Files=9, Tests=171,  0 wallclock secs ( 0.05 usr  0.00 sys +  0.28 cusr  0.04 csys =  0.37 CPU)
Result: FAIL
Failed 1/9 test programs. 2/171 subtests failed.
make: *** [Makefile:849: test_dynamic] Error 255
  WRW/Number-Format-1.75.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports WRW/Number-Format-1.75.tar.gz
The command '/bin/sh -c cpan install Number::Format' returned a non-zero code: 1

@truatpasteurdotfr
Copy link
Author

@truatpasteurdotfr
Copy link
Author

updated ^^ to 1.75 build fine too!

# Automatically generated by apkbuild-cpan, template 1
# Contributor: Francesco Colista <[email protected]>
# Maintainer: Francesco Colista <[email protected]>
pkgname=perl-number-format
_pkgreal=Number-Format
pkgver=1.75
pkgrel=1
pkgdesc="Perl extension for formatting numbers"
url="http://search.cpan.org/dist/Number-Format/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends=""
cpanmakedepends="perl-test-simple"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/W/WR/WRW/$_pkgreal-$pkgver.tar.gz"
options="!check"

_builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	cd "$_builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$_builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	cd "$_builddir"
	make test
}

md5sums="2285c537dcf89a5bf556effaf706fd5f  Number-Format-1.75.tar.gz"
sha256sums="82d659cb16461764fd44d11a9ce9e6a4f5e8767dc1069eb03467c6e55de257f3  Number-Format-1.75.tar.gz"
sha512sums="fa712a82b33ba062308e6bf29a4d99e73245f95495206e2c4252d8735d1851136553ec719a00683163aea0d3dddaa6bcc1261ef643439b870605df8ab17a40ef  Number-Format-1.75.tar.gz"

@truatpasteurdotfr
Copy link
Author

because the build does not have:

make && make test

-> the '&& make test' was dropped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment