$TMP, $DEPS, $SRCS, $OUT are no longer supplied by Buck in the
environment unless they appear in the command line. Pass $TMP
where it was assumed to be magically supplied. This allows steps
to continue to use buck-out/gen/ for temporary storage instead of
polluting the system /tmp.
Change-Id: Iea8380e5f93fa16ec77457eb76404832bde93a39
Pressing Ctrl-C during the build results in an ugly Python
TraceBack.
Add handling of KeyboardInterrupt and print a useful message.
This fixes most cases, but there are still a few TraceBacks
coming from inside Buck. These will need to be fixed upstream.
Change-Id: I3f0dc19f3be599460a2a6409642a70a195b50753
Having these in the classpath permits the sources to be modified
in Eclipse just like any other Java source file.
Change-Id: I6256f5db793dd056a61e934720cb40056d50cfd0
genrule() no longer supports running commands run only for the
side-effect with no output file. Actions like download_sources or
eclipse need to be handled using Python scripts executed from the
user's shell, otherwise Buck fails if caching is enabled.
Change-Id: I361fc20675f211e15e4ab7942ef52778d0a615c2
This query suite tester allows queries to be stored in
files to easily be executed in bulk. The output of the
queries are stored for easy analysis.
Change-Id: Ibcfb395ec0fdfb2c46ed2cc02032cc4eb7395a43
Asciidoctor doesn't support the conf file, so we remove it, do the macro
replacing ourselves, and put all the attributes into the command line
parameters.
Change-Id: I21b49e5a2d75ff0f9b52f26fccaae42fcbaa0837
The correct reference to the action name is args.a. action is an old
variable that was replaced by args.a and this reference was missed.
Bug: issue 2086
Change-Id: Ibfbf523db8a8adfbf72f31de3ddc7b0ec96014eb
This change fixes the following problems:
* MAVEN_LOCAL definition must be prefixed with 'file://' for curl to work
* src_sha1 was unnecessary required to define source artifact
* update the documentation that sha1 must not be provided
Change-Id: I1cee6588897c928f01bac5cc9fb252251f4f8027
It does not appear to be necessary to include either $OUT or $DEPS
in the command line when building the project and classpath files
for Eclipse. Omit these as $DEPS is starting to be deprecated by
Buck and will eventually disappear.
Change-Id: I40f9a357dfa8114efaf0212bd1ff4cb51197b67f
Standardize the definition of MAVEN_LOCAL as ~/.m2/repository.
This makes it slightly easier to point to a custom build of a
dependency such as gwtorm or PrologCafe by installing the JAR to
the local Maven repository and updating the maven_jar() rule to
use repository = MAVEN_LOCAL instead of GERRIT.
Change-Id: I2e54d1039608c0195a992dbc12fe74bb513466c6
shutil.copyfile can raise shutil.Error and IOError. Catch these and
exit with error status after logging the error to the console.
Change-Id: I63b8caa371cc7034bbb3f19d0bd3fdd0446af2bf
If extracting files fails, it prints the error message but then
continues.
Make it exit with error status in this case.
Change-Id: I19fafda68a85b46300a1abaf6a86567cf1f712b0
download_file caches original zips in ~/.gerritcodereview/buck-cache.
If this is a different filesystem than $(pwd)/buck-out a symlink
was used to connect the build file with the original archive. This
confuses Buck when creating the $SRCDIR for a genrule().
If a hardlink does not work, copy the file.
Change-Id: If66c59fb6aecc93b5a3e85cdd76ef880538875ff
The build system used mixed names for essentially the same things.
Rename all DEFS files to *.defs matching the handful of other files
that are already using this convention.
Change-Id: I3269bd5db5d8d83f5e192ea910f19431c2a4a1cf
These are already named using the alias in the .buckconfig. Moving
them down to tools allows their program to drop a visbility rule, and
shortens the top level file a bit.
Change-Id: I4193249c02850cb7aca3bf7fab81113c5f7b7d8b
Rewrite the Maven tool to accept a spec of things to process on the
command line and use $(location) in the invoking genrule() to locate
the necessary files from Buck. This gets rid of special cases in the
mvn wrapper tool and allows the definition to be given completely from
Buck as part of the build description.
Maven needs to be single threaded to perform repository updates safely
so only one genrule() target is declared to buck for the deploy or
install action. The rule is given all artifact information in a single
pass, allowing the mvn.py wrapper to execute them.
Change-Id: Idbcf645b69280420987a0e8f52947ba93ac9e6f0
Use GERRIT_VERSION rather than GERRIT_VER. VER is not a commonly used
term to name the version string of a software product; VERSION is.
Make the maven_deploy and maven_install rules a little more typical
by passing in the target name separate from the action.
Change-Id: I13a5d94cf5b078cfcb91c69177cadfc2953db33e
This saves about 70ms when running targets like
//gerrit-gwtui:ui_chrome that reference a JAR in
gerrit-common but do not need the Version file.
Change-Id: Iab7377f3c5e1ce82cc3dc3ddcb3b1e4f9f12a8b7
Buck runs tests in parallel based on the targets declared in BUCK
files. Making each test its own target allows the tests to run in
parallel in separate JVMs. Parallel execution enables slow acceptance
tests to take less wall clock time when multiple cores are available.
Acceptance tests leak an entire server environment for every @Test
method run. Fragmenting the tests into units allows them to be
garbage collected by the operating system when the test JVM dies.
This avoids stressing the Java GC with lots of garbage as more tests
pile into the finite heap space.
With this change and the newer version of buck, a clean build and
execution of all tests takes my laptop only 1m25s to execute when
running on battery.
Change-Id: Ia3f689a9e6ca6c620026cc720ccca924387e1363
Latest version of buck is faster than the prior version used by
Gerrit. No-op updates when loading a debug version of the UI now take
only 1.804s on my laptop (previously 7s) and a draft UI compile is
only 24.659s (previously 39s).
The slow acceptance tests must now be excluded with `--exclude slow`.
Buck changed the meaning of the -e option to be --emulator, which is
unfortunately useful only for Android application developers.
genrule() now needs to use $(exe) to reference the binary to run,
offers $(location) to make it easier to find files in the build tree.
The empty srcs array is no longer required for genrule(). Buck has
determined it is sufficiently powerful with $(location) and deps that
requiring srcs is unnecessary.
Supporting .src.zip files in the srcs array of java_library() means
Gerrit no longer needs to run a separate genrule() to extract files
produced by ANTLR, or call javac inside of the BuckPrologCompiler
support glue.
Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a
* stable-2.7:
Update JGit to patch security hole during clone
Switch to gs-maven-wagon for API deployment
Conflicts:
pom.xml
Change-Id: Id851a01ea2e89c0a19c4fadd6328231f8374c8c8
Per [1] the correct URL is <bucket>.storage.googleapis.com/<object>.
Update existing references to project resources to use this domain
name instead of the old name.
[1] https://developers.google.com/storage/docs/reference-uris
Change-Id: I3788cfb4504b3908d2b5eccbdf52beffc3d18387
If buck build was done on a system without curl installed
a misleading error message would be printed out:
error creating directory /home/user/.gerritcodereview/buck-cache
However, the real error was that invocation of curl failed. Since
it was an OSError it was handled with the wrong except block.
Separate handling of the OSError for the folder creation and curl
invocation.
Change-Id: Ic7e7c2c2704ea4cbccff4689dffe17a436108395
`buck build api_install` copies the artifacts to the local maven repository.
`buck build api_deploy` uploads the artifacts to the remote maven repository.
The type of the repo is induced from the Gerrit version name, i. e.
* 2.8-SNAPSHOT: snapshot repo
* 2.8: release repo
Change-Id: I063834bb39311a4d92f5fdbb183f70b1fb8418b6
BUCK is currently lacking native support for source jar generation.
Generate sources JARs for the API manually, until BUCK supports it.
Change-Id: I64fda0fdd82ca3ca37ac46d74e9550b2d9dddb39
genrule() can only produce one output. This is critical to the way
buck caching works for build results. The solution I learned from
the Buck team is to have the genrule() produce a ZIP file containing
all of the outputs, and use a unique genrule() to extract each
output from the ZIP.
Developers can now opt-into the buck cache by writing a local
config file:
cat >.buckconfig.local <<EOF
[cache]
mode = dir
dir = buck-cache
EOF
This can be very useful when switching commits around with GWT UI
code. If the UI code does not modify between commits there is no
rebuild time. If UI code does modify, rebuild time is reduced to
0 when switching back to a prior version you had previously built.
The cache needs local disk, so its not enabled by default.
Change-Id: If8f79637004fbc13ea37c419e5c9bb582a489ab5
Run any target that depends on download_file, no matter what its
name is. This allows grabbing codemirror without confusing the
__download_bin case with assuming a __download_src target exists.
Change-Id: Iaf7cc3000164aa46376314f8d24dc1f057ab06c3
If the SHA-1 does not match the downloaded file content, delete the
file from the cache. This allows a user to fix whatever connectivity
problem led to the corruption and re-run buck build to download
the correct content.
Change-Id: I2f72fb2b187675ec9d5cda650d8982bc93a00189
The Maven build does not work since the introduction of CodeMirror.
Remove the build until to prevent people from trying to use a broken
build process. If buck is rejected this commit will be reverted, and
we will attempt to fix the Maven build to include CodeMirror. If buck
is accepted, we just saved time by avoiding a messy Maven change.
Change-Id: I147d8d1741d52f59de1d2ddce8e5e82583990c14
This is a generic downloader that can be used for other
dependencies, like ZIP files containing JS.
Change-Id: I643f81fc06d790cebaa0eb677fa232ba0c652053
Using a DataResource allows the GWT compiler to manage inserting the
binary into the application context. This works in all run modes,
making the clippy movie always available, even in GWT hosted debug.
Change-Id: I02869d65d9787265ebe40046e0dbf883fd7ea9e1
The macro rules this file defines have nothing to do with the
third-party dependency libraries, but instead are global definitions
used throughout the Gerrit build process. Most build tools are
hidden under //tools, so move these definitions to that directory.
Change-Id: I5e95d7cef734228ca818428a266afc0ac9fa0385
Instead of caching downloaded files in `./buck-cache` in the
working folder, cache them in `.gerritcodereview/buck-cache` in
the user's home folder.
This offers two advantages:
- Cached files are not lost if the working folder is removed, or
untracked files are removed with `git clean`.
- The same cached files can be shared between multiple working
folders, i.e. if the developer has separate workspaces to work
on different target branches.
Change-Id: I3e132df85c43431c2454421b1de0d9e901679540
Instead of exiting with a python stack trace, catch the error and
print a formatted error message, then exit with error code.
Change-Id: I5935ed46e71cdba4e28c06291a9f009e83f20536
If creating the cache directory fails, it is reported as a failure
to run curl.
Separate the error handling and print an appropriate error message.
At the same time, remove redundant calls to `str()` when printing
error messages.
Change-Id: Id6f2c76b16b3101f800cc194a5cb0c2875c4414a
The local.properties file must currently be placed in the root of the
gerrit project. If the project is removed or untracked files are
removed, the settings are lost.
Add support for keeping the file in the `.gerritcodereview` folder in
the user's home folder.
If the file exists in both the gerrit root and `~/.gerritcodereview`,
the one in the root takes precedence.
Change-Id: I815637cf47e84d29c33afa8aafa562d6915f5326