-
Notifications
You must be signed in to change notification settings - Fork 261
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: Include swiftshader directory when creating installer for Electron 10+ #375
fix: Include swiftshader directory when creating installer for Electron 10+ #375
Conversation
I believe #376 will allow the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
Can the fixtures be zero-sized like the others?
spec/installer-spec.ts
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'll take a stab at it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine now, I just have some suggestions about temporary directory naming.
spec/installer-spec.ts
Outdated
return process.platform !== 'win32' | ||
? spawn(process.arch === 'x64' ? 'wine64' : 'wine', [sevenZipPath, ...args]) | ||
: spawn(sevenZipPath, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.json
file. 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.