MacOS 15 Beta3: Metal Shader with newLibraryWithSource didn't work if the executable path contains Chinese character.

Here is the test code run in a macOS app (MacOS 15 Beta3). If the excutable path does not contain Chinese character, every thing go as We expect. Otherwise(simply place excutable in a Chinese named directory) , the MTLLibrary We made by newLibraryWithSource: function contains no functions, We just got logs:

"Library contains the following functions: {}"

"Function 'squareKernel' not found."

Note: macOS 14 works fine

id<MTLDevice> device = MTLCreateSystemDefaultDevice();
if (!device) {
    NSLog(@"not support Metal.");
}

NSString *shaderSource = @
    "#include <metal_stdlib>\n"
    "using namespace metal;\n"
    "kernel void squareKernel(device float* data [[buffer(0)]], uint gid [[thread_position_in_grid]]) {\n"
    "    data[gid] *= data[gid];\n"
    "}";


MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
options.languageVersion = MTLLanguageVersion2_0;
NSError *error = nil;
id<MTLLibrary> library = [device newLibraryWithSource:shaderSource options:options error:&error];
if (error) {
    NSLog(@"New MTLLibrary error: %@", error);
}

NSArray<NSString *> *functionNames = [library functionNames];
NSLog(@"Library contains the following functions: %@", functionNames);

id<MTLFunction> computeShaderFunction = [library newFunctionWithName:@"squareKernel"];
if (computeShaderFunction) {
    NSLog(@"Found function 'squareKernel'.");
                
    NSError *pipelineError = nil;
    id<MTLComputePipelineState> pipelineState = [device newComputePipelineStateWithFunction:computeShaderFunction error:&pipelineError];
    if (pipelineError) {
          NSLog(@"Create pipeline state error: %@", pipelineError);
     }      
    NSLog(@"Create pipeline state succeed!");
} else {
   NSLog(@"Function 'squareKernel' not found.");
}

I have the same problem on macOS 15 beta 8.

I have the same issue. I'm developing an Electron app using Three.js & WebGL. The app cannot run properly if it is located in a path having Chinese character, but moving it outside will work.

I have the same issue, and this problem can be reproduced when the Preferred Languages is set to Simplified Chinese, it doesn't appear after switching to English

MacOS 15 Beta3: Metal Shader with newLibraryWithSource didn't work if the executable path contains Chinese character.
 
 
Q