develooper Front page | perl.perl5.porters | Postings from September 2021

time to purge microperl

Thread Next
From:
Nicholas Clark
Date:
September 14, 2021 12:55
Subject:
time to purge microperl
Message ID:
YUCbqkKu7JbZYitd@etla.org
So microperl doesn't build on blead:

cc -c -o uav.o -DPERL_CORE -DPERL_MICRO -DPERL_USE_SAFE_PUTENV -DNO_MATHOMS  av.c
In file included from iperlsys.h:50,
                 from perl.h:4047,
                 from av.c:20:
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."
    ^~~~~

...

That #error was added in July 2015 by commit 786296d4896f80d4:

    Evict PERLIO_IS_STDIO from top-level core files.

    Configuring with perlio has been the only option since dd35fa16610
    in 2011, first released in 5.16.0.  Yet we have still have had all
    this dead code for stdio support cluttering up the sources and
    dulling the machetes of anyone who wants to do further work on
    perlio or someone (like me) who just stumbles on some code that
    looks like it needs fixing but isn't worth the time since the
    compiler will never see it.

    Leave a vestigial perlsdio.h since its presence is hard-coded in
    a number of places.


OK, so it worked until then?

No. Turns out not. I did a bisect. Is was broken in 2013:
commit e2051532106d99a4928bf7d13194edd2ac1f7b1a (refs/bisect/bad)
Date:   Fri Nov 1 20:12:53 2013 -0400

    Move the function to set $^X to its own file

    This also moves the indirect dependency on stdbool.h to its
    own file, rather than being pulled in for all of perl.c, for
    those cases where one may want to test using other definitions
    of bool.

 MANIFEST    |   1 +
 Makefile.SH |   4 +-
 caretx.c    | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 embed.fnc   |   2 +
 embed.h     |   1 +
 perl.c      |  87 +----------------------------------------
 perl.h      |   7 ----
 proto.h     |   1 +
 8 files changed, 137 insertions(+), 94 deletions(-)


So microperl has been broken in every stable release since v5.20.0

This was actually reported in 2014, but it seems that the ticket stalled:

https://github.com/Perl/perl5/issues/14076


There are 48 references to PERL_MICRO, 43 in C code:

$ git grep PERL_MICRO *.c *.h | wc -l
43


Note that microperl can't actually deliver on the promise of a "configure
free perl" because you already have to pick a config for 32 vs 64 bit
pointers, and I suspect it will break on 64 bit Windows
(IIRC it's LLP64 - is sizeof(long) == 4 but sizeof(void *) == 8)


It's clear that no-one is using this, as it would have been fixed sometime
in the past 7 stable releases, instead of being abandoned.

The current approach is just leaving clutter that is getting in the way.
It should go.


If there are specific features that we should be able to build without,
they should go into their own #defines. We already have some like this -
see unixish.h and its functional closes:

/*
 * The following symbols are defined if your operating system supports
 * functions by that name.  All Unixes I know of support them, thus they
 * are not checked by the configuration script, but are directly defined
 * here.
 */


Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About