Skip to content
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

macOS build crashes if product_string is not nwjs #705

Closed
1 of 3 tasks
sysrage opened this issue Nov 22, 2022 · 7 comments
Closed
1 of 3 tasks

macOS build crashes if product_string is not nwjs #705

sysrage opened this issue Nov 22, 2022 · 7 comments
Labels
bug Priority: 1

Comments

@sysrage
Copy link
Contributor

sysrage commented Nov 22, 2022

Issue Type

  • Bug Fix
  • Feature
  • Other

Current/Missing Behaviour

When attempting to use "osx" as the platform and building in macOS Ventura, the build fails. As shown below, no errors are reported but the resulting directory and ZIP file are missing application content.

Building package for osx...
 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s | 123635907/123635907
[ DEBUG ] 2022-11-22T03:05:46.247Z Manifest file does not exist locally
[ DEBUG ] 2022-11-22T03:05:46.248Z Downloading latest manifest file under /Users/zombie/Downloads/nw-react-nw-build/cache
[ DEBUG ] 2022-11-22T03:05:47.092Z Succesfully cached manifest metadata
[ DEBUG ] 2022-11-22T03:05:47.095Z Store manifest metadata in memory
[ DEBUG ] 2022-11-22T03:05:47.096Z Convert manifest data into JSON
[ DEBUG ] 2022-11-22T03:05:47.097Z Search for 0.70.1 specific release data
[ DEBUG ] 2022-11-22T03:05:47.098Z Remove any files at /Users/zombie/Downloads/nw-react-nw-build/dist/nw-react-example-0.1.1-osx directory
[ DEBUG ] 2022-11-22T03:05:47.098Z Copy /Users/zombie/Downloads/nw-react-nw-build/cache/nwjs-v0.70.1-osx-x64 files to /Users/zombie/Downloads/nw-react-nw-build/dist/nw-react-example-0.1.1-osx directory
[ DEBUG ] 2022-11-22T03:05:47.432Z Copy /Users/zombie/Downloads/nw-react-nw-build/dist/app files to /Users/zombie/Downloads/nw-react-nw-build/dist/nw-react-example-0.1.1-osx directory
[ DEBUG ] 2022-11-22T03:05:47.436Z Get NW's package.json as a buffer
[ DEBUG ] 2022-11-22T03:05:47.436Z Convert package.json buffer into JSON
[ DEBUG ] 2022-11-22T03:05:47.436Z Starting platform specific config steps for osx
Finished building package for osx

image

Expected/Proposed Behaviour

Additional Info

  • Operating System: macOS Ventura 13.0.1
  • Node version: 18.12.1
  • NW.js version: 0.70.1
  • Repro link:
@sysrage
Copy link
Contributor Author

sysrage commented Nov 27, 2022

Part 1 of this issue is because the directory name is incorrectly being set to nw.app instead of app.nw: https://github.com/nwutils/nw-builder/search?q=nw.app

This prevents the actual app content from being included in the final package.

There is a secondary issue, where the various metadata modification steps are breaking the nwjs.app bundle. Even when manually creating the missing app.nw directory, the app crashes when launched. If everything in bld/osxCfg.js is commented out except for the following line, the app launches without crashing:

await fs.rename(`${outDir}/nwjs.app`, `${outDir}/${pkg.name}.app`);

@sysrage
Copy link
Contributor Author

sysrage commented Nov 27, 2022

Okay, the app only fails to launch if the helper apps are renamed (or product_string is added to package.json). So, I've pushed a PR that fixes everything else. We'll need to follow-up on the mailing list to determine why the helper apps cannot be renamed.

image

@ayushmanchhabra
Copy link
Collaborator

ayushmanchhabra commented Dec 25, 2022

I did some digging with respect to renaming the helpers. Chrome hardcoded the helper app paths which we can see in nw22. As of nw71, a product_string property is used to rename the helper apps. Since I don't have a Mac or a MacOS compiled version of NW.js, my guess is that the linked code does not apply to current releases with the current app structure leading to crashes. The zombie process issue could be related to this.

@ayushmanchhabra ayushmanchhabra changed the title macOS (osx) builds fail macOS build crashs if product_string is not nwjs Dec 25, 2022
@ayushmanchhabra ayushmanchhabra changed the title macOS build crashs if product_string is not nwjs macOS build crashes if product_string is not nwjs Dec 25, 2022
@sysrage
Copy link
Contributor Author

sysrage commented Dec 28, 2022

As of nw71, a product_string property is used to rename the helper apps. Since I don't have a Mac or a MacOS compiled version of NW.js, my guess is that the linked code does not apply to current releases with the current Helper apps structure leading to crashes. The zombie process issue could be related to this.

@rogerwang any insight on renaming helper apps? I asked on the mailing list but haven't seen any responses.

@ayushmanchhabra
Copy link
Collaborator

Tracking in upstream nwjs/nw.js#7253

@benjismith
Copy link

Yikes, this ticket should not have been closed! The issue is not fixed... In the latest MacOS builds (0.79.1) I'm still seeing the app crash if product_string is set to anything other than nwjs.

@sysrage
Copy link
Contributor Author

sysrage commented Aug 23, 2023

Yikes, this ticket should not have been closed! The issue is not fixed... In the latest MacOS builds (0.79.1) I'm still seeing the app crash if product_string is set to anything other than nwjs.

It’s a bug with NW.js, not nw-builder. The issue for tracking is linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Priority: 1
Projects
None yet
Development

No branches or pull requests

3 participants