PerlPowerTools icon indicating copy to clipboard operation
PerlPowerTools copied to clipboard

Suggestion : distribute PerlPowerTools as single file/exe

Open kal247 opened this issue 4 years ago • 18 comments
trafficstars

  1. Wouldn't a "new" file name make it possible to install and work without confusion relative to OS utils (so it could be in $PATH)? For example, if the script is called 'ppt' :
  • grep => call OS grep
  • ppt grep => call PPT grep
  1. I think a single .exe could find a public on Windows, as a lightweight and portable collection of Unix tools without dependencies. Only alternatives known to me :
  • UnxUtils (old and unmaintained)
  • BusyBox-w32

kal247 avatar Apr 21 '21 22:04 kal247

That's an interesting idea. I'm not against it, but I don't have time to do it myself. Would you like to work on that?

As for the first question, if you already have these utils, you probably aren't going to use Perl Power Tools. I'd also avoid ppt as a name since everyone will think that's PowerPoint. But, that could be something that we provide.

briandfoy avatar Apr 22 '21 02:04 briandfoy

The idea's not really from me, but from ack (they provide such a file).

I'm interested (for other reasons), in experimenting with PAR::Packer "one day", so why not, it could be a training target. But as you've said, time is a limited resource...

kal247 avatar Apr 24 '21 19:04 kal247

Even before we get to the single file thing, everything would need to be converted to modulinos. That way, you could include all the modules in the packer (like ack does) without them stepping all over each other. That's a pretty big task in itself.

briandfoy avatar Apr 27 '21 01:04 briandfoy

I had in mind a more naive solution, with an entry script to 'do' the tools, but maybe there are flaws in this approach? I've done some test with pp and it removes POD, so there would be an issue here also.

kal247 avatar May 01 '21 21:05 kal247

Hello, you're right that modulinos are the right way to do it, but I've done a little proof of concept anyway (uploaded to my repo). The packer runs fine on mac/win. The tools can be called directly like cat (if packed script is renamed/linked) or like perlpowertools cat (result barely tested, but seems to work). Rest with ./perlpowertools -h.

kal247 avatar Jun 07 '21 19:06 kal247

Sounds good. Can you get a bunch a different people to play with it and see how it works out?

briandfoy avatar Jun 08 '21 14:06 briandfoy

Oh, that's not possible I'm afraid...

On Tue, 8 Jun 2021 at 16:48, brian d foy @.***> wrote:

Sounds good. Can you get a bunch a different people to play with it and see how it works out?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/briandfoy/PerlPowerTools/issues/96#issuecomment-856834159, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIXGCGNLRDC4DW7D7EDALLTRYUVPANCNFSM43LG2N2A .

kal247 avatar Jun 12 '21 19:06 kal247

Why is that not possible?

briandfoy avatar Jun 12 '21 20:06 briandfoy

Updated my repo with new packer.pl (bugfixes, functional changes). Please see its header for more details. Took me a long time to figure out some things related to PAR.

kal247 avatar Oct 30 '21 22:10 kal247

Okay, I see this, but I'm a bit busy at the moment. I'll try to look at it soon.

briandfoy avatar Nov 02 '21 08:11 briandfoy

I was able to play with this a bit and you work generally looks good. I have a new branch in this repo that you can use to make other improvements. My only hold up is time to play with this.

So initial thoughts:

  • [] I played with it on Windows and it seems to work as intended. Nice work :)
  • [] I want to check how cross platform this is. I see a perlpowertools.exe, and that's not going to work everywhere. Do we need a single-file app for every platform?
  • [] I wonder how I'd distribute this? Include it in the distro? Packages on GitHub? Packages somewhere else? chocolatey?

briandfoy avatar Jan 21 '22 22:01 briandfoy

  1. Thanks. Additional info about the Windows executable (that I should document before forgetting) :
  • it still lacks POD from the tools (on-going slowly).
  • you can rename it or use hard links to call individual tools directly, but not symbolic links (unlike Linux and macOS).
  • exe produced by PAR::Packer are sometimes detected/deleted by antivirus.
  • the full path of perl and parl.pl running 'pp' leaks into the exe.
  • I wasn't able to build as 32-bits (for maximum portability).
  1. It seems not possible to generate a pure (cross-platform) Perl script (with PAR::Packer), see https://metacpan.org/dist/PAR/view/lib/PAR/Tutorial.pod#Self-Bootstrapping-Tricks. Personally, I wouldn't distribute platform-specific binaries (Windows excepted). Another solution is needed (including POD).

  2. A minimal zip (exe + readme) available as GitHub "releases" and at PerlPowerTools.com would be good. The helper script could be added to the standard distro (avoids namespace conflict).

kal247 avatar Jan 23 '22 20:01 kal247

Hello, I've tested again the build process and result packages (win + mac) : there are many small annoyances/glitches (not unfixable but time consuming, for unknown use cases). Therefore, to move forward, I'd like to make a pull request with :

  • a packer script that builds only a windows executable, including perldoc.pod.
  • a standalone helper script (not generated by packer), with dynamic tools list and version.
  • massive simplification and cleanup.

What do you think?

PS : Sorry but I'll decline testing GitHub Actions (I already struggle enough with Git already).

kal247 avatar Apr 08 '22 19:04 kal247

  • What are the small annoyances and glitches?
  • What's the standalone helper script?

briandfoy avatar Apr 08 '22 20:04 briandfoy

I have answered by email, what's your opinion? I'd like to close this topic in my mind, thanks.

kal247 avatar May 02 '22 18:05 kal247

I don't recall seeing any email. Can you send it again? But, the best place to record the conversation is in the issue thread.

briandfoy avatar May 02 '22 20:05 briandfoy

I've sent it again, please let me know if you don't get it.

kal247 avatar May 03 '22 18:05 kal247

Updated my repository. If anybody reading this wants to contribute (or not), please do it. https://github.com/kal247/PerlPowerTools

kal247 avatar May 08 '22 21:05 kal247