Closed Veraellyunjie closed 1 year ago
@Veraellyunjie Thank you, I'm glad you're enjoying it.
--assimilate
shouldn't be required for your example, could you please test with bash
?
Edit, does this happen with other APEs such as hello.com
?: https://justine.lol/hello.com
I just stumbled upon your explanation at https://news.ycombinator.com/item?id=34002858
on unix-like they install the APE loader to
$HOME/.ape
and use that ELF executable to run the APE
My /home
is mounted noexec
so $HOME/.ape
will not run.
it brings me a bit of calmness as some potential malware will just remain inactive, yet have to ln -s ...
some paths for actually needed software manually — me weirdo :)
I have moved .ape
and done ln -s ...
and indeed, now I can just run any of perl.com
perl-small.com
perl-vista.com
perl-small-vista.com
without --assimilate
does this happen with other APEs such as
hello.com
?: https://justine.lol/hello.com
hello.com
works fine even with no $HOME/.ape
run permission:
> chmod +x hello.com
> ./hello.com
hello world
Is hello.com
somewhat different and doesn't rely on $HOME/.ape
?
$HOME
issues can break APPerl could you please consider some FAQ and/or troubleshooting guide mentioning that $HOME
needs to exist, be writable, have free space and allow execution?.ape
path?My
/home
is mountednoexec
so$HOME/.ape
will not run.
That would do it.
I have moved
.ape
and doneln -s ...
and indeed, now I can just run any ofperl.com
perl-small.com
perl-vista.com
perl-small-vista.com
without--assimilate
You could also install the ape loader to /usr/bin/ape
. Download and info on the new ape loader: https://justine.lol/apeloader/ . I can add some ape loader info to the docs.
Is
hello.com
somewhat different and doesn't rely on$HOME/.ape
?
hello.com
was a bad example, it uses the older self-modifying ape loader (doesn't use .ape
)
$ sha256sum hello.com
8b819469b3e6e268d117d26dbd17820c4640a269666a235d62ccf726c91d0992 hello.com
$ chmod +x hello.com && ./hello.com
hello world
$ sha256sum hello.com
c975dcfa125706524d28321eaa5fc23fc723c21f598694c7511b1528cec46160 hello.com
Maybe also implement some additional ENV_VAR and/or --argument for specifying custom
.ape
path?
To avoid bloating APEs, I don't think Justine would be interested in adding those, but you could try proposing changes: https://github.com/jart/cosmopolitan. Adding more arguments (in addition to --assimilate
) is messy as they prevent those arguments from being passed on to the executable.
Added USAGE NOTES section to APPerl webpage with various APE info.
Usually, the APE Loader is installed to $HOME/.ape
Not completely correct: https://justine.lol/apeloader/
${TMPDIR:-${HOME:-.}}/.ape
With a verbose explanation:
If your operating system defines the POSIX-specified $TMPDIR variable, then the ape loader will become $TMPDIR/.ape. Otherwise if $HOME is defined, it's dropped in in $HOME/.ape. Then, if neither is defined, ./.ape is created in the current directory.
From OpenBSD's /etc/skel/.profile
: export PATH HOME TERM
:
TMPDIR
is not exported by default (and I didn't set it manually);
HOME
is exported by default.
/home
by default doesn't have noexec
— that's my custom config.
So, with ${TMPDIR:-${HOME:-.}}/.ape
, on default OpenBSD, the APE Loader will indeed be installed to $HOME/.ape
and will work fine from there.
Generally however, APPerl USAGE NOTES should probably say ${TMPDIR:-${HOME:-.}}/.ape
instead of $HOME/.ape
?
The foremost: APPerl is a wow-awesome project, sharing freaking awesomeness of αcτµαlly pδrταblε εxεcµταblε and Cosmopolitan Libc!
Man, you have introduced an exorbitant amount of excitement into my life!
Please, keep on and the best of luck to you!
Now, having downloaded binaries from https://computoid.com/APPerl/ to an OpenBSD 7.2 amd64 machine, and having
chmod +x ...
:It is said on https://metacpan.org/pod/Perl::Dist::APPerl that
(please also note missing markup of snippet cp perl.com perl ./perl --assimilate)
Indeed, having done
cp perl.com perl
and./perl --assimilate
:Also tried
perl-small-vista.com
after--assimilate
— works as well.Neither https://computoid.com/APPerl/ nor https://github.com/G4Vi/Perl-Dist-APPerl pages mention
--assimilate
in case of OpenBSD, so such a note would be welcome