pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.32k stars 636 forks source link

"Filesystem changed" after running `fmt`, `tailor`, or `update-build-files` #14466

Open thejcannon opened 2 years ago

thejcannon commented 2 years ago

Describe the bug

06:27:50.93 [INFO] Initializing scheduler...
06:27:51.22 [INFO] Scheduler initialized.
06:27:52.78 [INFO] Completed: Format with Autoflake - autoflake made no changes.                                                                                                                
06:27:54.12 [WARN] Completed: Format with Black - black made changes.                                                                                                                           
reformatted src/python/pants/option/option_types.py

All done! ✨ 🍰 ✨
1 file reformatted.

06:27:55.25 [WARN] Completed: Format with docformatter - docformatter made changes.                                                                                                             
06:27:55.37 [INFO] Completed: Format with isort - isort made no changes.                                                                                                                        

✓ autoflake made no changes.
+ black made changes.
+ docformatter made changes.
✓ isort made no changes.
06:27:55.37 [INFO] Filesystem changed during run: retrying `Fmt` in 500ms...

Pants version 4b335cdccfebcbd1f92caaa5fef7d5ca161c7226

OS Linux

Additional info N/A

thejcannon commented 2 years ago

The log confirms the file is in fact "src/python/pants/option/option_types.py"

stuhood commented 2 years ago

10705 addresses having better behavior when something has been hand edited... but avoiding logging when a goal has made an actual meaningful change to disk is challenging. #10542 is also relevant maybe.

asherf commented 2 years ago

this also happens when running the tailor goal on a repo as part of the when onboarding a repo to pants. Filesystem changed during run: retryingTailorGoalin 500ms.

stuhood commented 2 years ago

For the record: the goal won't actually restart (because it will have marked itself as side-effected via), so this is purely a spurious message. But yea, let's keep this open until we can tackle it via either #10705 or #10542.

MatejBabis commented 2 years ago

I can report the same thing happening to me with test as well.

I am new to Pants and I have a monorepo setup which I am currently trying to migrate to work it. So far I have been successful, but one of the "packages" is struggling with the error above. The message itself is not very descriptive, so I am not sure where the issue lies and how to tackle it... Any help/explanation appreciated!

$ ./pants test foo/bar.py                                                                                                                                     
15:50:48.17 [INFO] Initializing scheduler...
15:50:48.34 [INFO] Scheduler initialized.
15:51:02.54 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
15:51:02.55 [INFO] Canceled: Building requirements.pex with 44 requirements: [...]
15:52:02.59 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
15:52:02.65 [INFO] Canceled: Building requirements.pex with 44 requirements: [...]
...
stuhood commented 2 years ago

The message itself is not very descriptive, so I am not sure where the issue lies and how to tackle it... Any help/explanation appreciated!

Sorry about that! The actual file changing will be mentioned in .pants.d/pants.log. Once you determine which file is changing, you'll likely want to ignore it via either .gitignore, or the [GLOBAL].pants_ignore setting.