blob: b09e353492625f5d4a6f6af9df61cdc0a5745dd8 [file] [log] [blame]
* Copyright (c) Facebook, Inc. and its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
{namespace buck.troubleshooting}
{template .soyweb}
{param title: 'Troubleshooting' /}
{param navid: 'concept_troubleshooting' /}
{param description}
How to debug problems and fix them with Buck.
{param content}
If Buck stops working, then there are several things that you can try to do to
fix it.
<h2>Make sure you are using the Oracle JDK</h2>
Buck has only been tested with the Oracle JDK. If you are using an alternative,
such as OpenJDK, then things are not guaranteed to work.
<h2>Rebuild Buck</h2>
In Buck's short history, its autoupdate logic has had several bugs.
If you think that Buck failed to autoupdate correctly (or failed to rebuild
correctly after an autoupdate, which is likely if you killed Buck in the
middle of an autoupdate), then your best bet is to rebuild it yourself:
cd &lt;directory-where-you-checked-out-Buck>
git checkout master
git pull --rebase
ant clean jar
<h2>Run `buck clean`</h2>
Ideally, this solution will never work. Seriously.
If Buck is working correctly, then it should know which files have been
modified and which files need to be rebuilt.
That said, Buck is not perfect, so it is possible that you have found a defect.
In this case, give <code>buck clean</code> a shot and file a bug if you have
found a reproducible bug.
<h2>Delete all generated files in your project.</h2>
Buck is designed so that all generated files are written to the
{sp}<code>buck-out</code> directory, which makes <code>buck clean</code> trivial
to implement. However, you may use additional tools (such as an IDE) that
generate files in other parts of the tree. Such files may inadvertently get
included via <a href="{ROOT}function/glob.html"><code>glob()</code></a> rules,
which would interfere with Buck.
For example, if you are using Git, then you can run:
<pre>git clean -xfdn</pre>
to get a list of files in your project that are
not under version control. The <code>-n</code> switch is for "dry run,"
which means that Git will not delete any files when you run
{sp}<code>git clean</code>. If you want to use Git to remove the generated
files while preserving some non-versioned files (such
as <code>.buckconfig.local</code>), then use it with the <code>-e</code> switch:
<pre>git clean -xfd -e .buckconfig.local</pre>
Note that <code>-e</code> can be specified multiple times.