|
| 1 | +# Development |
| 2 | + |
| 3 | +> **Note:** Please take a look at <https://fluxcd.io/docs/contributing/flux/> |
| 4 | +> to find out about how to contribute to Flux and how to interact with the |
| 5 | +> Flux Development team. |
| 6 | +
|
| 7 | +## Installing required dependencies |
| 8 | + |
| 9 | +The dependency [libgit2](https://libgit2.org/) needs to be installed to be able |
| 10 | +to run source-controller or its test-suite locally (not in a container). |
| 11 | + |
| 12 | +In case this dependency is not present on your system (at the expected |
| 13 | +version), the first invocation of a `make` target that requires the |
| 14 | +dependency will attempt to compile it locally to `hack/libgit2`. For this build |
| 15 | +to succeed; CMake, Docker, OpenSSL 1.1 and LibSSH2 must be present on the system. |
| 16 | + |
| 17 | +Triggering a manual build of the dependency is possible as well by running |
| 18 | +`make libgit2`. To enforce the build, for example if your system dependencies |
| 19 | +match but are not linked in a compatible way, append `LIBGIT2_FORCE=1` to the |
| 20 | +`make` command. |
| 21 | + |
| 22 | +### macOS |
| 23 | + |
| 24 | +```console |
| 25 | +$ # Ensure libgit2 dependencies are available |
| 26 | +$ brew install cmake [email protected] libssh2 pkg-config |
| 27 | +$ LIBGIT2_FORCE=1 make libgit2 |
| 28 | +``` |
| 29 | + |
| 30 | +### Linux |
| 31 | + |
| 32 | +```console |
| 33 | +$ # Ensure libgit2 dependencies are available |
| 34 | +$ pacman -S cmake openssl libssh2 |
| 35 | +$ LIBGIT2_FORCE=1 make libgit2 |
| 36 | +``` |
| 37 | + |
| 38 | +**Note:** Example shown is for Arch Linux, but likewise procedure can be |
| 39 | +followed using any other package manager, e.g. `apt`. |
| 40 | + |
| 41 | +## How to run the test suite |
| 42 | + |
| 43 | +You can run the unit tests by simply doing |
| 44 | + |
| 45 | +```bash |
| 46 | +make test |
| 47 | +``` |
0 commit comments