cperl
cperl copied to clipboard
Ubuntu 18.04 on WSLv1 issues: makedepend deletes Makefile + installman fails + microperl build fails (requires perlio instead of stdio)
On my machine this script leads to no makefile found (and indeed, only Makefile.micro exists which errors out as well):
PERL=https://github.com/perl11/cperl/releases/download/cperl-5.30.0/cperl-5.30.0.tar.gz
wget -nc $PERL
tar xfz $(basename $PERL)
PREFIX=$PWD/cperlprefix
mkdir -p $PREFIX
cd cperl-5.30.0
./Configure -sde -Dprefix=$PREFIX
make -j4
My platform is Ubuntu 18.04 on WSLv1. Typically this is sufficient for building all programming language runtimes.
...
Extracting cflags (with variable substitutions)
Not re-extracting config.h
Extracting makedepend (with variable substitutions)
Extracting Makefile (with variable substitutions)
Extracting myconfig (with variable substitutions)
Extracting pod/Makefile (with variable substitutions)
Extracting Policy.sh (with variable substitutions)
Extracting runtests (with variable substitutions)
Configure done.
If you compile cperl on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.
make: *** No targets specified and no makefile found. Stop.
make -f Makefile.micro
cc -c -o ugenerate_uudmap.o -DPERL_CORE -DPERL_MICRO -DPERL_USE_SAFE_PUTENV -DNO_MATHOMS generate_uudmap.c
cc -o ugenerate_uudmap ugenerate_uudmap.o -lm
./ugenerate_uudmap uuudmap.h ubitcount.h umg_data.h
cc -c -o ugv.o -DPERL_CORE -DPERL_MICRO -DPERL_USE_SAFE_PUTENV -DNO_MATHOMS gv.c
In file included from iperlsys.h:51:0,
from perl.h:3844,
from gv.c:36:
perlio.h:32:4: error: #error "stdio is no longer supported as the default base layer -- use perlio."
# error "stdio is no longer supported as the default base layer -- use perlio."
^~~~~
Makefile.micro:89: recipe for target 'ugv.o' failed
make: *** [ugv.o] Error 1
Context: I am looking to use perlcc / RPerl to convert tlmgr from TexLive into C/C++ code, so I thought to install locally a recent, updated Perl distribution - cperl.
WSLv1, hmm. Never tried this one. Need to hear around what happens there.
That's an syscall-emulated linux subsystem on Windows. Not sure if that matters. Most of user-space things work and build from source fine there (all programming languages, etc)
If you can suggest, where to put debug prints in ./Configure, I can do some debug printing
I ran bash -x Makefile.SH and strace -f bash Makefile.sh, output is attached
cperl-5.30.0.zip
++ osname=linux
++ osvers=4.4.0-19041-microsoft
A full bash -x log of running Configure
log.zip
I think the problem is a case-insensitive filesystem under linux.
We write to Makefile, but then rm -f makefile, i.e. $rm -f $firstmakefile in Makefile.SH
Can you try commenting out this line?
(See the very end of bash,txt)
A fix would need to probe for a case-insensitve filesystem, store it in config and don't do this line.
Another temp. fix would be
# for case-insensitive filesystems (ie WSL)
mv Makefile Makefile.new
$rm -f $firstmakefile
mv Makefile.new Makefile
This helped to get Makefile generated! Thank you! I'll post here how it compiles (given that Makefile.micro does not compile)
Btw, is it expected that microperl complains about perlio?
make succeeds. make install works and then prints:
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man3/version.3
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man3/version::Internals.3
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man3/vmsish.3
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man3/warnings.3
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man3/warnings::register.3
/mnt/c/Users/user/wiptlmgr/cperlprefix/man/man1/assemble.1
readline() on closed filehandle $fh at installman line 115.
not sure if it's expected or not
ls cperlprefix/bin does not contain any perl executable:
/mnt/c/Users/user/wiptlmgr/cperlprefix/bin$ ls
assemble corelist cperl5.30.0 disassemble h2ph libnetcfg nytprofhtml perldoc pod2html podchecker ptar splain
buildcc cpan cperlbug enc2xs h2xs nytprofcalls nytprofmerge perlivp pod2man podselect ptardiff xsubpp
c2ph cpanel_json_xs cperldoc encguess instmodsh nytprofcg nytprofpf piconv pod2text prove ptargrep zipdetails
cc_harness cperl cperlivp flamegraph.pl json_pp nytprofcsv perlcc pl2pm pod2usage pstruct shasum
perl executable is produced by make and runs launches successfully, but it is not copied into cperlprefix/bin because of failed make install. If it's a problem while installing man, is there a way to disable man?
Oh, it seems that the executable in bin is named cperl (not like it's named in-tree).
Btw, commenting out installman fixes the problem and then make install succeeds:
install_all install-all: $(INSTALL_DEPENDENCE) installperl all installman
$(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
#$(RUN_PERL) installman --destdir=$(DESTDIR)
-@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
The cperl vs perl exe name is expected. It is designed to co-exist with an existing perl5.
The installman failures could be another WSL thing. Nobody ever tried that before.
I ran perlcc on tlmgr, it generated tlmgr.c, but also an error :) I filed that issue in https://github.com/rurban/perl-compiler/issues/434
I also renamed this issue to reflect the remaining issues
@rurban https://github.com/perl11/cperl/commit/2506c06030b8dfeb548757e92c558a01fcd53c9b does not help, it still removes the Makefile (just tried it out)
Here's output of Configure:
Extracting makedepend (with variable substitutions)
Extracting Makefile (with variable substitutions)
Extracting myconfig (with variable substitutions)
Extracting pod/Makefile (with variable substitutions)
Extracting Policy.sh (with variable substitutions)
Extracting runtests (with variable substitutions)
Run make depend now? [y]
`sh cflags "optimize='-O3 --pipe'" generate_uudmap.o` generate_uudmap.c
cc -o generate_uudmap -fstack-protector-strong -L/usr/local/lib -flto=4 -O3 --pipe generate_uudmap.o -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
./generate_uudmap uudmap.h bitcount.h mg_data.h
sh ./makedepend MAKE="make" cflags
cp: cannot stat 'Makefile': No such file or directory
make[1]: Entering directory '/mnt/c/Users/user/wiptlmgr/cperl-5.30.0'
make[1]: *** No rule to make target 'clist'. Stop.
make[1]: Leaving directory '/mnt/c/Users/user/wiptlmgr/cperl-5.30.0'
Searching for .c files...
Updating makefile...
Now you must run 'make'.
When I then manually execute bash Makefile.SH, Makefile is produced.
so maybe makedepend also removes Makefile. I'll check.