high-yak-8589903/14/2022, 10:10 PM
In-repo plugin code should not depend on other in-repo code outside of theThis seems really prohibitive to developing new plugins. I have some custom code generation that uses other internal libraries to verify the generated code along the way among other things. I'm curious what's recommended for cases like this.folder. The
pants-pluginsfolder helps isolate plugins from regular code, which is necessary due to how Pants's startup sequence works
hundreds-father-40403/14/2022, 10:14 PM
properly? pantsbuild/pants is basically one big plugin running on itself 😛
witty-crayon-2278603/14/2022, 10:16 PM
will restart when anything on the pythonpath changes (unless, as Eric said, you exclude items).
high-yak-8589903/14/2022, 10:42 PM
? Does that sound right?
hundreds-father-40403/14/2022, 10:44 PM
, or updating
rm -rf .pids
or updatingThere, the only downside is that restarting pantsd means you have to redo some work you already had done. It's not a correctness issue, only suboptimal for perf, but it's not the end of the world
witty-crayon-2278603/14/2022, 10:45 PM
so when you are iterating on your non-plugin-code that is used by your plugin code, you might be confused why changes aren’t happening.that can’t happen: if the code is loadable, it’s because it’s on the pythonpath. and the entire pythonpath is invalidated
. that can cause an edit to not restart the server, but that’s opt in.
on the pythonpath, which contains a lot of stuff unrelated to your plugin,
will restart more than you would like: things will be correct, but slower for your users.
you can reduce that by excluding things from invalidation (that you know are on the pythonpath, but not relevant to your plugin) via
… but that needs to be done carefully/accurately, or
won’t restart for the plugin change.
high-yak-8589903/14/2022, 10:54 PM
in a way that lets us throw the generated code right back into the repo.
witty-crayon-2278603/14/2022, 10:57 PM
in Pants is https://www.pantsbuild.org/v2.11/docs/reference-experimental_shell_command, but it’s fairly new. more docs here: https://www.pantsbuild.org/v2.11/docs/run-shell-commands
doesn’t actually allow for mutating the repo, does it? … except maybe by violating the sandbox?
The command is limited to operating on the specific set of input files provided as dependencies, and only produces output files for other targets to consume. It is not possible to mutate any file in the workspace.
high-yak-8589903/14/2022, 11:01 PM
which I assume gives us an absolute path which does violate the sandbox to put things back in the repo structure.