2018-09-24 16:28:46 -07:00
# Managing Dependencies
2018-09-24 14:18:29 -04:00
## Build Dependencies
The following dependencies must be installed on your system before you can build the installer.
2018-10-22 12:14:49 -04:00
### Fedora, CentOS, RHEL
2018-09-24 14:18:29 -04:00
```sh
sudo yum install golang-bin gcc-c++
```
2018-10-19 15:05:20 -07:00
If you need support for [libvirt destroy ](libvirt-howto.md#cleanup ), you should also install `libvirt-devel` .
2018-10-01 13:56:45 -07:00
2018-11-14 15:53:38 -08:00
### Go
2018-09-24 16:28:46 -07:00
We follow a hard flattening approach; i.e. direct and inherited dependencies are installed in the base `vendor/` .
2018-09-29 00:04:38 -07:00
Dependencies are managed with [dep ](https://golang.github.io/dep/ ) but committed directly to the repository. If you don't have dep, install the latest release from [Installation ](https://golang.github.io/dep/docs/installation.html ) link.
2018-09-24 16:28:46 -07:00
2019-01-17 17:29:22 +08:00
We require at least following version for dep:
2018-09-29 00:04:38 -07:00
2018-12-14 09:59:38 -08:00
```console
$ dep version
2018-09-29 00:04:38 -07:00
dep:
version : v0.5.0
build date : 2018-07-26
git hash : 224a564
go version : go1.10.3
```
2018-09-24 16:28:46 -07:00
To add a new dependency:
2018-09-29 00:04:38 -07:00
2018-10-03 10:35:18 +00:00
- Edit the `Gopkg.toml` file to add your dependency.
2018-09-29 00:04:38 -07:00
- Ensure you add a `version` field for the tag or the `revision` field for commit id you want to pin to.
2018-09-24 16:28:46 -07:00
- Revendor the dependencies:
```sh
2018-09-29 00:04:38 -07:00
dep ensure
2018-09-24 16:28:46 -07:00
```
2018-09-29 00:04:38 -07:00
This [guide ](https://golang.github.io/dep/docs/daily-dep.html ) a great source to learn more about using `dep` is .
2018-09-24 16:28:46 -07:00
For the sake of your fellow reviewers, commit vendored code separately from any other changes.
## Tests
See [tests/README.md ](../../tests/README.md ).