Building from Source
Prerequisites
Section titled “Prerequisites”- Go 1.25+
- Git
- Make (optional)
Clone Repository
Section titled “Clone Repository”git clone https://github.com/warpdl/warpdl.gitcd warpdl# Using Makemake build
# Or directly with Gogo build -ldflags="-w -s" .Run Tests
Section titled “Run Tests”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.
# Default suite: unit + local real-component integrationgo test ./...
# CI form: bypass the test cachego test ./... -count=1
# Race detector; -short trims the long stress casesgo test -race -short ./...
# Coverage reportgo test -cover ./...
# Specific packagego test ./pkg/warplib/...Total and per-package coverage must stay at or above 80%. Run the same gate CI uses:
scripts/check_coverage.shThe CLI/daemon E2E suite needs the e2e build tag and builds the real binary.
The default local run skips the external mirror probes:
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.
Build with Version Info
Section titled “Build with Version Info”go build -ldflags="-X main.version=1.0.0 -X main.commit=$(git rev-parse HEAD)" .Cross-Compilation
Section titled “Cross-Compilation”# LinuxGOOS=linux GOARCH=amd64 go build -o warpdl-linux .
# WindowsGOOS=windows GOARCH=amd64 go build -o warpdl.exe .
# macOS ARM64GOOS=darwin GOARCH=arm64 go build -o warpdl-darwin .Release Build
Section titled “Release Build”# Using goreleasermake goreleaserTo 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.
