From 14ea923a470d1bba25180d3a8450533e6ddbfa1b Mon Sep 17 00:00:00 2001 From: Yuxiang Wei Date: Tue, 22 Aug 2023 18:23:00 -0500 Subject: [PATCH] feat: complete all the installation instructions --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b5cb05c..6abb145 100644 --- a/README.md +++ b/README.md @@ -48,21 +48,59 @@ For a more comprehensive guidance on how to use Rectify and how to reproduce the > [!WARNING] > Building Rectify from source is **NOT** recommended since there are many complex dependencies and configurations to handle. It is only for advanced users who want to extend Rectify. -
+> [!IMPORTANT] +> **Environment requirements** +> +> - [Git LFS](https://git-lfs.com) is required. +> - Python 3.10 is required. +> - **All three versions of Java 8, 11, and 18** are required. For convenient management of multiple Java versions, we recommend [coursier](https://get-coursier.io/docs/cli-java). +> - (Optional) It's recommended to have an NVIDIA GPU with >6G memory for running Rectify with CodeT5 and >30G memory for Incoder-6.7B. -Download and build [the modified Eclipse JDT Language Server](https://github.com/UniverseFly/eclipse.jdt.ls) +
Download and build the modified Eclipse JDT Language Server -
+Follow the instructions in UniverseFly/eclipse.jdt.ls to build the modified Eclipse JDT Language Server. Note you will need Java 11: -
+```bash +git clone https://github.com/UniverseFly/eclipse.jdt.ls +cd eclipse.jdt.ls +JAVA_HOME=/path/to/java/11 ./mvnw clean verify -DskipTests=true +``` -Download and install Rectify as a Python package including its dependencies +**Adjust** the following command according to your build to dry run the language server: + +```bash +java \ + -Declipse.application=org.eclipse.jdt.ls.core.id1 \ + -Dosgi.bundles.defaultStartLevel=4 \ + -Declipse.product=org.eclipse.jdt.ls.core.product \ + -Dlog.level=ALL \ + -noverify \ + -Xmx1G \ + --add-modules=ALL-SYSTEM \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/java.lang=ALL-UNNAMED \ + -jar ./plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar \ + -configuration ./config_linux \ + -data /path/to/data +``` +If everything goes well, you can move on to the next step.
-
+
Download and install Rectify as a Python package including its dependencies +
+ +```bash +git clone https://github.com/UniverseFly/Rectify && cd Rectify +# Do an editable install +pip install -e . +# Consider upgrading pip if you encounter any errors, also make sure you are using Python 3.10 +# This command should also install all the dependencies of Rectify +``` + +
Prepare the runtime environment of Rectify -Prepare the runtime environment of Rectify +We need to prepare a `meta_config.json` file for Rectify to work properly. The file should be placed in the root directory of Rectify. Please **modify** the following template according to your environment and save the file in the root directory of Rectify: ```json { @@ -93,9 +131,28 @@ For a more comprehensive guidance on how to use Rectify and how to reproduce the ```
-
+
Install the Defects4j datasets + +Rectify evaluates on the [Defects4j](https://github.com/rjust/defects4j) dataset. Please checkout to its [v2.0.0 release](https://github.com/rjust/defects4j/releases/tag/v2.0.0) and follow its instructions to install the dataset. + +> [!WARNING] +> If you directly download the release instead of doing a checkout you may encounter errors when running Rectify, as Rectify will dump the metadata by collecting the meta information of these projects as Git repos. If they are not Git repos, Rectify may fail. + +After the installation, you should have a `defects4j` command in your `$PATH`. You can check it by running `defects4j info -p Chart`. + +> [!IMPORTANT] +> The `defects4j` command must be in your `$PATH` for Rectify to work properly. + +Now let's `cd` back to the root directory of Rectify, and run the following command to checkout all the bugs: + +```bash +python -m rectify.cli.init +``` + +
+ -Do an example run +
Do an example run ```bash # Generate patches with the full Rectify approach using CodeT5 @@ -113,4 +170,3 @@ You will see a table of evaluation results if everything goes well. đŸ”¥đŸ”¥Congratulations! You have successfully built and used Rectify from source!đŸ”¥đŸ”¥
-