Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Ubuntu 18.04 on WSLv1 issues: makedepend deletes Makefile + installman fails + microperl build fails (requires perlio instead of stdio) #424

Open
vadimkantorov opened this issue Oct 7, 2020 · 16 comments
Assignees
Labels

Comments

@vadimkantorov
Copy link

vadimkantorov commented Oct 7, 2020

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.

@rurban rurban self-assigned this Oct 7, 2020
@rurban rurban added the bug label Oct 7, 2020
@rurban
Copy link
Member

rurban commented Oct 7, 2020

WSLv1, hmm. Never tried this one. Need to hear around what happens there.

@vadimkantorov
Copy link
Author

vadimkantorov commented Oct 7, 2020

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

@vadimkantorov
Copy link
Author

vadimkantorov commented Oct 7, 2020

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

@vadimkantorov
Copy link
Author

vadimkantorov commented Oct 7, 2020

A full bash -x log of running Configure
log.zip

@rurban
Copy link
Member

rurban commented Oct 8, 2020

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

@vadimkantorov
Copy link
Author

This helped to get Makefile generated! Thank you! I'll post here how it compiles (given that Makefile.micro does not compile)

@vadimkantorov
Copy link
Author

Btw, is it expected that microperl complains about perlio?

@vadimkantorov
Copy link
Author

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

@vadimkantorov
Copy link
Author

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

@vadimkantorov
Copy link
Author

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`

rurban added a commit that referenced this issue Oct 8, 2020
rurban added a commit that referenced this issue Oct 8, 2020
@rurban
Copy link
Member

rurban commented Oct 8, 2020

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.

@vadimkantorov
Copy link
Author

vadimkantorov commented Oct 8, 2020

I ran perlcc on tlmgr, it generated tlmgr.c, but also an error :) I filed that issue in rurban/perl-compiler#434

I also renamed this issue to reflect the remaining issues

@vadimkantorov vadimkantorov changed the title Configure does not produce a Makefile on my machine Normal build's installman fails + microperl build fails Oct 8, 2020
@vadimkantorov vadimkantorov changed the title Normal build's installman fails + microperl build fails Normal build's installman fails + microperl build fails (requires perlio instead of stdio) Oct 8, 2020
@vadimkantorov
Copy link
Author

@rurban 2506c06 does not help, it still removes the Makefile (just tried it out)

@vadimkantorov
Copy link
Author

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'.

@vadimkantorov
Copy link
Author

When I then manually execute bash Makefile.SH, Makefile is produced.

@rurban
Copy link
Member

rurban commented Oct 13, 2020

so maybe makedepend also removes Makefile. I'll check.

@vadimkantorov vadimkantorov changed the title Normal build's installman fails + microperl build fails (requires perlio instead of stdio) Ubuntu 18.04 on WSLv1 issues: makedepend deletes Makefile + installman fails + microperl build fails (requires perlio instead of stdio) Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants