Skip to content

Building from Source

  • Go 1.25+
  • Git
  • Make (optional)
Terminal window
git clone https://github.com/warpdl/warpdl.git
cd warpdl
Terminal window
# Using Make
make build
# Or directly with Go
go build -ldflags="-w -s" .

WarpDL follows a testing trophy: the bulk of coverage is local integration tests that drive real components (sockets, daemon, download engine, HTTP range servers) in-process, backed by focused unit tests for logic, security, and concurrency. Binary-level CLI/daemon E2E runs are selective. See Contributing for the layer-by-layer breakdown.

Terminal window
# Default suite: unit + local real-component integration
go test ./...
# CI form: bypass the test cache
go test ./... -count=1
# Race detector; -short trims the long stress cases
go test -race -short ./...
# Coverage report
go test -cover ./...
# Specific package
go test ./pkg/warplib/...

Total and per-package coverage must stay at or above 80%. Run the same gate CI uses:

Terminal window
scripts/check_coverage.sh

The CLI/daemon E2E suite needs the e2e build tag and builds the real binary. The default local run skips the external mirror probes:

Terminal window
go test -v -tags=e2e -skip '^TestCLIDownload_' -count=1 -timeout=10m ./tests/e2e/

TestCLIDownload_* tests download from public mirrors and need internet access. They are advisory availability checks, not a correctness gate, so CI keeps them in a non-blocking matrix.

Terminal window
go build -ldflags="-X main.version=1.0.0 -X main.commit=$(git rev-parse HEAD)" .
Terminal window
# Linux
GOOS=linux GOARCH=amd64 go build -o warpdl-linux .
# Windows
GOOS=windows GOARCH=amd64 go build -o warpdl.exe .
# macOS ARM64
GOOS=darwin GOARCH=arm64 go build -o warpdl-darwin .
Terminal window
# Using goreleaser
make goreleaser

To publish a release, create and push an annotated vX.Y.Z tag on the commit to release. Pushing the tag starts the Release workflow. Its manual tag input can rerun an existing tag; it does not create one.