{"record":{"id":"d9def59ca144cb7d","repo":"fyne-io/fyne","slug":"unknown-goarch-q","errorCode":null,"errorMessage":"unknown GOARCH: %q","messagePattern":"unknown GOARCH: %q","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/fyne/internal/mobile/env.go","lineNumber":201,"sourceCode":"\t\tvar err error\n\t\tvar clang, cflags string\n\t\tswitch arch {\n\t\tcase \"arm\":\n\t\t\tenv = append(env, \"GOARM=7\")\n\t\t\tfallthrough\n\t\tcase \"arm64\":\n\t\t\tif buildTarget == \"ios\" {\n\t\t\t\tclang, cflags, err = envClang(\"iphoneos\")\n\t\t\t\tcflags += \" -miphoneos-version-min=\" + buildIOSVersion\n\t\t\t} else { // iossimulator\n\t\t\t\tclang, cflags, err = envClang(\"iphonesimulator\")\n\t\t\t\tcflags += \" -mios-simulator-version-min=\" + buildIOSVersion\n\t\t\t}\n\t\tcase \"386\", \"amd64\":\n\t\t\tclang, cflags, err = envClang(\"iphonesimulator\")\n\t\t\tcflags += \" -mios-simulator-version-min=\" + buildIOSVersion\n\t\tdefault:\n\t\t\tpanic(fmt.Errorf(\"unknown GOARCH: %q\", arch))\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif bitcodeEnabled {\n\t\t\tcflags += \" -fembed-bitcode\"\n\t\t}\n\n\t\tos := \"ios\"\n\t\tif before116 {\n\t\t\tos = \"darwin\"\n\t\t}\n\t\tenv = append(\n\t\t\tenv,\n\t\t\t\"GOOS=\"+os,\n\t\t\t\"GOARCH=\"+arch,\n\t\t\t\"CC=\"+clang,","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/fyne-io/fyne/blob/8860ee95c356385effa5a7be51adb11c6be9d2b6/cmd/fyne/internal/mobile/env.go#L183-L219","documentation":"While preparing the clang environment for iOS/iosimulator targets, the vendored mobile tool iterates every architecture in the target list and maps it to an Xcode SDK. Only arm (GOARM=7), arm64, 386 and amd64 (both simulator) are handled; any other GOARCH reaches the default branch and panics.","triggerScenarios":"Packaging for an Apple target with an architecture outside {arm, arm64, 386, amd64} in the list, e.g. 'fyne package -os ios -target ios/riscv64', or a GOARCH value leaked into the environment when custom tooling reuses this code path.","commonSituations":"A stale exported GOARCH in the shell/CI session; typo'd -target values; building for a new architecture before the vendored tool supports it.","solutions":["Use supported targets: plain ios (arm64+arm) or iossimulator (amd64/386); drop the unsupported arch from -target","Run 'unset GOARCH GOARM GOOS' before 'fyne package' so a leaked environment variable cannot poison the target","Update fyne - architectures are added to the supported set as Xcode gains them"],"exampleFix":"# before\nfyne package -os ios -target ios/riscv64\n\n# after\nfyne package -os ios","handlingStrategy":"validation","validationCode":"// Pre-flight: validate the -target architecture list before invoking the packaging tool.\nvar supportedIOSArchs = map[string]bool{\"arm\": true, \"arm64\": true, \"386\": true, \"amd64\": true}\nfunc validTarget(archs []string) error {\n    for _, a := range archs {\n        if !supportedIOSArchs[a] { return fmt.Errorf(\"unsupported target arch %q; use ios or iossimulator defaults\", a) }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'unset GOARCH GOARM GOOS' in build scripts before calling fyne","Use '-os ios' / '-os iossimulator' without explicit arch lists unless you must pin one","Print the effective target list at the top of CI logs so bad values are visible"],"tags":["ios","cross-compilation","goarch","fyne-cli","xcode","go"],"backgroundTag":null,"analyzedSha":"8860ee95c356385effa5a7be51adb11c6be9d2b6","analyzedAt":"2026-08-15T22:01:51.624Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}