-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Buckd does not detect build file changes when symbolic links are involved #341
Comments
cc @wez So I had outdated
Introduce compile error and re-run:
|
Watchman does not follow symlinks. facebook/watchman#105 has some context. We have no plans to magically and generally make symlinks "work" because it seems way too complex to make it work as you might expect. We may be able to work something out that will make it easier for tools to deal with this situation though. In the absence of any helpers, it sounds like buck should resolve symlink(s) and watch-project on the target path(s) and feed those subscriptions into its watcher implementation. We'll need to brainstorm on this. |
We have logic in the parser to not use the in memory cache when symlinks are involved, but it only applies to input files, not to build files themselves. This is something we should fix in Buck. |
Buck has currently one critical bug when Buck daemon is used in combination with symbolic links: [1]. Document the workaround not to use Buck daemon in this scenario. [1] facebook/buck#341 Change-Id: I7cdc19c7245b499e71196d16aab0785dda187fa3
I also hit this issue a couple of times when building Gerrit with plugins. Sometimes I want to just symlink a plugin from Gerrit's plugin folder instead of having to clone it inside the plugins folder. Unfortunately, this bug prevents me from doing that. |
I suppose the suggested workaround at present is to uninstall watchman when working on symblinked dependencies. |
You can set |
Isn't the variable name is |
Yes, |
Was this issue fixed? After upgrading to 6a19cf9 we are getting this warning:
|
It should be fixed in the sense that it will never be cached now, so you should be able to use buckd, but there's no way of disabling that warning if you want to keep that behaviour. There is a setting to whitelist certain paths to be symlinks and be cached, but that's for symlinking into read only file systems. |
Thanks for fixing it.
Given that this is a normal workflow, at least in our use cases of Gerrit Code Review plugins, I would expect existence of some |
Oh sorry, my bad, there actually is. It's |
Unfortunately it doesn't silent the warning. If I'm reading the documentation correctly, the default for
And
and i do not have the mentioned option in
Still the warning is not suppressed during the build:
To reproduce, clone Gerrit Code Review from here: [1] and Work In Progress plugin from here: [2], and link [1] https://gerrit.googlesource.com/gerrit |
The default isn't allow, it's warn. Let me fix the docs. |
Thanks. |
This version fixed a major issue: [1] that was a reason of frustration of many plugin developers: Not cache sources files under symbolic link. Now for all such source files, the warning is issued: " Disabling caching for target //plugins/wip:wip__plugin, because one or more input files are under a symbolic link ({plugins/wip=/home/davido/projects/wip}). This will severely impact performance! To resolve this, use separate rules and declare dependencies instead of using symbolic links. " To suppress this warning we add project.allow_symlink option. This doesn't have any impact for gerrit core but silences the warning above when plugins are built in gerrit tree mode. As pointed out in this issue: [2], we are using some artifacts as source to the java_library() rule as well as binary_jar for prebuilt_ja rule. To avoid the warning, we rename sources to have "-sources.jar" suffix and we rename *.zip to end with .jar in other places. " Assuming edit.src.zip is a JAR and renaming to edit.src.jar in //gerrit-patch-jgit:edit_src. Change the extension of the binary_jar to '.jar' to remove this warning. " source_under_test attribute was removed from java_test() rule. Replication and cookbook-plugin are updated as well. local.properties support was removed, but we use it only for download process customization in our own python script, so that we can keep it usage and not need to move it to .buckconfig.local. [1] facebook/buck#341 [2] facebook/buck#855 Change-Id: Idf76cc71c21df43e808179b645f9175767b322a8
Docs arent' fixed yet guys #1189 Anyway it would be nice to solve this |
Gerrit Code Review project uses Buck and can be extended with plugin concept. There are two plugin Buck build modes supported: in Gerrit tree and standalone (Bucklets driven).
I'm seeing weird stale artifact problem in tree plugin build mode: the plugin is only built once. After that, changing the sources doesn't trigger re-build of the artifact anymore.
buck clean
doesn't help either, onlyrm -rf buck-out
.I have a very small reproducer, but will try to describe the problem:
Main project directory structure is
Plugin:
The content of
bucklets/gerrit_plugin.bucklet
is:The content of
foo/BUCK
is:Now, when the plugin
foo
is linked toplugins
directory with symbolic link, we can only build once and never again:Now when we change the source file:
plugins/foo/src/main/java/org/ostrovsky/buck/Main.java
and say introduce some compile errors, and re-run, nothing happens:buck clean
doesn't help either. The only way to re-trigger the build is to dropbuck-out
directory:This problem only occurs, when
foo
is a symbolic link to some directory parallel togerrit
:All is fine when
foo
is a real directory and not a symbolic link.The text was updated successfully, but these errors were encountered: