Build and test
Go version
go.mod declares a minimum of Go 1.20. CI covers 1.20–1.26 so older compatibility and newer behavior are both checked.
go version
go mod downloadLocal build
# Fast build
go build -o aster-core .
# Release-equivalent features
CGO_ENABLED=0 go build \
-tags with_gvisor \
-trimpath \
-o aster-core \
.The official Makefile also injects through ldflags:
constant.Versionconstant.BuildTimeconstant.ReleaseAsset
A plain go build therefore prints the development default version. Do not treat that as an official release.
Build tags
| Tag | Effect |
|---|---|
with_gvisor | gVisor TUN stack and full Tailscale |
with_low_memory | Lower-memory buffer strategy |
no_tailscale | Exclude Tailscale |
no_fake_tcp | Exclude Hysteria fake TCP |
cmfa | CMFA integration mode |
Inspect the binary:
./aster-core -vThe output lists the actual build tags.
Make targets
make linux-amd64-v1
make linux-arm64
make windows-amd64-v1
make darwin-arm64
make all
make all-arch
make releasesall: main desktop/server targets.all-arch: all uncompressed targets.releases: Unix.gzand Windows.zip.make vet: historical name; it actually runsgo test ./..., notgo vet.
Root-module tests
Skip downloading an external V2Ray interop binary:
SKIP_INTEROP_TEST=1 go test ./... -count=1GVisor:
SKIP_INTEROP_TEST=1 go test ./... -count=1 -tags with_gvisorTo run the VMess interoperability test, unset SKIP_INTEROP_TEST. The test downloads and builds an external dependency in a temp directory and takes longer.
Race tests
CI’s targeted set:
CGO_ENABLED=1 SKIP_INTEROP_TEST=1 go test -race \
./common/net \
./component/aster \
./hub/route \
./listener/anytls \
./listener/sing_vless \
./tunnel/statisticThese packages cover high-concurrency data structures, Aster state/API, managed credentials, and traffic.
Lint and format
go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
golangci-lint run --timeout=10mThe configuration enables:
govetstaticcheckgcigofumpt
Before you commit, also run:
go mod tidy -diff
git diff --checkDocker interoperability module
test/ has its own go.mod and is not run by root go test ./....
Requirements:
- Docker daemon
- Ability to download several proxy-server images
- Enough network/port privileges
cd test
make test
make benchmarkCoverage includes:
- Shadowsocks + obfs/plugin
- VMess normal/AEAD/HTTP/H2/TLS/WebSocket/gRPC
- Trojan
- Snell
- VLESS
- DNS/fake-IP/hosts
- TCP/UDP ping-pong and large payloads
Benchmarks are useful for relative change. They are not absolute production throughput.
Documentation site
cd docs
npm install
npm run dev
npm run buildA GitHub Pages subpath can be set with:
DOCS_BASE=/aster-core/ npm run buildDocumentation changes should confirm:
- Local search can find the new page.
- Sidebar links are not broken.
- Code examples parse.
- The
config.yamlraw link works. - Mobile tables can scroll horizontally.
- Both the Traditional Chinese (
/) and English (/en/) locales build.
