Closed thoughtpolice closed 1 year ago
Oh, there is a setting for this; in the root .buckconfig
:
[project]
ignore=.git,.sl,.jj
Took me a minute to find that; should have looked at the Buck 1 site (it's occasionally come in handy still.) Closing this as it can be solved easily.
If you are using the watchman file watcher (not the default in open source) you are encouraged to add it to the watchman ignore, as it will generate less events. In 87ab0b6ffb7ff78e1eebd9cab34b6ca73e9b2f52 I made it so that we implicitly ignore buck-out
. I wonder if .git
etc should be defaults too?
Yeah, seeing that commit was the impetus for investigating the .sl
directory and this whole issue. There are some pretty reasonable and unambiguous things to ignore: .git
, .sl
, .jj
(for jujutsu) are three obvious ones I'm using. Something like node_modules
would also be good.
There's also whether or not something should be ignored recursively by default. node_modules
would probably qualify, but unfortunately Cargo's target
subdirectory is a bit more of an open question since it's so ambiguous.
Can I ask how watchman integration is supposed to work? Do I need to launch it myself on the repo root, first? I actually got the Ubuntu 22.04 binary working yesterday, but hadn't yet dug into the source to figure out the integration.
Found that out too: put the following in .buckconfig
[buck2]
file_watcher=watchman
then start a watchman daemon somewhere above the source dir, and set WATCHMAN_SOCK
to the socket file appropriately. Seems to be working and ignoring cargo files now!
I think having an initialisation command generate a ignore makes a lot of sense, but I worry about defaulting to things like node_modules without explicit user direction, as otherwise you can potentially accidentally ignore someones code, and then it gets real confusing.
The idea for watchman is if the binary exists it should just work, and it did for me on Windows. But from your remarks elsewhere, sounds like you probably know more than I do by now :)
I'm using Sapling with buck. And if I do
The second
buck build
normally gives me something like:because
sl
needs to talk with its daemon and do other things under the.sl/
directory.This even goes further than that: if Sapling is in the middle of something like a rebase, it may make copies of
.bzl
files underneath.sl/
during that time, which then get picked up as part of the default cell for the project. This is really annoying. I've had severalsl rebase
commands fail due to conflicts, and thenbuck build ...
picks up temporary files under.sl/
that are kept as a backup. So if something like aTARGETS
file gets copied,buck build ...
will fail in some spectacular and unpredictable fashion.As a short quick fix, it would be nice if whatever logic exists for
.git
andbuck-out
to be ignored could be extended to a few other directories, like.sl/
and.hg/
In the long run, it might be nice to have something like a
buckignore
file for more "exotic" cases like this.