diff --git a/apps/example/ios/Podfile.lock b/apps/example/ios/Podfile.lock index 2872dcfd8..219ec2508 100644 --- a/apps/example/ios/Podfile.lock +++ b/apps/example/ios/Podfile.lock @@ -1407,7 +1407,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-skia (2.0.0): + - react-native-skia (2.2.14): - DoubleConversion - glog - hermes-engine @@ -1433,7 +1433,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-wgpu (0.2.5): + - react-native-wgpu (0.2.6): - DoubleConversion - glog - hermes-engine @@ -2245,8 +2245,8 @@ SPEC CHECKSUMS: React-Mapbuffer: c3f4b608e4a59dd2f6a416ef4d47a14400194468 React-microtasksnativemodule: 054f34e9b82f02bd40f09cebd4083828b5b2beb6 react-native-safe-area-context: 562163222d999b79a51577eda2ea8ad2c32b4d06 - react-native-skia: 99362ce77dff006719636c97f16c9713e3ec221e - react-native-wgpu: 091c71fc96e5470bdc69b5b9f1bc632540cd8a06 + react-native-skia: a00cb2132c9f8a90d3dade66c56c2325c28a9fb6 + react-native-wgpu: 770f8c16bebe46a176a14f16d1058ed6f6cf14b8 React-NativeModulesApple: 2c4377e139522c3d73f5df582e4f051a838ff25e React-oscompat: ef5df1c734f19b8003e149317d041b8ce1f7d29c React-perflogger: 9a151e0b4c933c9205fd648c246506a83f31395d diff --git a/packages/webgpu/package.json b/packages/webgpu/package.json index f029d7145..2d16098cf 100644 --- a/packages/webgpu/package.json +++ b/packages/webgpu/package.json @@ -1,6 +1,6 @@ { "name": "react-native-wgpu", - "version": "0.2.5", + "version": "0.2.6", "description": "React Native WebGPU", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/packages/webgpu/scripts/build/dawn-configuration.ts b/packages/webgpu/scripts/build/dawn-configuration.ts index 7cc4774c7..c8a52db55 100644 --- a/packages/webgpu/scripts/build/dawn-configuration.ts +++ b/packages/webgpu/scripts/build/dawn-configuration.ts @@ -1,5 +1,6 @@ /* eslint-disable max-len */ import { $, checkFileExists, runAsync } from "./util"; +import { checkDuplicateHeaders } from "../codegen/util"; export const libs = ["libwebgpu_dawn"] as const; @@ -32,8 +33,12 @@ export const copyHeaders = () => { `rm -rf ${projectRoot}/cpp/dawn/webgpu.h`, `rm -rf ${projectRoot}/cpp/dawn/webgpu_cpp.h`, `rm -rf ${projectRoot}/cpp/dawn/wire`, + `rm -rf ${projectRoot}/cpp/webgpu/webgpu_cpp_print.h`, `cp externals/dawn/src/dawn/dawn.json ${projectRoot}/libs`, ].map((cmd) => $(cmd)); + + // Check for duplicate header names and issue warnings + checkDuplicateHeaders(`${projectRoot}/cpp`); }; const serializeCMakeArgs = (args: Record) => { diff --git a/packages/webgpu/scripts/codegen/util.ts b/packages/webgpu/scripts/codegen/util.ts index 2da71e567..0c03a00c8 100644 --- a/packages/webgpu/scripts/codegen/util.ts +++ b/packages/webgpu/scripts/codegen/util.ts @@ -35,3 +35,38 @@ export const writeFile = ( `${labels[label]} ${file.substring(file.indexOf("/package/") + "/package/".length)}`, ); }; + +export const checkDuplicateHeaders = (cppPath: string) => { + // Check for duplicate header names and issue warnings + const duplicateHeaders = $( + `find ${cppPath} -name '*.h' -type f | sed 's/.*\\///' | sort | uniq -d`, + ).toString(); + if (duplicateHeaders.trim()) { + console.warn("⚠️ WARNING: Found duplicate header names:"); + let hasConflicts = false; + + duplicateHeaders + .split("\n") + .filter(Boolean) + .forEach((filename: string) => { + const fullPaths = $( + `find ${cppPath} -name "${filename}" -type f`, + ).toString(); + const paths = fullPaths.split("\n").filter(Boolean); + + console.warn(` ${filename}:`); + paths.forEach((filePath: string) => { + console.warn(` ${filePath}`); + }); + + hasConflicts = true; + }); + + if (hasConflicts) { + console.error( + "❌ ERROR: Duplicate headers found that will cause iOS build conflicts!", + ); + exit(1); + } + } +};