mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-21 21:26:16 +01:00
fix purego build errors on non-supported architectures
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
//go:build (linux || windows) && (amd64 || arm64)
|
||||||
|
|
||||||
package agent
|
package agent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
//go:build linux
|
//go:build linux && (amd64 || arm64)
|
||||||
|
|
||||||
package agent
|
package agent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
"log/slog"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func openLibrary(name string) (uintptr, error) {
|
func openLibrary(name string) (uintptr, error) {
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
//go:build !linux && !windows
|
//go:build (!linux && !windows) || (!amd64 && !arm64)
|
||||||
|
|
||||||
package agent
|
package agent
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
type nvmlCollector struct {
|
||||||
|
gm *GPUManager
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *nvmlCollector) init() error {
|
||||||
|
return fmt.Errorf("nvml not supported on this platform")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *nvmlCollector) start() {}
|
||||||
|
|
||||||
|
func (c *nvmlCollector) collect() {}
|
||||||
|
|
||||||
func openLibrary(name string) (uintptr, error) {
|
func openLibrary(name string) (uintptr, error) {
|
||||||
return 0, fmt.Errorf("nvml not supported on this platform")
|
return 0, fmt.Errorf("nvml not supported on this platform")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build windows
|
//go:build windows && (amd64 || arm64)
|
||||||
|
|
||||||
package agent
|
package agent
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user