Skip to content

Commit 0e21735

Browse files
committed
Merges develop
2 parents 94ed96e + e94535d commit 0e21735

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2076
-1161
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
"MOBX_DEV_TOOLS": true,
9090
"BUILD_NUMBER": true,
9191
"Process": true // TODO: remove after fix
92+
},
93+
"settings": {
94+
"import/resolver": "webpack"
9295
}
9396
}

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<PROJECT_ROOT>/state-cluster/.*
1616
<PROJECT_ROOT>/utils/js-launcher/.*
1717
<PROJECT_ROOT>/tests-report/.*
18+
<PROJECT_ROOT>/node_modules/.cache
1819

1920
[include]
2021

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,8 @@ utils/js-launcher/state
110110
# local development cluster
111111

112112
state-cluster
113+
Release
114+
Debug
115+
/cardano-cli
116+
/cardano-wallet
117+
.vscode

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changelog
99

1010
### Fixes
1111

12+
- Updated Electron and related packages ([PR 2206](https://github.com/input-output-hk/daedalus/pull/2206))
1213
- Fixed some Japanese translations for the external currencies ([PR 2667](https://github.com/input-output-hk/daedalus/pull/2667))
1314

1415
## 4.3.1

default.nix

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ let
5454
cardanoLib = localLib.iohkNix.cardanoLib;
5555
daedalus-bridge = self.bridgeTable.${nodeImplementation};
5656

57-
nodejs = pkgs.nodejs-12_x;
57+
nodejs = pkgs.nodejs-14_x;
58+
nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
5859
yarnInfo = {
5960
version = "1.22.4";
6061
hash = "1l3sv30g61dcn7ls213prcja2y3dqdi5apq9r7yyick295w25npq";
@@ -314,17 +315,7 @@ let
314315
source = builtins.filterSource localLib.cleanSourceFilter ./.;
315316
yaml2json = pkgs.haskell.lib.disableCabalFlag pkgs.haskellPackages.yaml "no-exe";
316317

317-
electron4 = pkgs.callPackage ./installers/nix/electron.nix {};
318-
electron8 = self.electron4.overrideAttrs (old: rec {
319-
name = "electron-${version}";
320-
version = "8.2.2";
321-
src = {
322-
x86_64-linux = pkgs.fetchurl {
323-
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
324-
sha256 = "0sk63i72kg7xixqgdkq4z80ia3ya9cyc15pak8shg4qi605jdnr7";
325-
};
326-
}.${pkgs.stdenv.hostPlatform.system} or throwSystem;
327-
});
318+
electron = pkgs.callPackage ./installers/nix/electron.nix {};
328319

329320
tests = {
330321
runFlow = self.callPackage ./tests/flow.nix {};

gulpfile.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,21 @@ gulp.task('server:start', (done) => {
8585
});
8686

8787
gulp.task('server:create:dev', (done) => {
88-
createElectronServer({ NODE_ENV: process.env.NODE_ENV || 'development' });
88+
createElectronServer({
89+
NODE_ENV: process.env.NODE_ENV,
90+
XCURSOR_PATH: '/usr/share/icons' || 'development',
91+
});
8992
done();
9093
});
9194

9295
gulp.task('server:create:debug', (done) => {
93-
createElectronServer({ NODE_ENV: process.env.NODE_ENV || 'development' }, [
94-
'--inspect',
95-
'--inspect-brk',
96-
]);
96+
createElectronServer(
97+
{
98+
NODE_ENV: process.env.NODE_ENV,
99+
XCURSOR_PATH: '/usr/share/icons' || 'development',
100+
},
101+
['--inspect', '--inspect-brk']
102+
);
97103
done();
98104
});
99105

installers/common/MacInstaller.hs

Lines changed: 79 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ KEYCHAIN="$2"
118118
REL_PATH="$3"
119119
XML_PATH="$4"
120120
ABS_PATH="$(pwd)/$REL_PATH"
121-
SIGN_CMD="codesign --verbose=4 --deep --strict --timestamp --options=runtime --entitlements $XML_PATH --sign \"$SIGN_ID\""
121+
TS="$(date +%Y-%m-%d_%H-%M-%S)"
122+
function sign_cmd() {
123+
codesign --verbose=4 --deep --strict --timestamp --options=runtime --entitlements $XML_PATH --sign "$SIGN_ID" "$1" 2>&1 | tee -a /tmp/codesign-output-${TS}.txt
124+
}
122125
VERIFY_CMD="codesign --verbose=4 --verify --deep --strict"
123126
ENTITLEMENT_CMD="codesign -d --entitlements :-"
124-
TS="$(date +%Y-%m-%d_%H-%M-%S)"
125127
LOG="2>&1 | tee -a /tmp/codesign-output-${TS}.txt"
126128

127129
# Remove symlinks pointing outside of the project build folder:
@@ -133,25 +135,26 @@ eval "security find-identity -v -p codesigning \"$KEYCHAIN\" $LOG"
133135
eval "security list-keychains -d user -s \"$KEYCHAIN\" $LOG"
134136

135137
# Sign framework executables not signed by the deep sign command:
136-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt\" $LOG"
137-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Resources/crashpad_handler\" $LOG"
138-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Libraries/libnode.dylib\" $LOG"
139-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Libraries/libffmpeg.dylib\" $LOG"
138+
sign_cmd "$ABS_PATH/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt"
139+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Resources/crashpad_handler"
140+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Libraries/libnode.dylib"
141+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/Current/Libraries/libffmpeg.dylib"
140142

141-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib\" $LOG"
142-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib\" $LOG"
143-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libEGL.dylib\" $LOG"
144-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libGLESv2.dylib\" $LOG"
143+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib"
144+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib"
145+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libEGL.dylib"
146+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libGLESv2.dylib"
147+
sign_cmd "$ABS_PATH/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libvk_swiftshader.dylib"
145148

146149
# Sign native electron bindings and supplementary binaries
147-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Resources/app/build/usb_bindings.node\" $LOG"
148-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Resources/app/build/HID.node\" $LOG"
149-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Resources/app/node_modules/keccak/bin/darwin-x64-76/keccak.node\" $LOG"
150-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Resources/app/node_modules/keccak/build/Release/addon.node\" $LOG"
151-
eval "$SIGN_CMD \"$ABS_PATH/Contents/Resources/app/node_modules/keccak/prebuilds/darwin-x64/node.napi.node\" $LOG"
150+
sign_cmd "$ABS_PATH/Contents/Resources/app/build/usb_bindings.node"
151+
sign_cmd "$ABS_PATH/Contents/Resources/app/build/HID.node"
152+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/bin/darwin-x64-"*"/keccak.node"
153+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/build/Release/addon.node"
154+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/prebuilds/darwin-x64/node.napi.node"
152155

153156
# Sign the whole component deeply
154-
eval "$SIGN_CMD \"$ABS_PATH\" $LOG"
157+
sign_cmd "$ABS_PATH"
155158

156159
# Verify the signing
157160
eval "$VERIFY_CMD \"$ABS_PATH\" $LOG"
@@ -229,60 +232,62 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
229232
externalYarn :: [FilePath]
230233
externalYarn =
231234
[ "@babel"
232-
, "regenerator-runtime"
233-
, "node-fetch"
234235
, "@trezor"
235-
, "runtypes"
236-
, "parse-uri"
237-
, "randombytes"
238-
, "safe-buffer"
236+
, "base-x"
237+
, "base64-js"
238+
, "bchaddrjs"
239+
, "big-integer"
240+
, "bigi"
241+
, "bignumber.js"
239242
, "bip66"
240-
, "pushdata-bitcoin"
241243
, "bitcoin-ops"
242-
, "typeforce"
243-
, "varuint-bitcoin"
244-
, "bigi"
245-
, "create-hash"
246-
, "merkle-lib"
247244
, "blake2b"
248-
, "nanoassert"
249245
, "blake2b-wasm"
250-
, "bs58check"
251246
, "bs58"
252-
, "base-x"
253-
, "create-hmac"
254-
, "ecurve"
255-
, "wif"
256-
, "ms"
257-
, "keccak"
258-
, "trezor-link"
259-
, "semver-compare"
260-
, "protobufjs-old-fixed-webpack"
247+
, "bs58check"
261248
, "bytebuffer-old-fixed-webpack"
262-
, "long"
263-
, "object.values"
249+
, "call-bind"
250+
, "cashaddrjs"
251+
, "cbor-web"
252+
, "create-hash"
253+
, "create-hmac"
254+
, "cross-fetch"
264255
, "define-properties"
265-
, "object-keys"
266-
, "has"
267-
, "function-bind"
256+
, "ecurve"
268257
, "es-abstract"
258+
, "function-bind"
259+
, "get-intrinsic"
260+
, "has"
269261
, "has-symbols"
270-
, "json-stable-stringify"
271-
, "tiny-worker"
272262
, "hd-wallet"
273-
, "cashaddrjs"
274-
, "big-integer"
275-
, "queue"
263+
, "ieee754"
276264
, "inherits"
277-
, "bchaddrjs"
278-
, "cross-fetch"
279-
, "trezor-connect"
280-
, "js-chain-libs-node"
281-
, "bignumber.js"
282265
, "int64-buffer"
283-
, "call-bind"
284-
, "get-intrinsic"
285-
, "cbor-web"
266+
, "js-chain-libs-node"
267+
, "json-stable-stringify"
268+
, "keccak"
269+
, "long"
270+
, "merkle-lib"
271+
, "ms"
272+
, "nanoassert"
273+
, "node-fetch"
274+
, "object-keys"
275+
, "object.values"
276+
, "parse-uri"
277+
, "protobufjs-old-fixed-webpack"
278+
, "pushdata-bitcoin"
279+
, "queue"
280+
, "randombytes"
281+
, "regenerator-runtime"
282+
, "runtypes"
283+
, "safe-buffer"
284+
, "semver-compare"
285+
, "tiny-worker"
286+
, "trezor-connect"
287+
, "trezor-link"
288+
, "typeforce"
289+
, "varuint-bitcoin"
290+
, "wif"
286291
]
287292
mapM_ (\lib -> do
288293
cptree ("../node_modules" </> lib) ((fromText pathtoapp) </> "Contents/Resources/app/node_modules" </> lib)
@@ -309,7 +314,9 @@ getBackendVersion (Cardano bridge) = readCardanoVersionFile bridge
309314

310315
makeComponentRoot :: Options -> FilePath -> DarwinConfig -> InstallerConfig -> IO ()
311316
makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{dcAppName} InstallerConfig{} = do
312-
let dir = appRoot </> "Contents/MacOS"
317+
let
318+
dir :: FilePath
319+
dir = appRoot </> "Contents/MacOS"
313320
dataDir = appRoot </> "Contents/Resources"
314321

315322
echo "Preparing files ..."
@@ -341,6 +348,20 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
341348

342349
-- Rewrite libs paths and bundle them
343350
void $ chain (encodeString dir) $ fmap tt [dir </> "cardano-launcher", dir </> "cardano-wallet", dir </> "cardano-node", dir </> "cardano-cli", dir </> "cardano-address" ]
351+
let
352+
sortaMove :: FilePath -> IO ()
353+
sortaMove filename = do
354+
mv (appRoot </> "Contents/Resources/app/build" </> filename) (dir</>filename)
355+
symlink ("../../../MacOS" </> filename) (appRoot </> "Contents/Resources/app/build" </> filename)
356+
mapM_ sortaMove [ "usb_bindings.node" ]
357+
void $ chain (encodeString dir) [ tt $ dir </> "usb_bindings.node" ]
358+
let
359+
sortaMove :: FilePath -> IO ()
360+
sortaMove filename = do
361+
mv (appRoot </> "Contents/Resources/app/build" </> filename) (dir</>filename)
362+
symlink ("../../../MacOS" </> filename) (appRoot </> "Contents/Resources/app/build" </> filename)
363+
mapM_ sortaMove [ "HID.node" ]
364+
void $ chain (encodeString dir) [ tt $ dir </> "HID.node" ]
344365

345366
-- Prepare launcher
346367
de <- testdir (dir </> "Frontend")

installers/nix/electron.nix

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
{ stdenv, libXScrnSaver, makeWrapper, fetchurl, unzip, atomEnv, libuuid, at-spi2-atk, at_spi2_core }:
1+
{ stdenv, libXScrnSaver, makeWrapper, fetchurl, unzip, atomEnv, libuuid, at-spi2-atk, at_spi2_core, libxshmfence,
2+
libdrm, libxkbcommon, mesa }:
23

34
let
4-
version = "4.0.0";
5+
version = "13.1.0";
56
name = "electron-${version}";
67

78
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
@@ -20,19 +21,19 @@ let
2021
src = {
2122
i686-linux = fetchurl {
2223
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-ia32.zip";
23-
sha256 = "0yv2f7yf6ingjysswpnpnvqsjkdkp2rd4laawhziifzbfjda4yws";
24+
sha256 = "e4d8cc19689b1f9c00894bb776083f8543abeba9203d3297268c1644f1300355";
2425
};
2526
x86_64-linux = fetchurl {
2627
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
27-
sha256 = "1kh2jds7jra9f1vcn2z1193cxcyvfxkldim4b9ij7chj9xzxwgln";
28+
sha256 = "6681078971d2e99e9f8b3c598de65869d3596356af901bbbabcc4860c0496bb4";
2829
};
2930
armv7l-linux = fetchurl {
3031
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-armv7l.zip";
31-
sha256 = "1v492qfdgnj3fks2hrfc9lmsx5a5xk957rvismlpc2mjkjrwx2dq";
32+
sha256 = "ac5a19e31fd83db5775a2af57f742c7b3e5fc4528958329ec3c81f82e7bd611a";
3233
};
3334
aarch64-linux = fetchurl {
3435
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-arm64.zip";
35-
sha256 = "18vpqif5grvhrkx6h64yzw1pf9013811gzq2qxaj8pzr6lck3irf";
36+
sha256 = "0ed0cc3afae5cc7e1e6c6204866a1cecdf97e0ab658789e8951842bd0d28e1bb";
3637
};
3738
}.${stdenv.hostPlatform.system} or throwSystem;
3839

@@ -51,17 +52,27 @@ let
5152
$out/lib/electron/electron
5253
5354
wrapProgram $out/lib/electron/electron \
54-
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1
55+
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
56+
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libdrm ]}/libdrm.so.2 \
57+
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libxkbcommon ]}/libxkbcommon.so.0 \
58+
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ mesa ]}/libgbm.so.1 \
59+
--prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libxshmfence ]}/libxshmfence.so.1
5560
'';
5661
};
5762

5863
darwin = {
5964
inherit name version meta;
6065

61-
src = fetchurl {
62-
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-x64.zip";
63-
sha256 = "08n3xzgncb2hf645zn8b0rb1izq9pqh3726hf2g4nvrgfllivlg1";
64-
};
66+
src = {
67+
x86_64-darwin = fetchurl {
68+
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-x64.zip";
69+
sha256 = "d62a561e80fcbcb0f249e74c487313192451046f288478add65be997793831de";
70+
};
71+
aarch64-darwin = fetchurl {
72+
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-arm64.zip";
73+
sha256 = "6da46d2861011263af2953a3e0186735e54708c01c50967ff5f8ed71b73f7fea";
74+
};
75+
}.${stdenv.hostPlatform.system} or throwSystem;
6576

6677
buildInputs = [ unzip ];
6778

installers/nix/linux.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, runCommand, writeText, writeScriptBin, electron8
1+
{ stdenv, runCommand, writeText, writeScriptBin, electron
22
, coreutils, utillinux, procps, cluster
33
, rawapp, daedalus-bridge, daedalus-installer
44
, sandboxed ? false
@@ -28,7 +28,7 @@ let
2828
2929
cd "''${DAEDALUS_DIR}/${cluster}/"
3030
31-
exec ${electron8}/bin/electron --disable-setuid-sandbox --no-sandbox ${rawapp}/share/daedalus "$@"
31+
exec ${electron}/bin/electron --disable-setuid-sandbox --no-sandbox ${rawapp}/share/daedalus "$@"
3232
'';
3333
daedalus = writeScriptBin "daedalus" ''
3434
#!${stdenv.shell}
@@ -49,6 +49,7 @@ let
4949
mkdir -p "''${DAEDALUS_DIR}/${cluster}/"{Logs/pub,Secrets}
5050
cd "''${DAEDALUS_DIR}/${cluster}/"
5151
52+
export XCURSOR_PATH="/usr/share/icons"
5253
exec ${daedalus-bridge}/bin/cardano-launcher \
5354
--config ${if sandboxed then "/nix/var/nix/profiles/profile-${linuxClusterBinName}/etc/launcher-config.yaml" else "${daedalus-config}/launcher-config.yaml"}
5455
'';

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
environment = { YARN_VERSION = "1.22.4", NODE_VERSION = "12.19.0" }
2+
environment = { YARN_VERSION = "1.22.4", NODE_VERSION = "14.17.0" }

0 commit comments

Comments
 (0)