{"record":{"id":"88de6ec19d7a9659","repo":"BoundaryML/baml","slug":"errnotsupportedplatform","errorCode":"ErrNotSupportedPlatform","errorMessage":"baml: platform not supported (only Linux and MacOS amd64/arm64)","messagePattern":"baml: platform not supported \\(only Linux and MacOS amd64/arm64\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/baml_go/lib_common.go","lineNumber":81,"sourceCode":"\t\tTransport: transport,\n\t\tTimeout:   5 * time.Minute,\n\t}\n}\n\n// setOrchestrionInternalFlag tries to set DD__tracer_internal=true using reflection.\n// This field is added by Orchestrion's code transformation.\nfunc setOrchestrionInternalFlag(transport *http.Transport) {\n\t// Use reflection to set the field if it exists\n\tval := reflect.ValueOf(transport).Elem()\n\tfield := val.FieldByName(\"DD__tracer_internal\")\n\tif field.IsValid() && field.CanSet() && field.Kind() == reflect.Bool {\n\t\tfield.SetBool(true)\n\t}\n}\n\nvar (\n\tErrLoadLibrary          = errors.New(\"baml: failed loading shared library\")\n\tErrNotSupportedPlatform = errors.New(\"baml: platform not supported (only Linux and MacOS amd64/arm64)\")\n\tErrDownloadFailed       = errors.New(\"baml: failed to download shared library\")\n\tErrCacheDir             = errors.New(\"baml: failed to determine or create cache directory\")\n\tErrChecksumMismatch     = errors.New(\"baml: downloaded library checksum mismatch\")\n\tErrVersionMismatch      = errors.New(\"baml: library version mismatch\")\n\tErrInitialization       = errors.New(\"baml: initialization failed\")\n)\n\nvar (\n\tbamlSharedLibraryPath = \"\"\n\tinitErr               error\n\tinitOnce              sync.Once\n\tbamlLibHandle         unsafe.Pointer\n\tlogger                *slog.Logger\n)\n\nfunc SetSharedLibraryPath(path string) {\n\tif bamlLibHandle != nil {\n\t\tlogger.Warn(\"SetSharedLibraryPath called after BAML library was initialized. Path ignored.\", \"path\", path)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/baml_go/lib_common.go#L63-L99","documentation":"ErrNotSupportedPlatform is returned when the current GOOS/GOARCH combination is not one of the supported targets (Linux and macOS on amd64/arm64). initializeBaml checks isSupportedPlatform() before anything else, and getTargetLibFilename rejects architectures with no prebuilt native library.","triggerScenarios":"Running on GOOS/GOARCH like windows/386, freebsd/arm64, linux/riscv64, or darwin/386; or getTargetLibFilename receiving an unsupported goarch such as 386.","commonSituations":"Building on Windows (no native library target wired for it in the Go client's supported set), Raspberry Pi / ARMv7 boards, Alpine on musl with unusual arch, or cross-compiling to an unsupported triple.","solutions":["Run on a supported platform: linux/amd64, linux/arm64, darwin/amd64, or darwin/arm64","For unsupported architectures, use Docker with platform emulation (docker run --platform linux/amd64) or Rosetta on Apple Silicon x86 images","Check GOOS/GOARCH at startup and fail fast with a clear message instead of letting init fail opaquely","If you truly need another target, build the BAML native library yourself for that triple and place it at the expected path"],"exampleFix":"// before\n// go build on linux/riscv64\n// after\nGOOS=linux GOARCH=amd64 go build ./...  // or run under qemu/box64 emulation","handlingStrategy":"validation","validationCode":"func bamlSupported() bool {\n    switch runtime.GOOS {\n    case \"linux\", \"darwin\":\n        switch runtime.GOARCH {\n        case \"amd64\", \"arm64\":\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"if !bamlSupported() {\n    return fmt.Errorf(\"unsupported platform %s/%s for baml\", runtime.GOOS, runtime.GOARCH)\n}","preventionTips":["Check GOOS/GOARCH in CI matrices and skip/guard baml-dependent tests on unsupported targets","Use --platform linux/amd64 Docker builds on exotic hosts","Document supported platforms in your deployment requirements"],"tags":["platform","architecture","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}