Is there anyway to shut off the listener for file ...
# general
s
Is there anyway to shut off the listener for file path changes on the v2 engine?
Copy code
13:46:27.63 [INFO] Filesystem changed during run: retrying `@rule(pants.backend.python.goals.run_pex_binary.create_pex_binary_run_request)` in 500ms...
This breaks some functionality in my ci env and i need to shut it off.
h
I believe setting
pantsd = false
should turn that off - is that right, @witty-crayon-22786? You can either have a dedicated
<http://pants.ci|pants.ci>.toml
, or use the env var
PANTS_PANTSD=false
w
no: we still watch without pantsd.
you could adjust the log level…?
s
Yeah i tried pantsd and no_loop
its not the logging… its actually causing my processes to restart and not execute properly
w
hm… that’s surprising! we shouldn’t restart any user code: only the creation of the pex itself
s
yeah it restarts the creation of pex but it hits the timeout because it cannot finish in time. This happens to be running in a test so valuable seconds and minutes count here
w
@salmon-barista-63163: is it the code being run by your binary that is restarting? or some other logic embedded in requirements/setup.py files…?
got it.
s
is there no way to shut off this watch just have it continue to execute the current pex?
can i ignore file changes in a specific dir globally?
w
@salmon-barista-63163: so, this might not be very satisfying, but: are the files that are changing actually owned by any targets, or are they log files / test files / etc ?
yes you can! coke
the
[GLOBAL] pants_ignore
setting, which is prepopulated from the root gitignore uses gitignore patterns: https://www.pantsbuild.org/docs/gitignore
s
perfect. wasnt sure that this would solve my issue or not. I will try this and see what happens
Thanks @witty-crayon-22786
😉 Maybe a future feature would be to allow to shut that file watcher off
w
it should. we push the ignores as early as possible.
yea, possibly. right now an aggregator for tackling some improvements is https://github.com/pantsbuild/pants/issues/10705 … i’ll add that idea as well.
…but, actually. i think that it’s more subtle than that. some of the restarts are false positives… we might know in general that the binary creation doesn’t need to restart: see https://github.com/pantsbuild/pants/issues/10705#issuecomment-722757217
s
👍 Ill take a look thank you.
w
if it truly did need to restart, it would be because the inputs to the binary had actually changed… and in that case, restarting might be the only correct thing to do. but the fact that they’re spurious makes that annoying.
s
yeah i see 0 reason mine should be triggering a restart. This is posing an issue for us with the migration to 2.1+
w
yep, sorry for the trouble.
s
no worries. Ill see if the ignore works without breaking anything else. If not…. I’ll be back.
@witty-crayon-22786 Just an update on this. I was able to get around most of my issues with the “file system detected changes…rebuilding” issue. This would definitely be something we would want to be able to shut off in the future. We have a lot of code that generates other code or files when we execute pants processes. This becomes particularly difficult with this file watcher on all the time. Sometimes the files are in the same path as the build and others not.. completely different directory on the file system.
w
yea, sorry for the trouble. definitely interested in following up on that issue