-
Notifications
You must be signed in to change notification settings - Fork 1
Building
Rosemary uses a single build.sh script to cross-compile both the server and agent for all supported platforms and architectures.
- Go 1.25 or later
-
GOTOOLCHAIN=autois set by the build script automatically -
CGO_ENABLED=0no C dependencies, fully static binaries - For Windows server builds:
WinDivert.dllandWinDivert64.sysmust be present inrosemary/before building
git clone https://github.com/blue0x1/rosemary.git
cd rosemary
bash build.shOutput binaries are placed in dist/.
bash build.sh [target] [os] [arch]| Argument | Options | Default |
|---|---|---|
| target |
rosemary, agent, all
|
all |
| os |
linux, windows, darwin, freebsd, openbsd, all
|
all |
| arch |
amd64, arm64, arm, 386, all
|
all |
# Build everything
bash build.sh
# Build server only for Linux amd64
bash build.sh rosemary linux amd64
# Build agent only for Windows
bash build.sh agent windows amd64
# Build all targets for macOS
bash build.sh all darwin all| OS | Architectures |
|---|---|
| Linux | amd64, arm64, arm, 386 |
| Windows | amd64, arm64, 386 |
| macOS | amd64, arm64 |
| FreeBSD | amd64, arm64, arm, 386 |
| OpenBSD | amd64, arm64, arm, 386 |
ARM 32-bit builds use GOARM=7.
dist/rosemary-<os>-<arch>
dist/rosemary-<os>-<arch>.exe (Windows)
dist/agent-<os>-<arch>
dist/agent-<os>-<arch>.exe (Windows)
The build script checks minimum binary sizes after each build:
| Binary | Minimum size |
|---|---|
| rosemary (server) | 8 MB |
| agent | 4 MB |
A warning is printed if a binary is suspiciously small, which may indicate an incomplete or failed build.
The Windows server build embeds WinDivert.dll and WinDivert64.sys directly into the binary. They are extracted to a temporary directory at runtime.
Before building the Windows server target, place both files in the rosemary/ directory:
- Download WinDivert v2.x (64-bit) from the official source
- Copy
WinDivert.dllandWinDivert64.sysintorosemary/ - Run the build
Alternatively, install directly without cloning:
go install github.com/blue0x1/rosemary/rosemary@latest
go install github.com/blue0x1/rosemary/agent@latestFor sudo use, copy to the system path:
sudo cp ~/go/bin/rosemary /usr/local/bin/Use only on systems you own or have explicit written permission to test. Unauthorized use is prohibited.