buck icon indicating copy to clipboard operation
buck copied to clipboard

buck-out should be ignored by buck filesystem traversal but didn't

Open zayhero-zz opened this issue 9 years ago • 10 comments

According to Buck documentation, buck-out should be ignored by buck filesystem traversal https://buckbuild.com/concept/buckconfig.html#project.ignore However, seems the logic is changed and files under buck-out is being parsed by Buck.

A sample to repo the issue:

  1. git clone [email protected]:zayhero/BugSample.git
brian_zhang ~/projects/BugSample (master) $ buck targets
//:Ignored.BUCK
  1. buck build //:Ignored.BUCK
brian_zhang ~/projects/BugSample (master) $ buck targets
Buck wasn't able to parse /Users/brian_zhang/projects/BugSample/buck-out/gen/BUCK:
Syntax error on line 1, column 11:
this should show error error
          ^

This shows the BUCK file under buck-out is being parsed which is not align with Buck documentation. This introduce problems to us when we using react-native. We need to git clone or npm install react native code which contains some sample BUCK files which cause buck build fail.

zayhero-zz avatar Oct 11 '17 23:10 zayhero-zz

+1 - we've seen this problem as well, though it was on a pretty old version of buck, so we didn't report it.

jiangty-addepar avatar Oct 12 '17 03:10 jiangty-addepar

I think we don't notice it @ facebook because we use watchman, and our watchman config excludes buck-out. It seems like the logic for excluding buck-out for certain operations should be applied in buck directly.

yiding avatar Oct 13 '17 02:10 yiding

@yiding slightly tangential question: do you also use watchman / incremental builds on CI servers? (We haven't been successful in doing so, though it's probably because we do some sketchy things in our build scripts such that buck's caching mechanism doesn't quite work correctly...)

jiangty-addepar avatar Nov 11 '17 00:11 jiangty-addepar

I think we do use watchman on CI.

yiding avatar Nov 11 '17 01:11 yiding

yes, we enabled watchman on our CI servers a few months ago and all of our builds are using remote caches, so they are trying to be incremental, but we do not preserve any local state between runs, if that's what you meant by incremental.

ttsugriy avatar Nov 13 '17 05:11 ttsugriy

@ttsugriy ah yeah, that's what I meant. Thanks!

jiangty-addepar avatar Nov 13 '17 20:11 jiangty-addepar

Hi,

I would like to fix this issue. I'm new to Buck and this bug seems good enough for the first contribution, what do you think? Do you have some thoughts about where to start from? I guess I need to find a code that traverses filesystem and check if it ignores buck-out and I'll search it by myself, but it will be easier with your advice.

So far I did search for "buck-out" in code and indeed didn't find anything that looks like this directory is ignored somewhere. Though I'm not familiar with the code yet and could easily miss something.

glebmish avatar Feb 06 '18 10:02 glebmish

Should be fixed by https://github.com/facebook/buck/pull/1975 now

kageiit avatar Aug 20 '18 15:08 kageiit

@kageiit can you confirm and close the issue?

flevour avatar Oct 16 '18 08:10 flevour

I cant close this issue. only someone on the buck team can. Maybe @styurin

kageiit avatar Oct 16 '18 14:10 kageiit