You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: INSTALL.md
+83-53Lines changed: 83 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,21 @@
1
1
# Setup Instructions
2
2
3
-
You may run the demo manually, or by using Nix or Docker.
4
-
The manual setup enables you to use DiffDetective in any of your own Maven projects.
5
-
The Nix and Docker setups just build the demo for you to run it.
6
-
Windows users should _not_ use the Nix setup except if they have experience with WSL2, XServers, and Nix (see [REQUIREMENTS.md](REQUIREMENTS.md)).
3
+
You may build and run the demo _either_ manually _or_ by using Docker _or_ Nix.
7
4
8
-
In case you encounter problems, you may have a look at the _Troubleshooting_ section at the bottom of this file.
5
+
**The purpose of this demo is to serve as a template project for starting to develop with DiffDetective, as well as to give examples on how to use and integrate DiffDetective in your projects.
6
+
We hence recommend the manual setup because it enables you to use DiffDetective in any of your own Maven projects.**
9
7
10
-
## Manual Setup
8
+
The Nix and Docker setups build the demo to a runnable jar file.
9
+
We also provide scripts for running the Demo using Nix dependencies and inside Docker but we do not recommend the complete Docker setup because the demo launches a graphical user interface which frequently causes problems when inside of Docker (see Troubleshooting section at the bottom of this file).
10
+
We hence recommend (1) to build either manually or with Nix or with Docker and (2) to run the produced jar file manually.
11
+
(Windows users should _not_ use the Nix setup except if they are experts on WSL2, XServers, and Nix (see [REQUIREMENTS.md](REQUIREMENTS.md)).)
11
12
12
-
Check the requirements needed for the manual setup in the [REQUIREMENTS.md](REQUIREMENTS.md) file.
13
+
Once you decided for a setup (Manual/Docker/Nix), check the requirements needed for the respective setup in the [REQUIREMENTS.md](REQUIREMENTS.md) file.
14
+
15
+
>In case you encounter problems during the setup, you may have a look at the _Troubleshooting_ section at the bottom of this file.
16
+
17
+
18
+
## Manual Build
13
19
14
20
Follow the setup instructions on the [DiffDetective website](https://variantsync.github.io/DiffDetective/) for building and installing DiffDetective with Maven (and _not_ with Nix).
15
21
These instructions make you clone the repo and install it.
@@ -30,19 +36,26 @@ To run the demo, invoke `java` on the jar file that includes any dependencies:
The expected output and behavior of the jar file is explained below in the section _Expected Output_.
39
+
Make sure that you are at the top level of this repository in the terminal (i.e, the directory containing this INSTALL.md file).
33
40
34
-
## Docker Setup
41
+
## Automatic Build
35
42
36
-
Check the requirements needed for the Docker setup in the [REQUIREMENTS.md](REQUIREMENTS.md) file.
43
+
We provide two methods for automatically building this demo:
44
+
- a [Docker](https://www.docker.com/get-started) build, and
45
+
- a [Nix](https://nixos.org/download/) build.
46
+
47
+
### Starting the docker deamon
37
48
38
-
### Start the docker deamon
49
+
If you want to use Docker to build the jar for you, Docker needs to be installed and running.
50
+
Check the requirements needed for the Docker setup in the [REQUIREMENTS.md](REQUIREMENTS.md) file.
51
+
You may also need to start the Docker daemon before any Docker commands can be run.
39
52
40
53
-**On Linux**: Typically, the docker deamon runs automatically, so there is nothing to do. Otherwise, run `sudo systemctl start docker`.
41
54
-**On Windows**: Open the search bar using the 'Windows Key' and search for 'Docker' or 'Docker Desktop'.
42
55
43
56
More detailed instructions on starting the deamon are given [here](https://docs.docker.com/config/daemon/start/) on the docker website.
44
57
45
-
### Docker Setup on Windows
58
+
### Docker Build on Windows
46
59
47
60
Open a terminal (preferably Windows PowerShell) and navigate to the repository's directory (the directory containing this `INSTALL.md`).
48
61
Then, create the docker image
@@ -54,73 +67,80 @@ You can verify that the image was created successfully by running
54
67
docker images
55
68
```
56
69
and checking that an image called `diffdetective-demo` is listed.
57
-
You can run the image and thus the demo with the following command:
70
+
71
+
To extract the built jar you can run
58
72
```shell
59
-
docker run --net=host -e DISPLAY=host.docker.internal:0 --volume="$PWD/data/output:/home/user/data/output:rw" -t diffdetective-demo
73
+
docker run --volume "${pwd}:/output:rw" diffdetective-demo:1.0.0 /bin/cp /DiffDetective/share/java/DiffDetective-Demo.jar /output
60
74
```
61
-
You may get some font errors, which you can ignore (see Troubleshooting below).
62
-
The parameters `--net=host` and `-e DISPLAY=host.docker.internal:0` are required to launch graphical user interfaces from within Docker.
63
-
64
-
### Docker Setup on Linux
65
-
66
-
> You might require elevated privileges to execute Docker commands (e.g., `sudo ./docker.sh build` or adding the user to the `docker` or `wheel` group).
67
-
> See Docker's [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) for more information.
75
+
and execute it using
76
+
````shell
77
+
java -jar DiffDetective-Demo.jar
78
+
````
79
+
80
+
> **Experimental:**
81
+
> Alternatively, You can run the image and thus the demo with the following command:
82
+
> ```shell
83
+
> docker run --net=host -e DISPLAY=host.docker.internal:0 --volume="$PWD/data/output:/home/user/data/output:rw" -t diffdetective-demo
84
+
>```
85
+
> You may get some font errors, which you can ignore (see Troubleshooting below).
86
+
> The parameters `--net=host` and `-e DISPLAY=host.docker.internal:0` are required to launch graphical user interfaces from within Docker.
87
+
88
+
### Nix or Docker Build on Linux
89
+
90
+
You can use the `build-jar.sh` script to build the Demo jar using [Nix](https://nixos.org/download/) or [Docker](https://www.docker.com/get-started).
91
+
The `build-jar.sh` script will automatically choose the build method depending on the available software (Nix or Docker, in that order).
92
+
You might require elevated privileges to execute Docker commands (e.g., `sudo ./build-jar.sh` or adding the user to the `docker` or `wheel` group).
93
+
See Docker's [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) for more information.
94
+
Also, it is best to install required software (e.g., Nix, Docker) using your distro's package manager if it is available.
68
95
69
-
> It is best to install required software (e.g., Docker, Maven) using your distro's package manager if it is available.
70
-
71
-
You can use the `docker.sh` script to build and execute the Demo using [Docker](https://www.docker.com/get-started) as described below.
72
-
73
-
#### Setup
74
96
Clone and navigate to this repository (the directory containing this `INSTALL.md`).
75
-
Then, simply build the image using the provided script:
97
+
Then, simply build the jar using the provided script:
76
98
```shell
77
-
./docker.sh build
99
+
./build-jar.sh
78
100
```
79
101
80
-
This will automatically build the Docker container using Nix if Nix is installed on your system.
102
+
The jar can then be executed with
103
+
````shell
104
+
java -jar DiffDetective-Demo.jar
105
+
````
81
106
82
-
#### Execution
83
-
Once the image has been build, you can start the demo with
84
-
```shell
85
-
./docker.sh demo
86
-
```
107
+
### Complete Docker Setup on Linux
87
108
88
-
## Nix Setup
109
+
>**Experimental:**
110
+
> You can build and start a demo Docker container with
111
+
>```shell
112
+
> ./docker.sh build
113
+
> ./docker.sh demo
114
+
>```
89
115
90
-
Nix can be used to reproducibly build both, a standalone derivation and a docker container.
91
-
Nix aids in reproducible builds whereas Docker aids in reproducible execution.
116
+
### Nix Build
92
117
118
+
Nix can be used to reproducibly build this DiffDetective demo.
93
119
To use Nix, you need to have [Nix](https://nixos.org/download/) installed on your system.
94
-
See [REQUIREMENTS.md](REQUIREMENTS.md) for instructions on how to install Nix and optionally also Docker.
95
-
96
-
### Standalone Build
120
+
See [REQUIREMENTS.md](REQUIREMENTS.md) for instructions on how to install Nix.
97
121
98
122
> Notice for Windows users:
99
123
> You must run the following commands from within a WSL2 terminal.
100
124
> Also, make sure to clone this repository to a directory within WSL and _not_ to a Windows directory.
101
125
> Otherwise, the Nix setup might fail due to incompatibilities with the file system.
102
-
> Moreover, if you would like to have access to the demo's GUI, you need an XServer installed (see [REQUIREMENTS.md](REQUIREMENTS.md)).
103
126
104
-
Clone and navigate to this repository.
105
-
Then simply build and run the Demo using
127
+
> Notice for Nix flake users:
128
+
> If you have flakes enabled, you can just use `nix run github:VariantSync/DiffDetective-Demo` to run the demo instead of the following instructions.
129
+
130
+
Clone and navigate to this repository in a terminal.
131
+
Then simply build the Demo with
106
132
```shell
107
133
nix-build
108
-
./result/bin/DiffDetective-Demo
109
134
```
110
135
111
-
If you have flakes enabled, you can instead just use
136
+
Afterwards, the produced jar file is located at `result/share/java/DiffDetective-Demo.jar`.
137
+
You can run it manually with Java (requires Java 17 or higher):
If you have Nix installed, the `docker.sh` script will automatically build this demo using Nix.
119
-
Hence, the instructions are the same as for docker:
120
-
Clone and navigate to this repository and execute the following:
141
+
or alternatively with the provided wrapper script:
121
142
```shell
122
-
./docker.sh build
123
-
./docker.sh demo
143
+
./result/bin/DiffDetective-Demo
124
144
```
125
145
126
146
@@ -205,3 +225,13 @@ To fix, start the docker daemon as it was probably not running.
205
225
### Gtk-Message: 00:08:30.171: Failed to load module "colorreload-gtk-module"
206
226
207
227
This error can be savely ignore. The `colorreload-gtk-module` is used fortheming and, hence, is not usefulin this scenario.
228
+
229
+
### error: experimental Nix feature 'nix-command' is disabled; add '--extra-experimental-features nix-command' to enable it
230
+
231
+
You ran Nix flakes without having enabled it. Either enable it by adding the extra parameters to the call as indicated in the error message, or stick to the non-experimental nix commands as described above (recommended).
232
+
233
+
### Exception in thread "main" java.nio.file.NoSuchFileException: data/examples/simple_v1.txt
234
+
235
+
The demo could not find one of this input files.
236
+
This likely happened because you ran the demo from a working directory that is not the top level of this repository in the terminal (i.e, the directory containing this INSTALL.md file).
237
+
To fix, navigate to the root directory of this repository in your terminal and run the demo again.
A small demonstration of [DiffDetective](https://github.com/VariantSync/DiffDetective).
3
+
This is a small demonstration of [DiffDetective](https://github.com/VariantSync/DiffDetective).
4
4
The purpose of this demo is to provide an example of how to use DiffDetective and to serve as a template project for you to clone and adapt as a quickstart for developing with DiffDetective.
5
5
6
6
There is a screencast available on YouTube, guiding you through the demo's setup with Maven in IntelliJ and how to implement variability-aware differencing and analyses of Git histories:
@@ -10,16 +10,14 @@ There is a screencast available on YouTube, guiding you through the demo's setup
10
10
This demo, also manifests the artifact submission for our paper _Variability-Aware Differencing with DiffDetective_, accepted at the FSE'24 demonstrations track.
11
11
A preprint of the paper is available as part of this repository, [here](Variability-Aware%20Differencing%20with%20DiffDetective.pdf).
12
12
Our application for artifact badges can be found in the [STATUS.md](STATUS.md) file.
13
+
Please note that this submission is _not_ a replication package of an empirical study (e.g., tool evaluation).
14
+
Instead, this repository is a template project with examples for how to use DiffDetective as a library (i.e., a demo).
13
15
14
16
## Setup
15
17
16
18
The demo is a Java Maven project, which includes DiffDetective as a library.
17
-
You may run the demo manually, or by using Nix or Docker.
18
-
The manual setup enables you to use DiffDetective in any of your own Maven projects.
19
-
The Nix and Docker setups just build the demo for you to run it.
20
19
21
20
Software requirements are documented in the [REQUIREMENTS.md](REQUIREMENTS.md) file (there are no specific hardware requirements).
22
21
Basically, you will have to install Java and Maven, or alternatively Nix or Docker.
23
22
24
23
Installation instructions are documented in the [INSTALL.md](INSTALL.md) file.
Copy file name to clipboardExpand all lines: REQUIREMENTS.md
+29-17Lines changed: 29 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,41 +4,40 @@ None
4
4
5
5
## Software Requirements
6
6
7
-
> This demo can be run with Docker or Nix. If you intend to use one of them, you may skip to the last section in this document.
8
-
9
7
We do not require a certain operating system or prepared environment.
10
8
For downloading this demo, we recommend Git (installing Git is explained in [this article](https://github.com/git-guides/install-git)).
11
-
The setup is tested on Windows 10, WSL2, Manjaro, Ubuntu, NixOS and MacOS Monterey.
9
+
The setup is tested on Windows 10, WSL2, Manjaro, and NixOS.
10
+
11
+
**Executing the demo consists of two steps**: _building the project_ and _running the demo_.
12
+
Each step has its own software requirements.
13
+
14
+
15
+
### Requirements for Building
16
+
17
+
This demo can be built _either_ manually _or_ using Docker _or_ using Nix.
18
+
You may choose one of these setups.
19
+
If you intend to use this project to develop your own library or application based on DiffDetective, we recommend the manual build.
20
+
21
+
#### Requirements for Building Manually
12
22
13
-
### Toolchain
14
23
This demo is a Maven project based on Java 17.
15
24
16
25
To build the demo, a [Java development toolkit](https://www.oracle.com/java/technologies/downloads/) of version 17 or higher, and [Maven](https://maven.apache.org/) are required.
17
26
18
-
To run the demo, graphviz should be installed. You may find installation instructions for graphviz [here](https://graphviz.org/download/).
19
-
You may run the demo without graphviz but the demo will print an error to the terminal and DiffDetective cannot compute a layout for visualizing graphs.
20
-
So the GUI may appear differently as in the screencast (see _Expected Output_ section in [INSTALL.md](INSTALL.md)).
21
-
22
-
### Java Dependencies
23
27
The demo has few dependencies, most of which will be handled automatically by Maven.
24
28
The dependencies are documented in the Maven build file ([pom.xml](pom.xml)).
25
29
The only dependency that must be installed manually is our tool and library DiffDetective, which is also a Java Maven project.
26
30
Installing DiffDetective follows the default maven workflow and is explained on the [DiffDetective website](https://variantsync.github.io/DiffDetective/) and README.
27
31
28
-
## Virtualization: Docker or Nix
29
-
For easy replication, this demo also comes with a Nix package and a Docker container, which can be used on any system supporting Nix or Docker, respectively.
30
-
The Nix and Docker setup will take care of all requirements and dependencies (including DiffDetective) and will build the demo to a single runnable JAR file.
31
-
_Note_: Nix and Docker are neither required by the demo nor DiffDetective! They only serve to ease the setup for you.
32
-
33
-
### Docker
32
+
#### Requirements for Building with Docker
34
33
35
34
How to install Docker depends on your operating system:
36
35
37
36
-_Windows or Mac_: You can find download and installation instructions [here](https://www.docker.com/get-started).
38
37
-_Linux Distributions_: How to install Docker on your system, depends on your distribution. The chances are high that Docker is part of your distributions package database.
39
38
Docker's [documentation](https://docs.docker.com/engine/install/) contains instructions for common distributions.
40
39
41
-
### Nix
40
+
#### Requirements for Building with Nix
42
41
43
42
How to install Nix, also depends on your operating system.
44
43
Head to the [NixOS website](https://nixos.org/download/) and follow the installation instructions for your system.
@@ -49,4 +48,17 @@ Instead, you can use Nix from within Windows Subsystem for Linux (WSL2).
49
48
However, we do not recommend using Nix on Windows, except if you are already familiar with WSL2, Nix, and XServers.
50
49
We recommend using Docker or a manual setup instead.
51
50
Running the Demo from within WSL2 requires an XServer.
52
-
We recommend [VcXsrv](https://sourceforge.net/projects/vcxsrv/).
51
+
We recommend [VcXsrv](https://sourceforge.net/projects/vcxsrv/).
52
+
53
+
### Requirements for Running
54
+
55
+
To run the demo, a [Java development toolkit](https://www.oracle.com/java/technologies/downloads/) of version 17 or higher is required.
56
+
57
+
As an _optional_ dependency, running the demo uses graphviz.
58
+
You may find installation instructions for graphviz [here](https://graphviz.org/download/).
59
+
You may run the demo without graphviz, in which case the demo will print an error to the terminal and DiffDetective cannot compute a layout for visualizing graphs.
60
+
In this case, the GUI may appear differently as in the screencast (see _Expected Output_ section in [INSTALL.md](INSTALL.md)).
61
+
62
+
> We also provide a nix and docker setup for running the demo, too. However, these setups are fragile because the demo launches a graphical user interface which may cause errors.
63
+
> Hence, you can also run the demo without installing Java or graphviz.
64
+
> We hence recommend to run the demo manually with Java.
echo"The jar has been built successfully. You can find it in $(realpath DiffDetective-Demo.jar)"&&
12
+
echo"You might want to remove the 'result' link ('rm result') to allow the Nix garbage collector to reclaim some space."
13
+
elifcommand -v docker &>/dev/null
14
+
then
15
+
echo"Using Docker to build the DiffDetective demo jar."
16
+
17
+
root=0
18
+
if! groups | grep -q docker
19
+
then
20
+
if [ "$(id -u)"-ne 0 ]
21
+
then
22
+
echo>&2"You don't seem to be able to run Docker as your user. Please start this script as root (e.g., using 'sudo') or ensure you are a member of the docker group."
23
+
exit 2
24
+
fi
25
+
fi
26
+
27
+
if! docker version &>/dev/null
28
+
then
29
+
echo>&2"Docker isn't running. You need to start the docker engine first."
30
+
echo>&2"On most Linux distributions you can do so using 'systemctl start docker'."
31
+
exit 3
32
+
fi
33
+
34
+
docker build . --tag diffdetective-demo:1.0.0 &&
35
+
docker run --volume "$PWD:/output:rw" diffdetective-demo:1.0.0 /bin/cp /DiffDetective/share/java/DiffDetective-Demo.jar /output
36
+
37
+
if [ "$?"-eq 0 ]
38
+
then
39
+
echo
40
+
echo"The jar has been built successfully. You can find it in $(realpath DiffDetective-Demo.jar)"
41
+
echo"You might want to remove the Docker image ('docker image rm diffdetective-demo:1.0.0')."
42
+
43
+
if [ "$(id -u)"-eq 0 ]
44
+
then
45
+
echo"You might want to change the owner of the jar ('chown username:group DiffDetective-Demo.jar') because it's current owner is root."
46
+
fi
47
+
fi
48
+
else
49
+
echo"Neither Nix nor Docker are installed. You need to compile the jar for yourselves. See INSTALL.md for instructions."
0 commit comments