a-shell
a-shell copied to clipboard
I’d kill a man to get Perl in a-Shell
Just kidding. (Not kidding.)
Is there a technical reason Perl isn’t included?
I would really like to have Perl too (mainly because a lot of TeX commands use it). The technical reason is: it's really difficult to cross-compile. Perl uses its own script to guess compilation options, and that script is not designed for cross-compilation. I've been trying regularly, and I keep trying. I'll succeed eventually.
Okay, I've got good news and I've got bad news.
The good news: perl is sort of working right now (there's still a bit to polish before release, but I have passed the big blocking point). So your body count should remain at its current value, and Perl should become available in the near future.
The bad news: it's going to be a static build. For many reasons, but mainly because dynamic modules have to be signed by the App developer, so they have to be built beforehand, and I have to rewrite the dynamic library loading mechanism because the libraries aren't when perl thinks they are so...
Which brings me to a question: which Perl extensions or modules should absolutely be included in the default version?
Does this mean you won’t be able to install any modules from CPAN? Or just compiled libraries from CPAN? I have a few modules I’d like from CPAN but I’m not sure where to suggest drawing the line beyond the standard library. (Am I misunderstanding what this “static build” issue means?)
I think we will be able to install all pure Perl modules from CPAN (that's the goal), but any module that requires compiling will be impossible. That's the same deal as Python, basically.
The difference between "static build" and "standard build" is that all the extensions (even those from the standard library) are included in the Perl binary. That makes a larger binary, but at 11 MB I think it's OK.
Sounds like exactly what I was hoping for (pure Perl modules being installable, compiled ones not). 11 MB does not seem too big nowadays.
This would be amazing to see. For many years I’ve wanted to run exiftool on my iPad to geotag my RAW photos using a gpx file. Adding Perl to a-shell would make this possible.
Thank you for continuing to make a great app even better.
We're making progress: the latest TestFlight build has Perl: https://testflight.apple.com/join/WUdKe3f4
And it can even run Perl scripts, including cpan
. Except it cannot install modules that use a C compiler (obviously) or modules that call the command "make" as part of the install process. Which is basically everything. So it can run cpan
, but cpan
cannot install anything.
I'm working on make
now, so eventually cpan
will be functioning. In the meantime, please test Perl and report issues.
We're making progress: the latest TestFlight build has Perl: https://testflight.apple.com/join/WUdKe3f4
@holzschu @emkayonline @gruber This TestFlight build really helps. Thanks @holzschu .
After a (non-exhaustive) test I have exiftool running in a-shell. I installed it from a tar bundle rather than CPAN, but it seems to be working great. Thanks.
A wee bit of tire-kicking and it definitely works, and for me will be useful right out of the box without CPAN/make.
One thing I noticed though is that perldoc
isn’t installed. Is that a deliberate choice?
Also: is this new jsi
command something you created? I’ve wondered for years why there are no JavaScript command-line interpreters for writing shell scripts.
jsi
is the work of @personalizedrefrigerator, see #149, #207, #211, #212.
I did install perldoc
(the binary), but I missed quite a lot of .pod
files (including perldoc.pod
). That will be fixed in the next TestFlight release.
I now have make
, and as a result cpan Package
runs till the end... but it does not appear to have installed anything anywhere. I plan to fix that before the next TestFlight.
A new TestFlight version is available (same place): https://testflight.apple.com/join/WUdKe3f4
This time, cpan
works (at least it works on all the packages I have tried).
fork
does not work with unmodified Perl scripts (you have to edit them a bit to run through both branches), so testing is disabled by default (CPAN_OPTS=-T
) (because many testing scripts use fork
).
Perl
has been on the TODO list since the beginning of iOS_system
. That'll be one huge checkmark.
This is really nice, with pip
and cpan
theres a wealth of tools available.
However cpan
still blows up with Too many Perl scripts
on many installs. E.g. cpan -Ti App::Music::ChordPro
doesn't work. I guess this is because some build scripts start nested perl processes.
There are two possibilities for cpan
to fail:
- because the package contains dynamic libraries. Without a compiler, we can't do much here.
- because
cpan
runs too many nestedperl
process. Splitting the install job into sub-jobs can help.
I could increase the number of perl binaries present (for now, it's limited to two).
Might be a cat and mouse game but I guess at least three are in order given that cpan often runs Makefile.PL
which in turn might run some perl tool..?
Heh, indeed, most installs fail when the Makefile.PL
checks for a valid perl
.. Which would then be the third instance cpan->Makefile.PL->perl -V
Edit: Manually compiling the artifacts in ~/Documents/.cpan/build/*
like this works, its a bit tedious though 😬
perl Makefile.PL
make install
cpan
doesn’t seem to work for me, even for what I think are pure-Perl modules. E.g. cpan YAML
. (I think the YAML module should be included by default, BTW.)
What happens is, cpan
seems to run well until it gets to the end, when it attempts to run the actual Makefile.pl, and then a-Shell just hangs. It seems to be doing something at that step, because my iPhone got warm, but it never finishes. And killing the process with Control-D leaves a-Shell in a bad state where nothing actually executes at the prompt until you force quit the whole app.
Is cpan
currently working as intended? If so, what’s an example module that actually can be installed?
I've fixed a bug with Perl recently. I'll check if it fixes the issue with CPAN.
The bad news is, it did not fix the issue with CPAN.
The good news is, now I think I have fixed it. CPAN YAML
works, at least. Tests are disabled, as before, but at a deeper level (inside CPAN.pm
, rather than using CPAN_OPTS
) to avoid issues.
App::Music::ChordPro
still fails, but (as far as I can tell) it's because it depends on Alien::Build
, which requires a C compiler.