()
| 522 | } |
| 523 | |
| 524 | func (p Port) currentSystemProcessor() string { |
| 525 | if p.DevDep || p.HostDep { |
| 526 | // Host-side tools/dev dependencies must use the host architecture for |
| 527 | // build_config matching so we pick the native x86_64 config instead of |
| 528 | // the target architecture's config. |
| 529 | hostName := strings.TrimSpace(p.ctx.Platform().GetHostName()) |
| 530 | if systemProcessor, _, ok := strings.Cut(hostName, "-"); ok && systemProcessor != "" { |
| 531 | return systemProcessor |
| 532 | } |
| 533 | |
| 534 | switch runtime.GOARCH { |
| 535 | case "amd64": |
| 536 | return "x86_64" |
| 537 | case "arm64": |
| 538 | return "aarch64" |
| 539 | default: |
| 540 | return runtime.GOARCH |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | toolchain := p.ctx.Platform().GetToolchain() |
| 545 | if toolchain != nil && strings.TrimSpace(toolchain.GetSystemProcessor()) != "" { |
| 546 | return toolchain.GetSystemProcessor() |
| 547 | } |
| 548 | return runtime.GOARCH |
| 549 | } |
no test coverage detected