Hi :wave: The very specific quest that brought me ...
# welcome
s
Hi 👋 The very specific quest that brought me here was finding a sensible way to package up a dumb little Python CLI tool, ideally as a self-contained binary. Stumbled across pyoxidizer, and the nice blogpost and reference repo from @wide-midnight-78598, then tried figuring out if there was any simple way to do cross-build/packaging. Figured I’d check the Slack 🙂
👋 5
w
Woot! Also, I'd highly recommend checking out https://github.com/a-scie/jump It's the tool being used to package Pants (https://github.com/pantsbuild/scie-pants) I've got the start of a Pants plugin for that tool as well. It's pretty early days, but I'm already using it for some CLI packaging
👍 1
s
Thanks @wide-midnight-78598 I did find the mention of the scie-jump work, but figured it was a bit early days for it yet 🙂 But count me as interested in how that goes!
b
iirc the scie-pants support is essentially complete, pending more feedback from the public. So testing it and providing feedback would be a great way to help move that closer to release.
s
Oh, that sounds great. I’m more than willing to test 🙂 Let me know if there is a good place to start / reference repo that shows the usage?
b
I don't know whether there's a reference repo. But the suggested starting point for experimentation is /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/pantsbuild/scie-pants/main/get-pants.sh)"
👍 1
h
Well, that is how to get started with "Pants deployed as a scie", not for constructing your own scies
But there is documentation for that in https://github.com/a-scie/jump
👍 1
And https://github.com/pantsbuild/scie-pants is an example of its usage
scies are not cross-platform themselves (would you really want to bundle an interpreter for every platform in a single binary?) but it is very easy to set up building a scie-per-platform
s
Thanks @happy-kitchen-89482
h
And there is something magical about a truly standalone python binary!
💯 1
s
I don’t really want one binary that works on Mac/Win/Linux but a way to build platform specific binaries.
h
Ah, then scie may be exactly what you want 🙂
s
Yep, sounds very much like it.
h
Pants itself does not build scies yet, but they are easy to assemble by hand until we get around to adding that
s
I guess this is where I should start out then? https://github.com/a-scie/jump/tree/main/examples/python
coke 1
w
The docs are very thorough, so they're easily the best starting point. I've also used the example code to build up some of mine (https://github.com/a-scie/jump/tree/main/examples/python)
s
🙂
w
Note that the example JSON files are very detailed, but you only "need" a subset of that information to create a binary
s
Thanks a bunch!
w
But there is other cool stuff, like doing XYZ on first run.
This is very stale, but this "HARDCODED" thing was roughly the minimal example, assuming the CPython (used from IndyGreg's Standalone project) and a pex were sitting in the same folder: https://github.com/sureshjoshi/pants-plugins/blob/scie-jump/pants-plugins/experimental/jump/rules.py
Quite certain the syntax has been modified, as that was mid Nov - and I've been working on a plugin in my Pants forked repo, so haven't touched that code.
s
FWIW, fiddled with scie-jump yesterday, but got a bit stuck testing the example. I’m on an Apple Silicon mac, so I tried to copy the python example and change the fetch bits to use the aarch64 files. For some reason yesterday it failed to package a scie entirely, today it does build something, but seems to fail?
Copy code
❯ /Users/denis/git/work/scie-jump/dist/scie-jump-macos-aarch64
Error: The given path does not contain a lift manifest: /Users/denis/git/work/scie-jump
w
I'm out of the office today - so I won't have a chance to look. CC'ing @enough-analyst-54434
s
NM, I think I’ve managed (via the minimal lift example in your rules.py) to get it packaged.
👍 1
Yes! I got a working scie ❤️
❤️ 1
🎉 1
💥 1
b
Ex`scie`ting!
(We are punners around here, in case
scie-pants
didn't give it away...)
s
😛
e
@sparse-dream-75239 how closely did you stick to that example in the end? It should never work for you since the Pants 2.14.0 PEX does not support Apple Silicon.
s
@enough-analyst-54434 I didn’t get the Pants example to work, so that is correct. I did however set up my own PEX build with Pants, then convert that (not using the scie-pants plugin yet) to a scie using
scie-jump
.
I haven’t committed this back to my PoC repo yet, but will do now, then share the repo 🙂
w
not using the scie-pants plugin yet
That's the Pants runner actually, so instead of having a
./pants
script in your repo - that is the Pants executable
s
@wide-midnight-78598 aha, I may have misunderstood then, I thought at some point there would be a similar setup to the pyoxidizer plugin allowing pants to build a scie? But anyhow, this is my experiment. https://github.com/denisbr/storelist-converter
w
Yes! There will be. But scie-pants is not that. I need to update the config for the scie
package
plugin, and PR it
👍 1
s
Cool 🙂 Looking forward to that!
b
As are we!
w
I was actually just waiting until scie-pants got some usage to make sure there were no big config changes upcoming, so I wouldn’t have to redo much work. I didn’t expect there to be many problems, so, this is on my list now that I’m back from the break
b
iirc @enough-analyst-54434 would like more user feedback on scie-pants as well before proceeding...?