Comments (7)
Just to confirm that this seems to be based on whether it is installed interactively or non-interactively through docker (as per original poster #7).
$ cat Dockerfile
# DOCKER-VERSION
FROM perl:latest
RUN cpanm Term::ReadKey
Running non-interactively (via docker build) fails
$ sudo docker build .
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM perl:latest
---> a9d757d1a33b
Step 2 : RUN cpanm Term::ReadKey
---> Running in 967dab729b16
--> Working on Term::ReadKey
Fetching http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.33.tar.gz ... OK
Configuring TermReadKey-2.33 ... OK
Building and testing TermReadKey-2.33 ... ! Installing Term::ReadKey failed. See /root/.cpanm/work/1475776368.7/build.log for details. Retry with --force to force install it.
FAIL
The command '/bin/sh -c cpanm Term::ReadKey' returned a non-zero code: 1
Running interactively (starting a shell in docker prior to the fail and running manually) succeeds
$ sudo docker run -it a9d757d1a33b bash
root@0f5eb80b8b35:~# cpanm Term::ReadKey
--> Working on Term::ReadKey
Fetching http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.33.tar.gz ... OK
root@eac1d1e413f0:~# cpanm Term::ReadKey
--> Working on Term::ReadKey
Fetching http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.33.tar.gz ... OK
Configuring TermReadKey-2.33 ... OK
Building and testing TermReadKey-2.33 ... OK
Successfully installed TermReadKey-2.33
1 distribution installed
Changing the cpanm install to the 2.34 version...
RUN cpanm https://github.com/jonathanstowe/TermReadKey/archive/v2.34.tar.gz
...seems to fail in both cases (interactively and non-interactively)
...
Can't locate loadable object for module Term::ReadKey in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.24.0/x86_64-linux /usr/local/lib/perl5/site_perl/5.24.0 /usr/local/lib/perl5/5.24.0/x86_64-linux /usr/local/lib/perl5/5.24.0 .) at /usr/local/lib/perl5/5.24.0/x86_64-linux/DynaLoader.pm line 95.
DynaLoader::croak("Can't locate loadable object for module Term::ReadKey in \@INC"...) called at /usr/local/lib/perl5/5.24.0/x86_64-linux/DynaLoader.pm line 159
DynaLoader::bootstrap("Term::ReadKey") called at ReadKey_pm.PL line 507
Bootstrapping the XS for blockoptions: Makefile:530: recipe for target 'ReadKey.pm' failed
make: *** [ReadKey.pm] Error 255
FAIL
from termreadkey.
I'm not quite sure why it was working on the other versions of perl (or even with 5.24.0 on Travis CI) as the 2.34 generates the ReadKey.pm from the ReadKey_pm.PL which uses the built XS part to find the detected configuration values (which means we can avoid an eval of the subroutine at run time).
The reason it is failing is because it can't find the built ReadKey.so because it isn't looking in the blib.
I've fixed it, just testing (as I can't trust the Travis CI to tell me whether it will fail on any given version.)
from termreadkey.
https://travis-ci.org/jonathanstowe/TermReadKey/builds/165612896
from termreadkey.
2.35 is failing for me the same way. It looks like a parallel build issue, where there's a race between building the XS and trying to use it. If I disable parallel make, it all works.
$ make -j4
"/usr/bin/perl" genchars.pl
Running Mkbootstrap for ReadKey ()
"/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" ReadKey_pm.PL ReadKey.pm
chmod 644 "ReadKey.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- ReadKey.bs blib/arch/auto/Term/ReadKey/ReadKey.bs 644
Can't locate loadable object for module Term::ReadKey in @INC (@INC contains: blib/arch blib/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/perl5/DynaLoader.pm line 95.
DynaLoader::croak("Can't locate loadable object for module Term::ReadKey in \@INC"...) called at /usr/lib64/perl5/DynaLoader.pm line 159
DynaLoader::bootstrap("Term::ReadKey") called at ReadKey_pm.PL line 507
Creating ReadKey.pm
Bootstrapping the XS for blockoptions: make: *** [Makefile:534: ReadKey.pm] Error 255
make: *** Waiting for unfinished jobs....
Writing termio/termios section of cchars.h... Done.
Checking for sgtty...
Sgtty NOT found.
Writing sgtty section of cchars.h... Done.
Disabling parallel make:
$ make
Running Mkbootstrap for ReadKey ()
chmod 644 "ReadKey.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- ReadKey.bs blib/arch/auto/Term/ReadKey/ReadKey.bs 644
"/usr/bin/perl" genchars.pl
Writing termio/termios section of cchars.h... Done.
Checking for sgtty...
Sgtty NOT found.
Writing sgtty section of cchars.h... Done.
"/usr/bin/perl" "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp" -noprototypes -typemap '/usr/share/perl5/ExtUtils/typemap' ReadKey.xs > ReadKey.xsc
mv ReadKey.xsc ReadKey.c
gcc -c -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -DVERSION=\"2.35\" -DXS_VERSION=\"2.35\" -fPIC "-I/usr/lib64/perl5/CORE" ReadKey.c
rm -f blib/arch/auto/Term/ReadKey/ReadKey.so
gcc -shared -Wl,-z,relro -L/usr/local/lib -fstack-protector-strong ReadKey.o -o blib/arch/auto/Term/ReadKey/ReadKey.so \
-lperl \
chmod 755 blib/arch/auto/Term/ReadKey/ReadKey.so
"/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" ReadKey_pm.PL ReadKey.pm
Creating ReadKey.pm
Bootstrapping the XS for blockoptions: 5
Done
cp ReadKey.pm blib/arch/Term/ReadKey.pm
Manifying 1 pod document
There's also an issue with old EU::MM versions, circa 5.12 era:
$ perl Makefile.PL INSTALLDIRS=vendor
WARNING: AUTHOR takes a string/number not a ARRAY reference.
Please inform the author.
Checking if your kit is complete...
Looks good
only nested arrays of non-refs are supported at /usr/share/perl5/ExtUtils/MakeMaker.pm line 684
I worked around this by patching Makefile.PL:
--- Makefile.PL
+++ Makefile.PL
@@ -12,7 +12,7 @@ if ( $mm_version < 3.5 ) {
DISTNAME => 'TermReadKey',
LICENSE => 'perl',
ABSTRACT => 'Change terminal modes, and perform non-blocking reads.',
- AUTHOR => ['Kenneth Albanowski','Jonathan Stowe'],
+ AUTHOR => 'Kenneth Albanowski, Jonathan Stowe',
META_MERGE => {
no_index => {
file => [ qw(Configure.pm) ],
from termreadkey.
@pghmcfc I've created a new issue (#23) for this as it is a different problem (just the same symptom.)
If you feel the part about the AUTHOR is important, please raise a separate issue for that too.
from termreadkey.
The AUTHOR thing is easily patched around where necessary so it's not a big deal for me. It's broken with EU::MM 6.37_01 to 6.57_05 inclusive I believe, so you might consider just bumping the EU::MM version requirement to 6.58.
from termreadkey.
@pghmcfc I've created #24 - I'm minded to go with 6.42 as that is what shipped with 5.10.0
from termreadkey.
Related Issues (19)
- License terms probably more lenient than artistic HOT 6
- MinGW/dmake: removes cchars.h before compiling HOT 12
- thread-safe or not? HOT 2
- Not being indexed HOT 1
- 2.34 onward not parallel build friendly
- Track minimum version of ExtUtils::MakeMaker HOT 6
- "ReadKey" deadlocks with latest StrawberryPerl HOT 6
- ReadKey -1 is blocking (ActiveState/Windows7) HOT 2
- Why does META.yml claim to provide the Term::ReadKey package? HOT 10
- Win32 term width HOT 1
- "make test" stops and fails if it runs as a background process
- Confusing License
- Tests hang at t/02_terminal_functions.t under cygwin HOT 1
- Can't install on Mac. HOT 2
- CPAN Pull Request Challenge HOT 4
- missing check for undefined values on win32
- -> FAIL Installing Term::ReadKey failed. HOT 16
- GetTerminalSize() call looks for too many arguments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termreadkey.