Treat Pants like a Pants repo #19774
Replies: 3 comments 8 replies
-
Thanks for the proposal: I'm generally interested, as I do think that it will accelerate a common case. But...
This feels like a non-starter. We only want to be doing more in the native code moving forward, and this change would put a massive tax on that development. One way to potentially pull this off (which I've utilized in the past) would be to have a "mode" toggle between "binary engine mode" and "source engine mode", where the latter triggered a source build of the engine as we do today. That would allow for periods on Another way would be to decouple the engine release process from the release process for the rest of Pants, so if you wanted to consume a new Rust change from Python, you'd have to run a step to "release it" somewhere (possibly locally or to a staging destination, rather than necessarily publicly). I've seen this strategy used on the JVM side and it is ... ok. Definitely increases your cycle time. |
Beta Was this translation helpful? Give feedback.
-
And it mostly worked, too!
…On Wed, 6 Sept 2023, 17:22 Huon Wilson, ***@***.***> wrote:
The "probably" is even stronger: @chrisjrn <https://github.com/chrisjrn>
has a prototype of actually doing it via #18688
<#18688>!
—
Reply to this email directly, view it on GitHub
<#19774 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEX5XDQ447XI76LAWC5KXTXZDY77ANCNFSM6AAAAAA4NXLA2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Woohoo, bootstrapping! I think it'll be great to separate "artefact that is being produced by the repo" from "tool that is used to orchestrate the builds" (which both just happen to be called "pants"). It'll be great for working in the Pants repo: so many spurious pantsd restarts at the moment! Relevant previous discussion: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1666375916738029, #18688. Bootstrapping comes with a circular dependency that will need to be considered: how do we build pants for a new platform, e.g. if we got windows working (#11170), naively, we'd need to be able to run the orchestrating-Pants on Windows in order to build the windows artefact-Pants, and that doesn't work for the very first one (there's no orchestrating-Pants that works on Windows) 🤯 There's a few ways we could solve this for getting the first artefact:
I'd suggest 1 be our approach for now, as 2 sounds like it'd be hard to maintain reliably.
I'd suggest a different policy: keep the pants repo as simple as possible and just use a normal In terms of actual policy, "the pants repo uses the latest stable release" seems like a sensible one to me. That'll make the dogfooding better, and encourage us to keep up a regular release cycle, and a nice deprecation/upgrade experience. (Another option would be to do "proper" bootstrapping, like a compiler where there's a binary "stage0" compiler that's used to build stage1 from the compiler sources, and then that stage1 builds stage2 from the same sources, i.e. ensure that the compiler can compile itself, https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stages-of-bootstrapping. I'd suggest that this isn't worth it for Pants.)
Yeah, I think this is a great driver: if something is annoying in the Pants repo, it's likely to be annoying for users too, and things like "set up a developer environment" (e.g. your PBS idea) are good examples of this. (I view PRs like #19586 as good interim steps, but also revealing features pants should have.) |
Beta Was this translation helpful? Give feedback.
-
What
I'd like to propose we treat the Pants repo itself like any other Pants repo.
What this boils down to is that we don't delegate to a
./pants
bootstrap script here in the repo for running Pants itself, but rather use the latest git tag (e.g.release_2.18.0a0
) to determine which off-the-shelf Pants to run. This makes the Pants repo not unlike a compiler, where an older version of the code is used to produce the next version.Additionally, the engine compilation is bypassed and
scie-pants
will copy it's own already-compiled engine into the source tree to be used by the Pants-code-as-user-code Pants (at least until Pants can compile Rust binaries 😉)(As a follow-up I'll likely propose we use a Python Build Standlone Python provider for this repo as well.)
Why
main
or switching branches would be a humongous dev lift.(those two reasons are also abundantly clear when you want to do something extremely simple like
pants run build-support/bin/foo.py
)VERSION
, which would ideally be replaced with avcs_version
target.How
What this means in practice is:
pants_requirements
macro to find references topants
modulesadhoc_
orshell_
tooling). This doesn't mean we avoid compilation altogether, but does mean we gain caching of the compilation such that rewinding/fast-forwarding doesn't cost another compilation. Additionally, CI benefits from a remote cache.scie-pants
into doing this for us, or something else.Beta Was this translation helpful? Give feedback.
All reactions