fix: Include swiftshader directory when creating installer for Electron 10+#375
Conversation
|
I believe #376 will allow the |
malept
left a comment
There was a problem hiding this comment.
Thanks for working on this.
Can the fixtures be zero-sized like the others?
|
|
||
| log('Verifying contents of .nupkg'); | ||
| const sevenZipPath = path.join(__dirname, '..', 'vendor', '7z.exe'); | ||
| let cmd = sevenZipPath; | ||
| const args = ['l', nupkgPath]; | ||
|
|
||
| if (process.platform !== 'win32') { | ||
| args.unshift(cmd); | ||
| const wineExe = process.arch === 'x64' ? 'wine64' : 'wine'; | ||
| cmd = wineExe; | ||
| } | ||
|
|
||
| const packageContents = await spawn(cmd, args); | ||
| t.true(packageContents.includes('lib\\net45\\vk_swiftshader_icd.json')); | ||
| t.true(packageContents.includes('lib\\net45\\swiftshader\\libEGL.dll')); |
There was a problem hiding this comment.
It would be nice if there was a test that didn't add the swiftshader files as well, to prevent regressions.
There was a problem hiding this comment.
Agreed, I'll take a stab at it!
There was a problem hiding this comment.
I encountered an issue where the two tests caused a race condition trying to delete the Squirrel.exe file in the beforeEach so I tweaked the approach to always copying the fixture app directory to a temporary location before packaging.
I just copied one of other binary fixtures here which I guess wasn't zero sized. Looking at the fixtures directory there seems to be a mix of empty files and binary-like files. I'll empty them tho! |
malept
left a comment
There was a problem hiding this comment.
This looks fine now, I just have some suggestions about temporary directory naming.
| return process.platform !== 'win32' | ||
| ? spawn(process.arch === 'x64' ? 'wine64' : 'wine', [sevenZipPath, ...args]) | ||
| : spawn(sevenZipPath, args); |
There was a problem hiding this comment.
Normally I'd ask to refactor this to look a bit more like how it's done elsewhere in the module (I do not agree with multi-line ternary statements), but I have a PR to drastically refactor how spawn works in #373 so it's kind of a moot point.
There was a problem hiding this comment.
Sorry, I tried to stay true to the current coding style but old habits die hard, I'll extract the wine binary name into a variable.
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
|
Hi @malept! Did you have a chance to take a look at @niik's changes? This PR is blocking desktop/desktop#11142, so please let me know if there is anything I can do to help getting this merged! 🙏 Thank you! ❤️ |
malept
left a comment
There was a problem hiding this comment.
Thanks for your patience, this will go out in a new release shortly.
|
🎉 This PR is included in version 4.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is a continuation of #367 with the intention of including the swiftshader directory (present in Electron 10+) as well as the
vk_swiftshader_icd.jsonfile. These paths are required in order for electron to be able to run on systems where GPU acceleration is unavailable.See #367 (comment):
@malept Is the approach taken here in line with what you'd expect?
Closes #367.