please icon indicating copy to clipboard operation
please copied to clipboard

feat: Make Build Entrypoint configurable

Open VJftw opened this issue 4 months ago • 2 comments

Adds an optional build_entrypoint field to the build_rule builtin to enable us to use binaries directly when building and support other cross-platform shells (e.g. nushell or Powershell).

TODO:

  • [ ] Code docs, including design decisions/narration (e.g. where ExitOnError, etc. came from and what we could do in the future as a breaking change).
  • [ ] PR description.

VJftw avatar Aug 25 '25 20:08 VJftw

Understood that this is still a WIP, but my initial take is: there's already an entry_points argument. Adding another called build_entrypoint needs some explanation of what it does vs. the existing one and why and how they differ. I also think a dict with a bunch of 'magic' keys seems pretty messy. I feel like this wants to do something very specific - it would be useful to have a clearer description of the problem statement ("use binaries directly when building" seems like something that's already supported, and I'm uncertain how this would help to use something like Powershell).

peterebden avatar Aug 26 '25 22:08 peterebden

:wave: I definitely should have started with an issue first! The TLDR is that i'm interested in removing the Bash dependency for build actions which is something Bazel supports via run_binary and it's also mentioned in their genrule doc.

In terms of implementation, I have the same concerns with the magic keys. I think it was the least amount of change/additions to make it somewhat work, and I got a little eager with the potential for using cross-platform shells like nushell which comes with a lot of built-in cross-platform commands.

Maybe a separate run_binary/run_binary_rule/binary_rule built-in would be a lot better/simpler to start with?


Relevant comments/discussions which I think would benefit from this:

  • https://github.com/thought-machine/please/pull/3393#issuecomment-3144469297
  • https://github.com/thought-machine/please/issues/2863#issuecomment-1830876265
  • https://github.com/thought-machine/please/discussions/3368

VJftw avatar Aug 29 '25 22:08 VJftw