docs: update all documentation to use build tags instead of deprecated env var
- README.md: Replace FETCHML_NATIVE_LIBS with -tags native_libs - docs/src/native-libraries.md: Update all examples to use build tags - .forgejo/workflows/ci-native.yml: Use -tags native_libs in all test steps - Remove deprecated FETCHML_NATIVE_LIBS=1/0 env var references
This commit is contained in:
parent
e557313e08
commit
d6265df0bd
3 changed files with 28 additions and 20 deletions
|
|
@ -197,33 +197,29 @@ jobs:
|
|||
- name: Test with Native Libraries
|
||||
run: |
|
||||
echo "Running tests WITH native libraries enabled..."
|
||||
FETCHML_NATIVE_LIBS=1 go test -v ./tests/...
|
||||
env:
|
||||
FETCHML_NATIVE_LIBS: "1"
|
||||
CGO_ENABLED=1 go test -tags native_libs -v ./tests/...
|
||||
continue-on-error: true
|
||||
|
||||
- name: Native Smoke Test
|
||||
run: |
|
||||
echo "Running native libraries smoke test..."
|
||||
make native-smoke
|
||||
env:
|
||||
FETCHML_NATIVE_LIBS: "1"
|
||||
CGO_ENABLED=1 go test -tags native_libs ./tests/benchmarks/... -run TestNative
|
||||
continue-on-error: true
|
||||
|
||||
- name: Test Fallback (Go only)
|
||||
run: |
|
||||
echo "Running tests WITHOUT native libraries (Go fallback)..."
|
||||
FETCHML_NATIVE_LIBS=0 go test -v ./tests/...
|
||||
env:
|
||||
FETCHML_NATIVE_LIBS: "0"
|
||||
go test -v ./tests/...
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run Benchmarks
|
||||
run: |
|
||||
echo "Running performance benchmarks..."
|
||||
echo "=== Go Implementation ==="
|
||||
FETCHML_NATIVE_LIBS=0 go test -bench=. ./tests/benchmarks/ -benchmem || true
|
||||
go test -bench=. ./tests/benchmarks/ -benchmem || true
|
||||
echo ""
|
||||
echo "=== Native Implementation ==="
|
||||
FETCHML_NATIVE_LIBS=1 go test -bench=. ./tests/benchmarks/ -benchmem || true
|
||||
CGO_ENABLED=1 go test -tags native_libs -bench=. ./tests/benchmarks/ -benchmem || true
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ FetchML includes optional C++ native libraries for performance. See `docs/src/na
|
|||
|
||||
Quick start:
|
||||
```bash
|
||||
make native-build # Build native libs
|
||||
make native-smoke # Run smoke test
|
||||
export FETCHML_NATIVE_LIBS=1 # Enable at runtime
|
||||
make native-build # Build native libs
|
||||
make native-smoke # Run smoke test
|
||||
go build -tags native_libs # Enable native libraries
|
||||
```
|
||||
|
||||
### Standard Build
|
||||
|
|
|
|||
|
|
@ -43,10 +43,18 @@ make native-debug # AddressSanitizer enabled
|
|||
make native-smoke # C++ tests + Go integration
|
||||
```
|
||||
|
||||
## Enabling at Runtime
|
||||
## Enabling Native Libraries
|
||||
|
||||
Build with the `native_libs` tag:
|
||||
|
||||
```bash
|
||||
export FETCHML_NATIVE_LIBS=1
|
||||
go build -tags native_libs ./...
|
||||
```
|
||||
|
||||
Or run tests with native libraries:
|
||||
|
||||
```bash
|
||||
go test -tags native_libs ./tests/...
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
|
@ -95,8 +103,12 @@ cd native/build && ctest --output-on-failure
|
|||
### Go Integration Tests
|
||||
|
||||
```bash
|
||||
FETCHML_NATIVE_LIBS=1 go test ./tests/benchmarks/...
|
||||
FETCHML_NATIVE_LIBS=1 go test ./tests/e2e/...
|
||||
# Run with native libraries
|
||||
go test -tags native_libs ./tests/benchmarks/...
|
||||
go test -tags native_libs ./tests/e2e/...
|
||||
|
||||
# Run without native libraries (Go fallback)
|
||||
go test ./tests/benchmarks/...
|
||||
```
|
||||
|
||||
### ASan Build
|
||||
|
|
@ -113,10 +125,10 @@ Run benchmarks to verify native libraries outperform pure Go:
|
|||
|
||||
```bash
|
||||
# Go implementation
|
||||
FETCHML_NATIVE_LIBS=0 go test -bench=. ./tests/benchmarks/
|
||||
go test -bench=. ./tests/benchmarks/
|
||||
|
||||
# Native implementation
|
||||
FETCHML_NATIVE_LIBS=1 go test -bench=. ./tests/benchmarks/
|
||||
go test -tags native_libs -bench=. ./tests/benchmarks/
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
|
|
|||
Loading…
Reference in a new issue