MCPcopy Index your code
hub / github.com/celer-pkg/celer / currentSystemProcessor

Method currentSystemProcessor

configs/port.go:524–549  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

522}
523
524func (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}

Callers 2

findMatchedConfigMethod · 0.95
matchBuildConfigMethod · 0.95

Calls 4

GetHostNameMethod · 0.65
PlatformMethod · 0.65
GetToolchainMethod · 0.65
GetSystemProcessorMethod · 0.65

Tested by

no test coverage detected