It seems like pants will restart the build if we e...
# general
p
It seems like pants will restart the build if we edit anything in our repo (including things we don't depend on); this is fairly problematic for long running builds, e.g. docker images; is there a suggested workaround for this?
w
Its trickier if it is generally watched code, and then you start changing items that would be watched.
p
yeah, it is things that should be watched, but that should not invalidate the current build
the actual build that takes a long time for us is building a docker image that basically has no in-tree dependencies since it's setting up an image that our in-tree deps get layered onto, but building the base image still locks us from doing anything else
w
Ah interesting. I'm not super familiar with this so much, because I don't run into it often - but I wonder if the build needs to restart, because in order to determine if the build is affected, you need to re-do dep inference
Like, chicken and egg or something
Others would know if there is a better solution than this, but is it possible to run your docker builds in a non-daemon command? I would assume that's unaffected
p
is that a pants feature, or do you just mean running the docker commands that pants would run itself?
Definitely thinking of the latter, but it seems like it defeats the point of a build system a little
w
Let me check, I think there is a flag
This is honestly guesswork - I have no idea: https://www.pantsbuild.org/docs/reference-global#pantsd So, I'm wondering if you can run a one-off command with that for just the docker builds (maybe even via an alias)
Or, maybe turn off watching for those calls? https://www.pantsbuild.org/docs/reference-global#watch_filesystem
p
looks like one of those should solve it, will try those, thanks!
w
👍 Let us know how it works. And if one of them works, I'd recommend making it an alias - so it's there for everyone: https://www.pantsbuild.org/docs/reference-cli#alias
p
I think --no-watch-filesystem should do the trick, but I've also filed a bug since I think it's a bit of a kludge: https://github.com/pantsbuild/pants/issues/20071
👍 1