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

Missing files after extracting osx build of NW.js in Windows #715

Closed
1 of 3 tasks
sysrage opened this issue Nov 27, 2022 · 6 comments · Fixed by #879
Closed
1 of 3 tasks

Missing files after extracting osx build of NW.js in Windows #715

sysrage opened this issue Nov 27, 2022 · 6 comments · Fixed by #879
Assignees
Labels
bug Priority: 1

Comments

@sysrage
Copy link
Contributor

sysrage commented Nov 27, 2022

Issue Type

  • Bug Fix
  • Feature
  • Other

Current/Missing Behaviour

When attempting to create an osx build from in Windows, files are missing from the extracted nwjs.app package. There may be more, but the most obvious are:

  • nwjs.app/Contents/Info.plist
  • nwjs.app/Contents/PkgInfo
  • nwjs.app/Contents/Frameworks/nwjs Framework.framework/*

Since these files are then missing from the final "built" package, the app won't run.

Expected/Proposed Behaviour

All files should be extracted (and included in the final package), no matter which OS is being used for building.

Additionally, error handling needs to be added to osxCfg.js (many try/catch blocks around all the disk I/O. The build script fails silently, when it can't find the Info.plist and other framework files.

Additional Info

  • Operating System: Windows 10
  • Node version: 18.12.0
  • NW.js version: 0.70.1
  • Repro link: Any osx build in Windows
@sysrage sysrage added the bug Priority: 1 label Nov 27, 2022
@sysrage
Copy link
Contributor Author

sysrage commented Nov 28, 2022

Since osx builds in Windows won't have proper file permissions anyway, maybe this should just be prevented altogether.

@ayushmanchhabra
Copy link
Collaborator

ayushmanchhabra commented Mar 1, 2023

I was able to reproduce this in v4.1.0-beta-3:

PS C:\Users\Ayush\Desktop\nw-builder> npm run demo:esm

> [email protected] demo:esm
> cd e2e && node demo.js

[ DEBUG ] 2023-03-01T20:19:06.318Z nwbuild property is not defined in package.json
./tmp
[ DEBUG ] 2023-03-01T20:19:06.326Z Manifest file already exists locally under C:\Users\Ayush\Desktop\nw-builder\e2e\tmp
[ DEBUG ] 2023-03-01T20:19:06.327Z Store manifest metadata in memory
[ DEBUG ] 2023-03-01T20:19:06.331Z Search for latest specific release data
[ DEBUG ] 2023-03-01T20:19:06.333Z Download relevant NW.js binaries
 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s | 158038700/158038700       
[ ERROR ] 2023-03-01T20:21:57.730Z ENOENT: no such file or directory, link 'C:\Users\Ayush\Desktop\nw-builder\e2e\Versions\Current\Resources' -> 'C:\Users\Ayush\Desktop\nw-builder\e2e\tmp\nwjs-sdk-v0.73.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'
[ ERROR ] 2023-03-01T20:21:57.730Z ENOENT: no such file or directory, link 'C:\Users\Ayush\Desktop\nw-builder\e2e\Versions\Current\Resources' -> 'C:\Users\Ayush\Desktop\nw-builder\e2e\tmp\nwjs-sdk-v0.73.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'
[ ERROR ] 2023-03-01T20:21:57.730Z ENOENT: no such file or directory, link 'C:\Users\Ayush\Desktop\nw-builder\e2e\Versions\Current\Resources' -> 'C:\Users\Ayush\Desktop\nw-builder\e2e\tmp\nwjs-sdk-v0.73.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'
[ ERROR ] 2023-03-01T20:21:57.730Z ENOENT: no such file or directory, link 'C:\Users\Ayush\Desktop\nw-builder\e2e\Versions\Current\Resources' -> 'C:\Users\Ayush\Desktop\nw-builder\e2e\tmp\nwjs-sdk-v0.73.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, link 'C:\Users\Ayush\Desktop\nw-builder\e2e\Versions\Current\Resources' -> 'C:\Users\Ayush\Desktop\nw-builder\e2e\tmp\nwjs-sdk-v0.73.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'] {     
  errno: -4058,
  code: 'ENOENT',
  [Symbol(message)]: "[ ERROR ] 2023-03-01T20:21:57.730Z ENOENT: no such file or directory, link 'C:\\Users\\Ayush\\Desktop\\nw-builder\\e2e\\Versions\\Current\\Resources' -> 'C:\\Users\\Ayush\\Desktop\\nw-builder\\e2e\\tmp\\nwjs-sdk-v0.73.0-osx-x64\\nwjs.app\\Contents\\Frameworks\\nwjs Framework.framework\\Resources'"
}

Related:
kevva/decompress#68

@ayushmanchhabra
Copy link
Collaborator

This should be fixed by #819 (comment)

@ayushmanchhabra
Copy link
Collaborator

Assuming this works now if glob is disabled? Tracking that in #836

@sysrage
Copy link
Contributor Author

sysrage commented Mar 30, 2023

No, this is not resolved. In fact, it's even worse now. Attempting to build for "osx" in Windows results in the following error:

[ ERROR ] 2023-03-30T21:11:57.290Z ENOENT: no such file or directory, link 'C:\Users\me\Documents\Code\nw-react-example\Versions\Current\Resources' -> 'C:\Users\me\Documents\Code\nw-react-example\cache\nwjs-v0.72.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'
[ ERROR ] 2023-03-30T21:11:57.290Z ENOENT: no such file or directory, link 'C:\Users\me\Documents\Code\nw-react-example\Versions\Current\Resources' -> 'C:\Users\me\Documents\Code\nw-react-example\cache\nwjs-v0.72.0-osx-x64\nwjs.app\Contents\Frameworks\nwjs Framework.framework\Resources'

Two issues:

  1. The first paths listed above are invalid: C:\Users\me\Documents\Code\nw-react-example\Versions\Current\Resources is missing outDir (which was specified as ./dist/${appName}-${appVersion}-${osType}/ and works perfectly for Windows builds but is completely ignored here.
  2. The outDir path (C:\Users\me\Documents\Code\nw-react-example\dist\nw-react-example-0.1.2-osx\) was created, but it is completely empty. None of NW.js was extracted/copied there.

@sysrage sysrage reopened this Mar 30, 2023
@sysrage
Copy link
Contributor Author

sysrage commented Mar 30, 2023

Probably just need to document that osx and linux builds need to happen in osx/linux. Otherwise, there will be all sorts of permission issues (missing +x) and other problems.

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

Successfully merging a pull request may close this issue.

2 participants