Skip to content

Commit 5ff16fe

Browse files
author
Marcin Mazurek
committed
Merge branch 'feat/ddw-1025-matomo-poc' into feat/ddw-809-implement-analytics-part-3
2 parents 97a168c + efeff61 commit 5ff16fe

File tree

31 files changed

+486
-237
lines changed

31 files changed

+486
-237
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,30 @@
44

55
### Fixes
66

7+
- Ensured non-recommended decimal place setting alert is correctly shown ([PR 3007](https://github.com/input-output-hk/daedalus/pull/3007))
8+
- Disabled the possibility to choose a syncing wallet for ITN rewards and delegation ([PR 3015](https://github.com/input-output-hk/daedalus/pull/3015))
9+
10+
### Chores
11+
12+
- Updated cardano-node to 1.35.2 ([PR 3021](https://github.com/input-output-hk/daedalus/pull/3021))
13+
- Fix `darwin-launcher.go` to replace its process image with `cardano-launcher` (binary), and not swallow `stdout` ([PR 3023](https://github.com/input-output-hk/daedalus/pull/3023))
14+
- Updated cardano-node to 1.35.1 ([PR 3012](https://github.com/input-output-hk/daedalus/pull/3012))
15+
16+
### Features
17+
18+
- Updated Terms of Service ([PR 3009](https://github.com/input-output-hk/daedalus/pull/3009))
19+
20+
## 4.12.0
21+
22+
### Fixes
23+
724
- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
825
- Fixed incorrect amount of token sent ([PR 2962](https://github.com/input-output-hk/daedalus/pull/2962))
926

1027
### Chores
1128

29+
- Made Windows installer more resilient w.r.t. auto-updates ([PR 3017](https://github.com/input-output-hk/daedalus/pull/3017))
30+
- Added OS-architecture tuple to installer file names to help with releases ([PR 3016](https://github.com/input-output-hk/daedalus/pull/3016))
1231
- Added Vasil-supported cardano-wallet ([PR 3001](https://github.com/input-output-hk/daedalus/pull/3001))
1332
- Upgraded webpack to version 5 ([PR 2772](https://github.com/input-output-hk/daedalus/pull/2772))
1433

default.nix

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,20 @@ let
7272
cardanoLib = localLib.iohkNix.cardanoLib;
7373
daedalus-bridge = self.bridgeTable.${nodeImplementation};
7474

75-
nodejs = pkgs.nodejs-16_x;
75+
nodejs = let
76+
njPath = pkgs.path + "/pkgs/development/web/nodejs";
77+
buildNodeJs = pkgs.callPackage (import (njPath + "/nodejs.nix")) {
78+
python = pkgs.python3;
79+
icu = pkgs.icu68; # can’t build against ICU 69: <https://chromium-review.googlesource.com/c/v8/v8/+/2477751>
80+
};
81+
in
82+
buildNodeJs {
83+
enableNpm = true;
84+
version = "14.17.0";
85+
sha256 = "1vf989canwcx0wdpngvkbz2x232yccp7fzs1vcbr60rijgzmpq2n";
86+
patches = pkgs.lib.optional pkgs.stdenv.isDarwin (njPath + "/bypass-xcodebuild.diff");
87+
};
88+
7689
nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
7790
yarnInfo = {
7891
version = "1.22.4";
@@ -302,7 +315,7 @@ let
302315
signed-windows-installer = let
303316
backend_version = self.daedalus-bridge.wallet-version;
304317
frontend_version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
305-
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}.exe"; # must match to packageFileName in make-installer
318+
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}-x86_64-windows.exe"; # must match to packageFileName in make-installer
306319
in pkgs.runCommand "signed-windows-installer-${cluster}" {} ''
307320
mkdir $out
308321
cp -v ${self.signFile "${self.unsigned-windows-installer}/${fullName}"} $out/${fullName}
@@ -419,7 +432,7 @@ let
419432
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
420433
backend = "cardano-wallet-${nodeImplementation}";
421434
suffix = if buildNum == null then "" else "-${toString buildNum}";
422-
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}.bin";
435+
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}-x86_64-linux.bin";
423436
in pkgs.runCommand fn {} ''
424437
mkdir -p $out
425438
cp ${self.newBundle} $out/${fn}

installers/common/Types.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import Turtle (pwd, cd)
4242
import Turtle.Format (format, fp)
4343
import Data.Aeson (FromJSON(..), withObject, eitherDecode, (.:), genericParseJSON, defaultOptions)
4444
import qualified Data.ByteString.Lazy.Char8 as L8
45+
import qualified System.Info
4546

4647
data OS
4748
= Linux64
@@ -113,7 +114,7 @@ packageFileName :: OS -> Cluster -> Version -> Backend -> Text -> Maybe BuildJob
113114
packageFileName _os cluster ver backend _backendVer build = fromText name <.> ext
114115
where
115116
name = T.intercalate "-" parts
116-
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build'
117+
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build' ++ [archOS]
117118
_backend' = case backend of
118119
Cardano _ -> "cardano-wallet"
119120
ext = case _os of
@@ -124,6 +125,13 @@ packageFileName _os cluster ver backend _backendVer build = fromText name <.> ex
124125
Win64 -> "windows"
125126
Macos64 -> "macos"
126127
Linux64 -> "linux"
128+
archOS = case _os of
129+
Win64 -> "x86_64-windows"
130+
Macos64 ->
131+
if System.Info.arch == "aarch64"
132+
then "aarch64-darwin"
133+
else "x86_64-darwin"
134+
Linux64 -> "x86_64-linux"
127135
build' = maybe [] (\b -> [fromBuildJob b]) build
128136

129137
instance FromJSON Version where

installers/common/WindowsInstaller.hs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import Development.NSIS (Attrib (IconFile, IconIndex, RebootOK, Recurs
2020
name, nsis, onPagePre, onError, outFile, page, readRegStr,
2121
requestExecutionLevel, rmdir, section, setOutPath, str,
2222
strLength, uninstall, unsafeInject, unsafeInjectGlobal,
23-
loadLanguage,
23+
loadLanguage, sleep, (@=), detailPrint, (%<), (%&&),
24+
not_, mutableInt_, mutable_, while, false, true, strShow, (&),
2425
writeRegDWORD, writeRegStr, (%/=), fileExists)
2526
import Prelude ((!!))
2627
import qualified System.IO as IO
@@ -185,9 +186,30 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
185186
createDirectory "$APPDATA\\$InstallDir\\Secrets-1.0"
186187
createDirectory "$APPDATA\\$InstallDir\\Logs"
187188
createDirectory "$APPDATA\\$InstallDir\\Logs\\pub"
188-
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $
189-
--abort "$SpacedName $(AlreadyRunning)"
190-
unsafeInject $ T.unpack $ "Abort \" " <> installDirectory <> "$(AlreadyRunning)\""
189+
190+
-- XXX: sometimes during auto-update, it takes longer for Daedalus to exit,
191+
-- and cardano-launcher.exe’s lockfile to be unlocked (deletable), so
192+
-- let’s loop waiting for this to happen:
193+
let waitSeconds = 30
194+
lockfileCounter <- mutableInt_ 0
195+
lockfileDeleted <- mutable_ false
196+
while ((lockfileCounter %< waitSeconds) %&& (not_ lockfileDeleted)) $ do
197+
detailPrint (
198+
"Checking if Daedalus is not running ("
199+
Development.NSIS.& strShow (lockfileCounter + 1)
200+
Development.NSIS.& "/"
201+
Development.NSIS.& strShow waitSeconds
202+
Development.NSIS.& ")..."
203+
)
204+
lockfileDeleted @= true
205+
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $ do
206+
lockfileDeleted @= false
207+
iff_ (not_ lockfileDeleted) $ do
208+
sleep 1000 -- milliseconds
209+
lockfileCounter @= lockfileCounter + 1
210+
iff_ (not_ (lockfileDeleted)) $ do
211+
unsafeInject $ T.unpack $ "Abort \"" <> installDirectory <> " $(AlreadyRunning)\""
212+
191213
iff_ (fileExists "$APPDATA\\$InstallDir\\Wallet-1.0\\open\\*.*") $
192214
rmdir [] "$APPDATA\\$InstallDir\\Wallet-1.0\\open"
193215
case oBackend of

installers/nix/electron.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{ stdenv, lib, makeWrapper, fetchurl, unzip, atomEnv, libuuid, at-spi2-atk, at_spi2_core, libxshmfence,
2-
libxkbcommon }:
2+
libxkbcommon, runCommand, binutils-unwrapped }:
33

44
let
5-
version = "13.6.3";
5+
version = (builtins.fromJSON (builtins.readFile ../../package.json)).dependencies.electron;
66
name = "electron-${version}";
77

88
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";

nix/darwin-launcher.go

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"os"
66
"os/exec"
77
"path/filepath"
8+
"syscall"
89
)
910

1011
func main() {
12+
fmt.Fprintf(os.Stderr, "darwin-launcher: PID = %d\n", os.Getpid())
13+
1114
ex, err := os.Executable()
1215
if err != nil {
1316
panic(err)
@@ -17,14 +20,23 @@ func main() {
1720

1821
os.Setenv("PATH", fmt.Sprintf("%s:%s", installDir, os.Getenv("PATH")))
1922

20-
launcherConfig := filepath.Join(installDir, "../Resources/launcher-config.yaml")
21-
helper := filepath.Join(installDir, "../Resources/helper")
22-
23+
launcherConfigPath := filepath.Join(installDir, "../Resources/launcher-config.yaml")
24+
helperPath := filepath.Join(installDir, "../Resources/helper")
2325

24-
if err = exec.Command(helper).Run(); err != nil {
26+
helperCmd := exec.Command(helperPath)
27+
helperCmd.Stdout = os.Stdout
28+
helperCmd.Stderr = os.Stderr
29+
if err := helperCmd.Run(); err != nil {
2530
panic(err)
2631
}
27-
if err = exec.Command("cardano-launcher", "--config", launcherConfig).Run(); err != nil {
28-
panic(err)
32+
33+
// Replace the current process (otherwise WDIO complains in end-to-end tests):
34+
img := filepath.Join(installDir, "cardano-launcher")
35+
argv := []string{"cardano-launcher", "--config", launcherConfigPath}
36+
env := os.Environ()
37+
if err := syscall.Exec(img, argv, env); err != nil {
38+
fmt.Println(err)
2939
}
40+
41+
fmt.Fprintf(os.Stderr, "this won’t happen\n")
3042
}

nix/sources.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"cardano-node": {
3-
"branch": "tags/1.35.0",
3+
"branch": "tags/1.35.2",
44
"description": null,
55
"homepage": null,
66
"owner": "input-output-hk",
77
"repo": "cardano-node",
8-
"rev": "9f1d7dc163ee66410d912e48509d6a2300cfa68a",
9-
"sha256": "06arx9hv7dn3qxfy83f0b6018rxbsvh841nvfyg5w6qclm1hddj7",
8+
"rev": "7612a245a6e2c51d0f1c3e0d65d7fe9363850043",
9+
"sha256": "01a5qdrmsag18s2mlf8axfbrag59j2fp6xyc89pwmzgs7x77ldsr",
1010
"type": "tarball",
11-
"url": "https://github.com/input-output-hk/cardano-node/archive/9f1d7dc163ee66410d912e48509d6a2300cfa68a.tar.gz",
11+
"url": "https://github.com/input-output-hk/cardano-node/archive/7612a245a6e2c51d0f1c3e0d65d7fe9363850043.tar.gz",
1212
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313
},
1414
"cardano-shell": {
@@ -24,15 +24,15 @@
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
},
2626
"cardano-wallet": {
27-
"branch": "v2022-07-01",
27+
"branch": "master",
2828
"description": "Official Wallet Backend & API for Cardano decentralized",
2929
"homepage": null,
3030
"owner": "input-output-hk",
3131
"repo": "cardano-wallet",
32-
"rev": "211c357a91d48b30fdf77a3a169499b38822f9cd",
33-
"sha256": "0ii631ak757kjzs7jm625zfv2g28ffjrfkmgslxbbgvwpqxkdbaj",
32+
"rev": "7ed8f067dd6d5dc78e7353bf65ea5e3423cdfca8",
33+
"sha256": "1f9lwqi4qghaqi3754732h0cz98f7qbjhcx416jliqy6nibly6lp",
3434
"type": "tarball",
35-
"url": "https://github.com/input-output-hk/cardano-wallet/archive/211c357a91d48b30fdf77a3a169499b38822f9cd.tar.gz",
35+
"url": "https://github.com/input-output-hk/cardano-wallet/archive/7ed8f067dd6d5dc78e7353bf65ea5e3423cdfca8.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
3838
"flake-compat": {

nix/yarn-nix-shell.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ if [ -z "$command" ] ; then
2929
fi
3030

3131
export NETWORK
32+
33+
# Prevent segfaults on Darwin in `GC_*` code:
34+
export GC_DONT_GC=1
35+
3236
# `return` will make the user stay in `nix-shell` after the initial command finishes:
3337
exec nix-shell --argstr nodeImplementation cardano --argstr cluster "$cluster" --command "$command ; return"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "daedalus",
33
"productName": "Daedalus",
4-
"version": "4.11.0",
4+
"version": "4.12.0",
55
"description": "Cryptocurrency Wallet",
66
"main": "./dist/main/index.js",
77
"scripts": {
@@ -13,7 +13,7 @@
1313
"build:main": "yarn webpack -c source/main/webpack.config.js --progress",
1414
"build:renderer": "yarn webpack -c source/renderer/webpack.config.js --progress",
1515
"build:cleanup": "rimraf ./dist",
16-
"build:electron": "electron-rebuild -w usb --useCache -s --debug",
16+
"build:electron": "electron-rebuild --useCache && electron-rebuild -w usb --useCache -s --debug",
1717
"check:all": "yarn prettier:check && yarn lint && yarn compile && yarn stylelint && yarn lockfile:check && yarn i18n:manage && yarn storybook:build",
1818
"start": "yarn electron ./",
1919
"start:dev": "nodemon --watch 'dist/main' --exec 'NODE_ENV=development yarn start'",

release.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ in {
6969
in {
7070
daedalus-installer = allArchesNoWindows;
7171
yaml2json = allArchesNoWindows;
72+
nodejs = allArchesNoWindows;
7273
bridgeTable = {
7374
cardano = allArches;
7475
};
7576
cardano-node = allArches;
76-
}))
77+
})) // {
78+
recurseForDerivations = {};
79+
}

0 commit comments

Comments
 (0)