The following sections describe how to build and test the project.
git
make
- A recent Go distribution (>=1.11)
Note
You should be able to develop the project on Linux, Windows, or macOS.
Get the sources from GitHub:
$ git clone https://github.com/crc-org/crc.git
Note
Do not keep the source code in your $GOPATH
, as Go modules will cause make
to fail.
CRC uses Go modules for dependency management.
For more information, see the following:
In order to compile the crc executable for your local platform, run the following command:
$ make
By default, the above command will place the crc executable in the $GOBIN
path.
Run the following command to cross-compile the crc executable for many platforms:
$ make cross
Note: This command will output the cross-compiled crc executable(s) in the out
directory by default:
$ tree out/
out/
├── linux-amd64
│ └── crc
├── macos-amd64
│ └── crc
└── windows-amd64
└── crc.exe
To run all unit test use:
$ make test
If you need to update mocks use:
$ make generate_mocks
When running tests from IDE, you might encounter this error:
pkg-config --cflags -- gpgme
Package gpgme was not found in the pkg-config search path.
Perhaps you should add the directory containing `gpgme.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gpgme' found
pkg-config: exit status 1
In order to resolve this you need to install gpgme
You need to install libgpgme-dev
using your Linux distribution's package installer tool (dnf
/apt
)
Here is an example for Fedora:
sudo dnf -y install libgpgme-dev
You need to install gpgme
on macOS.
Here is an example using homebrew:
brew install gpgme