For anyone who has interest - I'm working on a sta...
# development
w
For anyone who has interest - I'm working on a standalone plugin for
scie
creation (for Python, currently). ... Mostly because I'm manually creating these in one of my projects, and manual steps fly in the face of my sensibilities. https://github.com/sureshjoshi/pants-plugins/blob/83-scie/pants-plugins/experimental/scie/rules.py
Copy code
pex_binary(
    name="hellotyper-pex",
    entry_point="hellotyper.main",
    dependencies=[":libhellotyper"],
)

scie_binary(
    name="hellotyper-scie",
    dependencies=[":hellotyper-pex"],
)
It's early days, need to pull a bunch of hardcoded stuff into the target's fieldset - and the goal here is not a comprehensive plugin, but rather a practical 80/20 one (e.g. can it create a standalone binary for CLIs and Application Servers is probably my target wheelhouse). Aiming to have
scie
binaries for all of the example python applications by tonight or tomorrow
🚀 7
Forgot to update this 🤦‍♂️ First pass is in: https://github.com/sureshjoshi/pants-plugins/commit/e797d477707e7705d0da39c29578f6e2dc221003 Pretty simple, pretty dope. There are lots of checks and balances/sanities to put in (e.g. does your incoming
pex
support the same platforms you're cross-building too), but pretty cool already.
Copy code
scie_binary(
    name="hellonumpy-scie",
    dependencies=[":hellonumpy-pex"],
    platforms=["linux-x86_64", "macos-aarch64"]
)
Feel free to add tickets for those who are interested - cross-build testing on those examples is my next major step, as well as plugging in a separate
uvicorn
binary to FastAPI
r
w
Oops, yep, good call - re-factored that to a separate directory (but it's coming back down, as I don't use the standalone subsystem
r
So how does
scie_binary
ensures we are building correct platform specific pex? I didn’t really understand it. Are you passing something like
--complete-platform
option?
w
So, the validation of that isn't working. To be clear NONE of this is done by me. John's awesome
scie
-stuff does all of this, and I'm just wrapping it for more Pants friendly usage for one of my client pipelines. I think the end goal is that this is all built into
pex
or similar tooling later on.
Copy code
scie_binary(
    name="hellotyper-scie",
    dependencies=[":hellotyper-pex"],
    platforms=["linux-x86_64", "macos-aarch64"]
)
Right now, there is no verification that the pex has an equivalent platform - which I want to add in, just to sanity
👍 1
This is the relevant change to Jump: https://github.com/a-scie/jump/releases/tag/v0.9.0
r
So currently
scie
will ensure that when you are building pex_binary it would generate the platform specific pex?
w
Not yet, I have to check out the cross-platform builds. Right now, in one of my BUILD files, I ensure I'm using the correct platforms on
pex_binary
- though, I suppose we could enforce that in
scie_binary
rather than verify it? Huh, never really thought about that
💡 1