Skip to content

Commit

Permalink
Update Buck to latest version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davido authored and dpursehouse committed Sep 20, 2016
1 parent 66077df commit 0b774c4
Show file tree
Hide file tree
Showing 22 changed files with 6 additions and 28 deletions.
1 change: 1 addition & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
target_level = 8

[project]
allow_symlinks = allow
ignore = .git, eclipse-out, bazel-gerrit
parallel_parsing = true

Expand Down
2 changes: 1 addition & 1 deletion .buckversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e64a2e2ada022f81e42be750b774024469551398
fd3105a0b62899f74662f4cdc156de6990bdc24c
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
1 change: 0 additions & 1 deletion gerrit-acceptance-tests/tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def acceptance_tests(
flaky = 0,
deps = [],
labels = [],
source_under_test = [], #unused
vm_args = ['-Xmx256m']):
junit_tests(
name = group,
Expand Down
6 changes: 0 additions & 6 deletions gerrit-acceptance-tests/tests.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand All @@ -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',
Expand Down
1 change: 0 additions & 1 deletion gerrit-common/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ java_test(
'//lib:guava',
'//lib:junit',
],
source_under_test = [':client'],
)

java_test(
Expand Down
1 change: 0 additions & 1 deletion gerrit-extension-api/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ java_test(
'//lib:truth',
'//lib/guice:guice',
],
source_under_test = [':api'],
)

java_doc(
Expand Down
1 change: 0 additions & 1 deletion gerrit-gpg/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ java_test(
'//lib/bouncycastle:bcprov',
'//lib/jgit/org.eclipse.jgit.junit:junit',
],
source_under_test = [':gpg'],
visibility = ['//tools/eclipse:classpath'],
)
1 change: 0 additions & 1 deletion gerrit-gwtexpui/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ java_test(
'//lib/gwt:user',
'//lib/gwt:dev',
],
source_under_test = [':SafeHtml'],
)

gwt_module(
Expand Down
1 change: 0 additions & 1 deletion gerrit-gwtui-common/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
1 change: 0 additions & 1 deletion gerrit-gwtui/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ java_test(
'//lib/gwt:dev',
'//lib/gwt:user',
],
source_under_test = [':ui_module'],
vm_args = ['-Xmx512m'],
visibility = ['//tools/eclipse:classpath'],
)
1 change: 0 additions & 1 deletion gerrit-httpd/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
3 changes: 1 addition & 2 deletions gerrit-patch-jgit/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -61,6 +61,5 @@ java_test(
'//lib/jgit/org.eclipse.jgit:jgit',
'//lib:junit',
],
source_under_test = [':server'],
visibility = ['//tools/eclipse:classpath'],
)
1 change: 0 additions & 1 deletion gerrit-pgm/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,4 @@ java_test(
'//lib/jgit/org.eclipse.jgit:jgit',
'//lib/jgit/org.eclipse.jgit.junit:junit',
],
source_under_test = [':pgm'],
)
1 change: 0 additions & 1 deletion gerrit-reviewdb/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ java_test(
'//lib:gwtorm',
'//lib:truth',
],
source_under_test = [':client'],
visibility = ['//tools/eclipse:classpath'],
)
2 changes: 0 additions & 2 deletions gerrit-server/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ java_test(
'//gerrit-server/src/main/prolog:common',
'//lib/antlr:java_runtime',
],
source_under_test = [':server'],
)

java_test(
Expand All @@ -208,6 +207,5 @@ java_test(
'//lib/guice:guice-assistedinject',
'//lib/prolog:runtime',
],
source_under_test = [':server'],
visibility = ['//tools/eclipse:classpath'],
)
1 change: 0 additions & 1 deletion gerrit-sshd/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ java_test(
'//lib:truth',
'//lib/mina:sshd',
],
source_under_test = [':sshd'],
)
1 change: 0 additions & 1 deletion gerrit-util-http/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
2 changes: 1 addition & 1 deletion plugins/cookbook-plugin
Submodule cookbook-plugin updated from de2d4d to 60449d
2 changes: 1 addition & 1 deletion plugins/replication
Submodule replication updated from a592cc to 9411b6
2 changes: 1 addition & 1 deletion tools/default.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 0b774c4

Please sign in to comment.