Skip to content

Commit

Permalink
fix: patch fs-extra to fix images on arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Sep 25, 2024
1 parent 01be45d commit 43c7f07
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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

0 comments on commit 43c7f07

Please sign in to comment.