fetch_ml/internal/worker/native_bridge.go
Jeremie Fraeys 37aad7ae87
feat: add manifest signing and native hashing support
- Integrate RunManifest.Validate with existing Validator
- Add manifest Sign() and Verify() methods
- Add native C++ hashing libraries (dataset_hash, queue_index)
- Add native bridge for Go/C++ integration
- Add deduplication support in queue
2026-02-19 15:34:39 -05:00

62 lines
1.9 KiB
Go

//go:build cgo && !native_libs
// +build cgo,!native_libs
package worker
import (
"errors"
"log"
"github.com/jfraeys/fetch_ml/internal/manifest"
"github.com/jfraeys/fetch_ml/internal/queue"
)
func init() {
log.Printf("[native] Native libraries disabled (build with -tags native_libs to enable)")
}
// dirOverallSHA256HexNative is not available without native_libs build tag.
func dirOverallSHA256HexNative(_ string) (string, error) {
return "", errors.New("native hash requires native_libs build tag")
}
// HashFilesBatchNative is not available without native_libs build tag.
func HashFilesBatchNative(paths []string) ([]string, error) {
return nil, errors.New("native batch hash requires native_libs build tag")
}
// GetSIMDImplName returns "disabled" when native libs aren't built.
func GetSIMDImplName() string {
return "disabled"
}
// HasSIMDSHA256 returns false when native libs aren't built.
func HasSIMDSHA256() bool {
return false
}
// ScanArtifactsNative is disabled without native_libs build tag.
func ScanArtifactsNative(runDir string) (*manifest.Artifacts, error) {
return nil, errors.New("native artifact scanner requires native_libs build tag")
}
// ExtractTarGzNative is disabled without native_libs build tag.
func ExtractTarGzNative(archivePath, dstDir string) error {
return errors.New("native tar.gz extractor requires native_libs build tag")
}
// QueueIndexNative is a stub type when native libs aren't built.
type QueueIndexNative struct{}
// OpenQueueIndexNative is not available without native_libs build tag.
func OpenQueueIndexNative(queueDir string) (*QueueIndexNative, error) {
return nil, errors.New("native queue index requires native_libs build tag")
}
// Close is a no-op for the stub.
func (qi *QueueIndexNative) Close() {}
// AddTasks is not available without native_libs build tag.
func (qi *QueueIndexNative) AddTasks(tasks []*queue.Task) error {
return errors.New("native queue index requires native_libs build tag")
}