https://pantsbuild.org/ logo
s

salmon-barista-63163

11/30/2020, 9:50 PM
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

hundreds-father-404

11/30/2020, 9:53 PM
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

witty-crayon-22786

11/30/2020, 9:53 PM
no: we still watch without pantsd.
you could adjust the log level…?
s

salmon-barista-63163

11/30/2020, 9:54 PM
Yeah i tried pantsd and no_loop
its not the logging… its actually causing my processes to restart and not execute properly
w

witty-crayon-22786

11/30/2020, 9:55 PM
hm… that’s surprising! we shouldn’t restart any user code: only the creation of the pex itself
s

salmon-barista-63163

11/30/2020, 9:56 PM
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

witty-crayon-22786

11/30/2020, 9:56 PM
@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

salmon-barista-63163

11/30/2020, 9:57 PM
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

witty-crayon-22786

11/30/2020, 9:58 PM
@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

salmon-barista-63163

11/30/2020, 9:59 PM
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

witty-crayon-22786

11/30/2020, 10:00 PM
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

salmon-barista-63163

11/30/2020, 10:03 PM
👍 Ill take a look thank you.
w

witty-crayon-22786

11/30/2020, 10:03 PM
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

salmon-barista-63163

11/30/2020, 10:04 PM
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

witty-crayon-22786

11/30/2020, 10:06 PM
yep, sorry for the trouble.
s

salmon-barista-63163

11/30/2020, 10:06 PM
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

witty-crayon-22786

12/11/2020, 5:32 PM
yea, sorry for the trouble. definitely interested in following up on that issue
4 Views