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

fix: patch fs-extra to fix images on arm64 #318

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions snap/patches/fs-extra+5.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/node_modules/fs-extra/lib/ensure/file.js b/node_modules/fs-extra/lib/ensure/file.js
index 67eed30..7b115a2 100644
--- a/node_modules/fs-extra/lib/ensure/file.js
+++ b/node_modules/fs-extra/lib/ensure/file.js
@@ -8,8 +8,14 @@ const pathExists = require('../path-exists').pathExists

function createFile (file, callback) {
function makeFile () {
+ console.log(`Going to create empty file/dir ${file}`)
fs.writeFile(file, '', err => {
- if (err) return callback(err)
+ if (err && process.platform === 'linux' && process.arch === 'arm64') {
+ console.log(`Error while creating empty file, ignoring: ${err}`)
+ } else if (err) {
+ console.log(err)
+ return callback(err)
+ }
callback()
})
}
4 changes: 4 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ parts:
npm run build
popd
# Add a patch that fixes the rendering of images on arm64 builds.
# See: https://github.com/snapcrafters/signal-desktop/issues/279#issuecomment-2372021170
cp $CRAFT_PROJECT_DIR/snap/patches/fs-extra+5.0.0.patch patches/fs-extra+5.0.0.patch
# Install the dependencies for the Signal-Desktop application.
npm install --legacy-peer-deps
Expand Down
Loading