From 0b774c478eca6e8501e8433281715d790b92cb83 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Mon, 19 Sep 2016 09:42:21 +0200 Subject: [PATCH] Update Buck to latest version 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] https://github.com/facebook/buck/issues/341 [2] https://github.com/facebook/buck/issues/855 Change-Id: Idf76cc71c21df43e808179b645f9175767b322a8 --- .buckconfig | 1 + .buckversion | 2 +- .../src/test/java/com/google/gerrit/acceptance/pgm/BUCK | 1 - .../src/test/java/com/google/gerrit/acceptance/pgm/BUILD | 1 - gerrit-acceptance-tests/tests.bzl | 1 - gerrit-acceptance-tests/tests.defs | 6 ------ gerrit-common/BUCK | 1 - gerrit-extension-api/BUCK | 1 - gerrit-gpg/BUCK | 1 - gerrit-gwtexpui/BUCK | 1 - gerrit-gwtui-common/BUCK | 1 - gerrit-gwtui/BUCK | 1 - gerrit-httpd/BUCK | 1 - gerrit-patch-jgit/BUCK | 3 +-- gerrit-pgm/BUCK | 1 - gerrit-reviewdb/BUCK | 1 - gerrit-server/BUCK | 2 -- gerrit-sshd/BUCK | 1 - gerrit-util-http/BUCK | 1 - plugins/cookbook-plugin | 2 +- plugins/replication | 2 +- tools/default.defs | 2 +- 22 files changed, 6 insertions(+), 28 deletions(-) diff --git a/.buckconfig b/.buckconfig index f2ca353a90..cc3353da31 100644 --- a/.buckconfig +++ b/.buckconfig @@ -24,6 +24,7 @@ target_level = 8 [project] + allow_symlinks = allow ignore = .git, eclipse-out, bazel-gerrit parallel_parsing = true diff --git a/.buckversion b/.buckversion index f5fe016979..efb68ecf03 100644 --- a/.buckversion +++ b/.buckversion @@ -1 +1 @@ -e64a2e2ada022f81e42be750b774024469551398 +fd3105a0b62899f74662f4cdc156de6990bdc24c diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK index ff167ac10a..35229919f3 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK @@ -3,6 +3,5 @@ include_defs('//gerrit-acceptance-tests/tests.defs') acceptance_tests( group = 'pgm', srcs = glob(['*IT.java']), - source_under_test = ['//gerrit-pgm:pgm'], labels = ['pgm'], ) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUILD b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUILD index 806acd2538..56cecb8f16 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUILD +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUILD @@ -3,6 +3,5 @@ load('//gerrit-acceptance-tests:tests.bzl', 'acceptance_tests') acceptance_tests( group = 'pgm', srcs = glob(['*IT.java']), - source_under_test = ['//gerrit-pgm:pgm'], labels = ['pgm'], ) diff --git a/gerrit-acceptance-tests/tests.bzl b/gerrit-acceptance-tests/tests.bzl index ff2562de31..62a99e3da2 100644 --- a/gerrit-acceptance-tests/tests.bzl +++ b/gerrit-acceptance-tests/tests.bzl @@ -11,7 +11,6 @@ def acceptance_tests( flaky = 0, deps = [], labels = [], - source_under_test = [], #unused vm_args = ['-Xmx256m']): junit_tests( name = group, diff --git a/gerrit-acceptance-tests/tests.defs b/gerrit-acceptance-tests/tests.defs index 85cc78b4e4..648bd63f49 100644 --- a/gerrit-acceptance-tests/tests.defs +++ b/gerrit-acceptance-tests/tests.defs @@ -8,7 +8,6 @@ def acceptance_tests( srcs, deps = [], labels = [], - source_under_test = [], vm_args = ['-Xmx256m']): from os import path if path.exists('/dev/urandom'): @@ -20,11 +19,6 @@ def acceptance_tests( deps = deps + BOUNCYCASTLE + [ '//gerrit-acceptance-tests:lib' ], - source_under_test = [ - '//gerrit-httpd:httpd', - '//gerrit-sshd:sshd', - '//gerrit-server:server', - ] + source_under_test, labels = labels + [ 'acceptance', 'slow', diff --git a/gerrit-common/BUCK b/gerrit-common/BUCK index 847fd25a7f..452b2fe862 100644 --- a/gerrit-common/BUCK +++ b/gerrit-common/BUCK @@ -62,7 +62,6 @@ java_test( '//lib:guava', '//lib:junit', ], - source_under_test = [':client'], ) java_test( diff --git a/gerrit-extension-api/BUCK b/gerrit-extension-api/BUCK index 2cc8291a33..a0e7495698 100644 --- a/gerrit-extension-api/BUCK +++ b/gerrit-extension-api/BUCK @@ -67,7 +67,6 @@ java_test( '//lib:truth', '//lib/guice:guice', ], - source_under_test = [':api'], ) java_doc( diff --git a/gerrit-gpg/BUCK b/gerrit-gpg/BUCK index 73d9f04a4e..fe93bf8338 100644 --- a/gerrit-gpg/BUCK +++ b/gerrit-gpg/BUCK @@ -52,6 +52,5 @@ java_test( '//lib/bouncycastle:bcprov', '//lib/jgit/org.eclipse.jgit.junit:junit', ], - source_under_test = [':gpg'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-gwtexpui/BUCK b/gerrit-gwtexpui/BUCK index 79a97a91e6..23db13f809 100644 --- a/gerrit-gwtexpui/BUCK +++ b/gerrit-gwtexpui/BUCK @@ -80,7 +80,6 @@ java_test( '//lib/gwt:user', '//lib/gwt:dev', ], - source_under_test = [':SafeHtml'], ) gwt_module( diff --git a/gerrit-gwtui-common/BUCK b/gerrit-gwtui-common/BUCK index a8ea06ffeb..4485430312 100644 --- a/gerrit-gwtui-common/BUCK +++ b/gerrit-gwtui-common/BUCK @@ -66,7 +66,6 @@ java_test( '//lib/gwt:user', '//lib/jgit/org.eclipse.jgit:jgit', ], - source_under_test = [':client'], vm_args = ['-Xmx512m'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK index 3f8738808a..3ab6187934 100644 --- a/gerrit-gwtui/BUCK +++ b/gerrit-gwtui/BUCK @@ -62,7 +62,6 @@ java_test( '//lib/gwt:dev', '//lib/gwt:user', ], - source_under_test = [':ui_module'], vm_args = ['-Xmx512m'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-httpd/BUCK b/gerrit-httpd/BUCK index d52963ae51..0b0499c52a 100644 --- a/gerrit-httpd/BUCK +++ b/gerrit-httpd/BUCK @@ -73,7 +73,6 @@ java_test( '//lib/jgit/org.eclipse.jgit.junit:junit', '//lib/joda:joda-time', ], - source_under_test = [':httpd'], # TODO(sop) Remove after Buck supports Eclipse visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-patch-jgit/BUCK b/gerrit-patch-jgit/BUCK index 09ccf9c1de..4a4929e58f 100644 --- a/gerrit-patch-jgit/BUCK +++ b/gerrit-patch-jgit/BUCK @@ -33,7 +33,7 @@ genrule( 'org/eclipse/jgit/diff/Edit.java;' + 'cd $TMP;' + 'zip -Dq $OUT org/eclipse/jgit/diff/Edit.java', - out = 'edit.src.zip', + out = 'edit-sources.jar', ) java_library( @@ -61,6 +61,5 @@ java_test( '//lib/jgit/org.eclipse.jgit:jgit', '//lib:junit', ], - source_under_test = [':server'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-pgm/BUCK b/gerrit-pgm/BUCK index 4be941cfb8..88521333d6 100644 --- a/gerrit-pgm/BUCK +++ b/gerrit-pgm/BUCK @@ -180,5 +180,4 @@ java_test( '//lib/jgit/org.eclipse.jgit:jgit', '//lib/jgit/org.eclipse.jgit.junit:junit', ], - source_under_test = [':pgm'], ) diff --git a/gerrit-reviewdb/BUCK b/gerrit-reviewdb/BUCK index 82e01351c7..a5fb1f5047 100644 --- a/gerrit-reviewdb/BUCK +++ b/gerrit-reviewdb/BUCK @@ -33,6 +33,5 @@ java_test( '//lib:gwtorm', '//lib:truth', ], - source_under_test = [':client'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-server/BUCK b/gerrit-server/BUCK index 080b52ba25..66fc545082 100644 --- a/gerrit-server/BUCK +++ b/gerrit-server/BUCK @@ -181,7 +181,6 @@ java_test( '//gerrit-server/src/main/prolog:common', '//lib/antlr:java_runtime', ], - source_under_test = [':server'], ) java_test( @@ -208,6 +207,5 @@ java_test( '//lib/guice:guice-assistedinject', '//lib/prolog:runtime', ], - source_under_test = [':server'], visibility = ['//tools/eclipse:classpath'], ) diff --git a/gerrit-sshd/BUCK b/gerrit-sshd/BUCK index 54b83e2631..fcb844fa58 100644 --- a/gerrit-sshd/BUCK +++ b/gerrit-sshd/BUCK @@ -56,5 +56,4 @@ java_test( '//lib:truth', '//lib/mina:sshd', ], - source_under_test = [':sshd'], ) diff --git a/gerrit-util-http/BUCK b/gerrit-util-http/BUCK index cfab0963de..79ef836a11 100644 --- a/gerrit-util-http/BUCK +++ b/gerrit-util-http/BUCK @@ -34,7 +34,6 @@ java_test( '//lib:truth', '//lib/easymock:easymock', ], - source_under_test = [':http'], # TODO(sop) Remove after Buck supports Eclipse visibility = ['//tools/eclipse:classpath'], ) diff --git a/plugins/cookbook-plugin b/plugins/cookbook-plugin index de2d4d7e72..60449ddf39 160000 --- a/plugins/cookbook-plugin +++ b/plugins/cookbook-plugin @@ -1 +1 @@ -Subproject commit de2d4d7e7222e1f8b286ea13b316f77fae9ee878 +Subproject commit 60449ddf39a533ab7184d8b9d72648c9f3505e52 diff --git a/plugins/replication b/plugins/replication index a592cc0cb6..9411b6d9d3 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit a592cc0cb61ef309f21669c037ee6689780a6d89 +Subproject commit 9411b6d9d37fbbd9a6bb98307bcb8f4f47c58f37 diff --git a/tools/default.defs b/tools/default.defs index 191dfe5164..fb4c6de556 100644 --- a/tools/default.defs +++ b/tools/default.defs @@ -201,7 +201,7 @@ def gerrit_plugin( ':%s__gwt_application' % name + ';cd $TMP' + ';zip -qr $OUT .', - out = '%s-static.zip' % name, + out = '%s-static.jar' % name, ) gwt_binary( name = name + '__gwt_application',