-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build errors with codegen discovery flag enabled #1320
Fix build errors with codegen discovery flag enabled #1320
Conversation
…n generate-artifacts.js" This reverts commit d68d209.
@shwanton Do you know if this change would work on RN-macOS 0.68? Considering whether it's worth back porting. |
@Saadnajmi I tested this on the 0.68 branch so will work fine. |
Summary: **Context** PR: microsoft#1320 Although fabric is not supported on RN Desktop, the codegen aspect of turbomodules should work correctly. Building RNTester with the `USE_CODEGEN_DISCOVERY=1` flag was throwing errors. build command: `USE_CODEGEN_DISCOVERY=1 bundle exec pod install;` ``` [Codegen] Done. TypeError [ERR_INVALID_ARG_TYPE]: The "args" argument must be of type object. Received type string ('/Users/shawndempsey/src/...) at new NodeError (node:internal/errors:372:5) at normalizeSpawnArguments (node:child_process:515:11) at execFileSync (node:child_process:854:13) at /Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:238:7 at Array.forEach (<anonymous>) at main (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:211:15) at Object.<anonymous> (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:322:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) { code: 'ERR_INVALID_ARG_TYPE' } ``` There was a change made to `generate-artifacts` d68d209 that refactored usage to `execFileSync`. The error is thrown because `execFileSync` expects an [array as it's second argument](https://nodejs.org/api/child_process.html). **Changes** * Revert ["Use execFileSync over execSync when messing with file paths in generate-artifacts.js"](microsoft@d68d209) * Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1 Test Plan: ### Build RNTester w/ flag `USE_CODEGEN_DISCOVERY=1 bundle exec pod install` Screenshot test (Which uses codegen), should still work. https://pxl.cl/29g5K Reviewers: lyahdav, chpurrer Reviewed By: chpurrer Subscribers: generatedunixname89002005327315 Differential Revision: https://phabricator.intern.facebook.com/D38436886
Summary: **Context** PR: microsoft#1320 Although fabric is not supported on RN Desktop, the codegen aspect of turbomodules should work correctly. Building RNTester with the `USE_CODEGEN_DISCOVERY=1` flag was throwing errors. build command: `USE_CODEGEN_DISCOVERY=1 bundle exec pod install;` ``` [Codegen] Done. TypeError [ERR_INVALID_ARG_TYPE]: The "args" argument must be of type object. Received type string ('/Users/shawndempsey/src/...) at new NodeError (node:internal/errors:372:5) at normalizeSpawnArguments (node:child_process:515:11) at execFileSync (node:child_process:854:13) at /Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:238:7 at Array.forEach (<anonymous>) at main (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:211:15) at Object.<anonymous> (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:322:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) { code: 'ERR_INVALID_ARG_TYPE' } ``` There was a change made to `generate-artifacts` d68d209 that refactored usage to `execFileSync`. The error is thrown because `execFileSync` expects an [array as it's second argument](https://nodejs.org/api/child_process.html). **Changes** * Revert ["Use execFileSync over execSync when messing with file paths in generate-artifacts.js"](microsoft@d68d209) * Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1 Test Plan: ### Build RNTester w/ flag `USE_CODEGEN_DISCOVERY=1 bundle exec pod install` Screenshot test (Which uses codegen), should still work. https://pxl.cl/29g5K Reviewers: lyahdav, chpurrer Reviewed By: chpurrer Subscribers: generatedunixname89002005327315 Differential Revision: https://phabricator.intern.facebook.com/D38436886
@amgleitman Could you take a second look at this? I worry about the changes of |
@shwanton |
Summary: **Context** PR: microsoft#1320 Although fabric is not supported on RN Desktop, the codegen aspect of turbomodules should work correctly. Building RNTester with the `USE_CODEGEN_DISCOVERY=1` flag was throwing errors. build command: `USE_CODEGEN_DISCOVERY=1 bundle exec pod install;` ``` [Codegen] Done. TypeError [ERR_INVALID_ARG_TYPE]: The "args" argument must be of type object. Received type string ('/Users/shawndempsey/src/...) at new NodeError (node:internal/errors:372:5) at normalizeSpawnArguments (node:child_process:515:11) at execFileSync (node:child_process:854:13) at /Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:238:7 at Array.forEach (<anonymous>) at main (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:211:15) at Object.<anonymous> (/Users/shawndempsey/src/shwanton_react-native-macos/scripts/generate-artifacts.js:322:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) { code: 'ERR_INVALID_ARG_TYPE' } ``` There was a change made to `generate-artifacts` d68d209 that refactored usage to `execFileSync`. The error is thrown because `execFileSync` expects an [array as it's second argument](https://nodejs.org/api/child_process.html). **Changes** * Revert ["Use execFileSync over execSync when messing with file paths in generate-artifacts.js"](microsoft@d68d209) * Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1 Test Plan: ### Build RNTester w/ flag `USE_CODEGEN_DISCOVERY=1 bundle exec pod install` Screenshot test (Which uses codegen), should still work. https://pxl.cl/29g5K Reviewers: lyahdav, chpurrer Reviewed By: chpurrer Subscribers: generatedunixname89002005327315 Differential Revision: https://phabricator.intern.facebook.com/D38436886
Yes, I'll refactor to use |
@Saadnajmi Updated to use |
* Revert "Use execFileSync over execSync when messing with file paths in generate-artifacts.js" This reverts commit d68d209. * [RN][macos] Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1 * use `execFileSync` for secure argument passing * Fix tag comments * Don't use template literals as arguments Co-authored-by: Shawn Dempsey <[email protected]>
* Revert "Use execFileSync over execSync when messing with file paths in generate-artifacts.js" This reverts commit d68d209. * [RN][macos] Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1 * use `execFileSync` for secure argument passing * Fix tag comments * Don't use template literals as arguments Co-authored-by: Shawn Dempsey <[email protected]> Co-authored-by: Shawn Dempsey <[email protected]> Co-authored-by: Shawn Dempsey <[email protected]>
Please select one of the following
Summary
Although fabric is not supported on RN Desktop, the codegen aspect of turbomodules should work correctly.
Building RNTester with the
USE_CODEGEN_DISCOVERY=1
flag was throwing errors.build command:
USE_CODEGEN_DISCOVERY=1 bundle exec pod install;
There was a change made to
generate-artifacts
d68d209 that refactored usage toexecFileSync
. The error is thrown becauseexecFileSync
expects an array as it's second argument.Changelog
[macOS] [Revert] Revert "Use execFileSync over execSync when messing with file paths in generate-artifacts.js"
[macOS] [Fix] Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1
Test Plan
Build RNTester w/ flag
USE_CODEGEN_DISCOVERY=1 bundle exec pod install
ScreenshotManager Native TurboModule should work from JS
CleanShot.2022-08-02.at.15.37.55-converted.mp4