Skip to content

OS.get_processor_namedoesn't seem to work on iOS #110168

@mihe

Description

@mihe

Tested versions

  • Reproducible in: 4.5.beta7

System information

Godot v4.5.beta7 - iPhone XR - iOS 18.3.1

Issue description

Put simply, calling OS.get_processor_name on iOS will seemingly always result in an error like so:

drivers/apple_embedded/os_apple_embedded.mm:419:get_processor_name(): Couldn't get the CPU model name. Returning an empty string. Method/function failed. Returning: ""

This seems to be due to OS_AppleEmbedded::get_processor_name relying on the sysctl name machdep.cpu.brand_string, which I believe only applies to macOS, but I could be wrong.

String OS_AppleEmbedded::get_processor_name() const {
char buffer[256];
size_t buffer_len = 256;
if (sysctlbyname("machdep.cpu.brand_string", &buffer, &buffer_len, nullptr, 0) == 0) {
return String::utf8(buffer, buffer_len);
}
ERR_FAIL_V_MSG("", String("Couldn't get the CPU model name. Returning an empty string."));
}

I haven't tested this with older versions of Godot, but seeing as how this code hasn't changed in a while I have no reason to believe this is a recent regression.

Steps to reproduce

  1. Open the MRP project.
  2. Export MRP project to iOS.
  3. Run the project on an iOS device.
  4. Note the failure/error.

Minimal reproduction project (MRP)

ios-processor-name.zip

Metadata

Metadata

Assignees

Type

No type

Projects

Status

For team assessment

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions