bisecting_regressions.rst
bisecting_regressions.rst
bisecting_regressions.rst
_doc_bisecting_regressions:
Bisecting regressions
=====================
.. highlight:: shell
What is bisecting?
------------------
If you have experience with Godot 3.x and can reproduce an issue with Godot 4.0,
we recommend trying to reproduce the issue in the latest Godot 3.x version (if
the feature exhibiting the bug is present in 3.x). This can be used to check
whether the issue is a regression in 4.0 or not.
- If the issue **is present** in 3.x, then you'll need to check whether the issue
occurs in older 3.x versions as well.
- If the issue is **not present** in 3.x, then you can try older 4.0 alphas and
betas to determine when the regression started.
.. warning::
Going from the oldest to the newest build generally reduces the risk of the
project not being able to successfully open in the editor, thanks to
backwards compatibility. Try to reduce your project to the smallest
repeatable example too. The more minimal the project is, the more likely
you'll be able to open it without compatibility issues in newer engine
versions.
.. note::
Note that compiling Godot can take a while on slow hardware (up an hour for
each full rebuild on a slow dual-core CPU). This means the full process can
take up to several hours. If your hardware is too slow, you may want to stop
there and report the results of your "pre-bisecting" on the GitHub issue so
another contributor can continue bisecting from there.
To start bisecting, you must first determine the commit hashes (identifiers) of
the "bad" and "good" build. "bad" refers to the build that exhibits the bug,
whereas "good" refers to the version that doesn't exhibit the bug. If you're
using a pre-release build as the "good" or "bad" build, browse the `download
mirror <https://downloads.tuxfamily.org/godotengine/>`__, go to the folder that
contains the pre-release you downloaded and look for the ``README.txt`` file.
The commit hash is written inside that file.
If you're using a stable release as the "good" or "bad" build, use one of the
following commit hashes depending on the version:
.. code-block:: none
4.1.1-stable
4.1-stable
4.0.3-stable
4.0.2-stable
4.0.1-stable
4.0-stable
3.5.2-stable
3.5.1-stable
3.5-stable
3.4.5-stable
3.4.4-stable
3.4.3-stable
3.4.2-stable
3.4.1-stable
3.4-stable
3.3.4-stable
3.3.3-stable
3.3.2-stable
3.3.1-stable
3.3-stable
3.2-stable
3.1-stable
3.0-stable
You can also use this Bash function to retrieve the Git commit hash of a
pre-release build (add it to your ``$HOME/.bashrc`` or similar):
::
gd_snapshot_commit() {
curl -s https://downloads.tuxfamily.org/godotengine/$1/$2/README.txt \
| grep 'from commit' \
| sed 's/^Built from commit \(.*\)\.$/\1/'
}
Example usage:
.. code-block:: shell
To refer to the latest state of the master branch, you can use ``master``
instead of a commit hash. Note that unlike tagged releases or snapshot commit
hashes, ``master`` is a perpetually moving target.
.. code-block:: shell
.. code-block:: shell
$ scons
Run the binary located in the ``bin/`` folder and try to reproduce the bug.
.. note::
If the build **still** exhibits the bug, run the following command:
.. code-block:: shell
$ git bisect bad
If the build **does not** exhibit the bug, run the following command:
.. code-block:: shell
After entering one of the commands above, Git will switch to a different commit.
You should now build Godot again, try to reproduce the bug, then enter ``git
bisect good`` or ``git bisect bad`` depending on the result. You'll have to
repeat this several times. The longer the commit range, the more steps will be
required. 5 to 10 steps are usually sufficient to find most regressions; Git
will remind you of the number of steps remaining (in the worst case scenario).
Once you've completed enough steps, Git will display the commit hash where the
regression appeared. Write this commit hash as a comment to the GitHub issue
you've bisected. This will help in solving the issue. Thanks again for
contributing to Godot :)
.. note::