Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat/ddw-809-imple…
Browse files Browse the repository at this point in the history
…ment-analytics-remaining-tracking
  • Loading branch information
Marcin Mazurek committed Aug 2, 2022
2 parents 3965f3f + af8e56a commit 61923c8
Show file tree
Hide file tree
Showing 32 changed files with 553 additions and 240 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,11 +4,29 @@

### Fixes

- Ensured non-recommended decimal place setting alert is correctly shown ([PR 3007](https://github.com/input-output-hk/daedalus/pull/3007))
- Disabled the possibility to choose a syncing wallet for ITN rewards and delegation ([PR 3015](https://github.com/input-output-hk/daedalus/pull/3015))

### Chores

- 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))
- Updated cardano-node to 1.35.1 ([PR 3012](https://github.com/input-output-hk/daedalus/pull/3012))

### Features

- Updated Terms of Service ([PR 3009](https://github.com/input-output-hk/daedalus/pull/3009))

## 4.12.0

### Fixes

- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
- Fixed incorrect amount of token sent ([PR 2962](https://github.com/input-output-hk/daedalus/pull/2962))

### Chores

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

Expand Down
27 changes: 24 additions & 3 deletions default.nix
Expand Up @@ -37,6 +37,14 @@ let
chmod -R +w $out
cd $out
patch -p1 -i ${./nix/cardano-wallet--enable-aarch64-darwin.patch}
patch -p1 -i ${builtins.path {
# XXX: unfortunately, GitHub changed lengths of hashes in patches it returns for PRs,
# that’s why we’re providing this patch inside our repo, with the same exact SHA-256,
# to the one released in 4.12.0:
path = ./nix/cardano-wallet--pr-3382--ledger-bug.patch;
recursive = false;
sha256 = "1ii12g2zikv4197c7bsh4v5dc1jzygn1jap8xvnr7mvh3a09pdgn";
}}
'';
};
haskellNix = import sources."haskell.nix" {};
Expand Down Expand Up @@ -72,7 +80,20 @@ let
cardanoLib = localLib.iohkNix.cardanoLib;
daedalus-bridge = self.bridgeTable.${nodeImplementation};

nodejs = pkgs.nodejs-16_x;
nodejs = let
njPath = pkgs.path + "/pkgs/development/web/nodejs";
buildNodeJs = pkgs.callPackage (import (njPath + "/nodejs.nix")) {
python = pkgs.python3;
icu = pkgs.icu68; # can’t build against ICU 69: <https://chromium-review.googlesource.com/c/v8/v8/+/2477751>
};
in
buildNodeJs {
enableNpm = true;
version = "14.17.0";
sha256 = "1vf989canwcx0wdpngvkbz2x232yccp7fzs1vcbr60rijgzmpq2n";
patches = pkgs.lib.optional pkgs.stdenv.isDarwin (njPath + "/bypass-xcodebuild.diff");
};

nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
yarnInfo = {
version = "1.22.4";
Expand Down Expand Up @@ -302,7 +323,7 @@ let
signed-windows-installer = let
backend_version = self.daedalus-bridge.wallet-version;
frontend_version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}.exe"; # must match to packageFileName in make-installer
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}-x86_64-windows.exe"; # must match to packageFileName in make-installer
in pkgs.runCommand "signed-windows-installer-${cluster}" {} ''
mkdir $out
cp -v ${self.signFile "${self.unsigned-windows-installer}/${fullName}"} $out/${fullName}
Expand Down Expand Up @@ -419,7 +440,7 @@ let
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
backend = "cardano-wallet-${nodeImplementation}";
suffix = if buildNum == null then "" else "-${toString buildNum}";
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}.bin";
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}-x86_64-linux.bin";
in pkgs.runCommand fn {} ''
mkdir -p $out
cp ${self.newBundle} $out/${fn}
Expand Down
10 changes: 9 additions & 1 deletion installers/common/Types.hs
Expand Up @@ -42,6 +42,7 @@ import Turtle (pwd, cd)
import Turtle.Format (format, fp)
import Data.Aeson (FromJSON(..), withObject, eitherDecode, (.:), genericParseJSON, defaultOptions)
import qualified Data.ByteString.Lazy.Char8 as L8
import qualified System.Info

data OS
= Linux64
Expand Down Expand Up @@ -113,7 +114,7 @@ packageFileName :: OS -> Cluster -> Version -> Backend -> Text -> Maybe BuildJob
packageFileName _os cluster ver backend _backendVer build = fromText name <.> ext
where
name = T.intercalate "-" parts
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build'
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build' ++ [archOS]
_backend' = case backend of
Cardano _ -> "cardano-wallet"
ext = case _os of
Expand All @@ -124,6 +125,13 @@ packageFileName _os cluster ver backend _backendVer build = fromText name <.> ex
Win64 -> "windows"
Macos64 -> "macos"
Linux64 -> "linux"
archOS = case _os of
Win64 -> "x86_64-windows"
Macos64 ->
if System.Info.arch == "aarch64"
then "aarch64-darwin"
else "x86_64-darwin"
Linux64 -> "x86_64-linux"
build' = maybe [] (\b -> [fromBuildJob b]) build

instance FromJSON Version where
Expand Down
30 changes: 26 additions & 4 deletions installers/common/WindowsInstaller.hs
Expand Up @@ -20,7 +20,8 @@ import Development.NSIS (Attrib (IconFile, IconIndex, RebootOK, Recurs
name, nsis, onPagePre, onError, outFile, page, readRegStr,
requestExecutionLevel, rmdir, section, setOutPath, str,
strLength, uninstall, unsafeInject, unsafeInjectGlobal,
loadLanguage,
loadLanguage, sleep, (@=), detailPrint, (%<), (%&&),
not_, mutableInt_, mutable_, while, false, true, strShow, (&),
writeRegDWORD, writeRegStr, (%/=), fileExists)
import Prelude ((!!))
import qualified System.IO as IO
Expand Down Expand Up @@ -185,9 +186,30 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
createDirectory "$APPDATA\\$InstallDir\\Secrets-1.0"
createDirectory "$APPDATA\\$InstallDir\\Logs"
createDirectory "$APPDATA\\$InstallDir\\Logs\\pub"
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $
--abort "$SpacedName $(AlreadyRunning)"
unsafeInject $ T.unpack $ "Abort \" " <> installDirectory <> "$(AlreadyRunning)\""

-- XXX: sometimes during auto-update, it takes longer for Daedalus to exit,
-- and cardano-launcher.exe’s lockfile to be unlocked (deletable), so
-- let’s loop waiting for this to happen:
let waitSeconds = 30
lockfileCounter <- mutableInt_ 0
lockfileDeleted <- mutable_ false
while ((lockfileCounter %< waitSeconds) %&& (not_ lockfileDeleted)) $ do
detailPrint (
"Checking if Daedalus is not running ("
Development.NSIS.& strShow (lockfileCounter + 1)
Development.NSIS.& "/"
Development.NSIS.& strShow waitSeconds
Development.NSIS.& ")..."
)
lockfileDeleted @= true
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $ do
lockfileDeleted @= false
iff_ (not_ lockfileDeleted) $ do
sleep 1000 -- milliseconds
lockfileCounter @= lockfileCounter + 1
iff_ (not_ (lockfileDeleted)) $ do
unsafeInject $ T.unpack $ "Abort \"" <> installDirectory <> " $(AlreadyRunning)\""

iff_ (fileExists "$APPDATA\\$InstallDir\\Wallet-1.0\\open\\*.*") $
rmdir [] "$APPDATA\\$InstallDir\\Wallet-1.0\\open"
case oBackend of
Expand Down
4 changes: 2 additions & 2 deletions installers/nix/electron.nix
@@ -1,8 +1,8 @@
{ stdenv, lib, makeWrapper, fetchurl, unzip, atomEnv, libuuid, at-spi2-atk, at_spi2_core, libxshmfence,
libxkbcommon }:
libxkbcommon, runCommand, binutils-unwrapped }:

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

throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
Expand Down
63 changes: 63 additions & 0 deletions nix/cardano-wallet--pr-3382--ledger-bug.patch
@@ -0,0 +1,63 @@
From 3f0186bdc9231b0bc3523294d4b6ead52b0e1419 Mon Sep 17 00:00:00 2001
From: Samuel Evans-Powell <mail@sevanspowell.net>
Date: Mon, 11 Jul 2022 10:14:31 +0800
Subject: [PATCH 1/2] Bump to cardano-node 1.35.1

---
cabal.project | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cabal.project b/cabal.project
index 40f1ec8899..9eb3a27fd4 100644
--- a/cabal.project
+++ b/cabal.project
@@ -213,8 +213,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
- tag: 9f1d7dc163ee66410d912e48509d6a2300cfa68a
- --sha256: 06arx9hv7dn3qxfy83f0b6018rxbsvh841nvfyg5w6qclm1hddj7
+ tag: c75451f0ffd7a60b5ad6c4263891e6c8acac105a
+ --sha256: 1z0zv1i58ikmbqg878f9z573jkwp4lzhmmswshm6c96rq6lprzh8
subdir:
cardano-api
cardano-git-rev

From a4d31a3e3d4dbd3b713dff5d911edd3869a3b343 Mon Sep 17 00:00:00 2001
From: Samuel Evans-Powell <mail@sevanspowell.net>
Date: Mon, 11 Jul 2022 10:21:02 +0800
Subject: [PATCH 2/2] Bump version of cardano-node in compatibility matrix

---
README.md | 2 +-
cabal.project | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index d10239eec3..b0c8c7ceec 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,7 @@ See **Installation Instructions** for each available [release](https://github.co
>
> | cardano-wallet | cardano-node (compatible versions) | SMASH (compatible versions)
> | --- | --- | ---
-> | `master` branch | [1.35.0](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.0) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
+> | `master` branch | [1.35.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
> | [v2022-07-01](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-07-01) | [1.35.0](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.0) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
> | [v2022-05-27](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-05-27) | [1.34.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.34.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
> | [v2022-04-27](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-04-27) | [1.34.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.34.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
diff --git a/cabal.project b/cabal.project
index 9eb3a27fd4..c83a3e282c 100644
--- a/cabal.project
+++ b/cabal.project
@@ -183,8 +183,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
- tag: ce3057e0863304ccb3f79d78c77136219dc786c6
- --sha256: 19ijcy1sl1iqa7diy5nsydnjsn3281kp75i2i42qv0fpn58238s9
+ tag: 3be8a19083fc13d9261b1640e27dd389b51bb08e
+ --sha256: 0dvm9l43mp1i34bcywmznd0660hhcfxwgawypk9q1hjkml1i41z3
subdir:
eras/alonzo/impl
eras/alonzo/test-suite
24 changes: 18 additions & 6 deletions nix/darwin-launcher.go
Expand Up @@ -5,9 +5,12 @@ import (
"os"
"os/exec"
"path/filepath"
"syscall"
)

func main() {
fmt.Fprintf(os.Stderr, "darwin-launcher: PID = %d\n", os.Getpid())

ex, err := os.Executable()
if err != nil {
panic(err)
Expand All @@ -17,14 +20,23 @@ func main() {

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

launcherConfig := filepath.Join(installDir, "../Resources/launcher-config.yaml")
helper := filepath.Join(installDir, "../Resources/helper")

launcherConfigPath := filepath.Join(installDir, "../Resources/launcher-config.yaml")
helperPath := filepath.Join(installDir, "../Resources/helper")

if err = exec.Command(helper).Run(); err != nil {
helperCmd := exec.Command(helperPath)
helperCmd.Stdout = os.Stdout
helperCmd.Stderr = os.Stderr
if err := helperCmd.Run(); err != nil {
panic(err)
}
if err = exec.Command("cardano-launcher", "--config", launcherConfig).Run(); err != nil {
panic(err)

// Replace the current process (otherwise WDIO complains in end-to-end tests):
img := filepath.Join(installDir, "cardano-launcher")
argv := []string{"cardano-launcher", "--config", launcherConfigPath}
env := os.Environ()
if err := syscall.Exec(img, argv, env); err != nil {
fmt.Println(err)
}

fmt.Fprintf(os.Stderr, "this won’t happen\n")
}
8 changes: 4 additions & 4 deletions nix/sources.json
@@ -1,14 +1,14 @@
{
"cardano-node": {
"branch": "tags/1.35.0",
"branch": "tags/1.35.1",
"description": null,
"homepage": null,
"owner": "input-output-hk",
"repo": "cardano-node",
"rev": "9f1d7dc163ee66410d912e48509d6a2300cfa68a",
"sha256": "06arx9hv7dn3qxfy83f0b6018rxbsvh841nvfyg5w6qclm1hddj7",
"rev": "c75451f0ffd7a60b5ad6c4263891e6c8acac105a",
"sha256": "1z0zv1i58ikmbqg878f9z573jkwp4lzhmmswshm6c96rq6lprzh8",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-node/archive/9f1d7dc163ee66410d912e48509d6a2300cfa68a.tar.gz",
"url": "https://github.com/input-output-hk/cardano-node/archive/c75451f0ffd7a60b5ad6c4263891e6c8acac105a.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cardano-shell": {
Expand Down
4 changes: 4 additions & 0 deletions nix/yarn-nix-shell.sh
Expand Up @@ -29,5 +29,9 @@ if [ -z "$command" ] ; then
fi

export NETWORK

# Prevent segfaults on Darwin in `GC_*` code:
export GC_DONT_GC=1

# `return` will make the user stay in `nix-shell` after the initial command finishes:
exec nix-shell --argstr nodeImplementation cardano --argstr cluster "$cluster" --command "$command ; return"
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "4.11.0",
"version": "4.12.0",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"build:main": "yarn webpack -c source/main/webpack.config.js --progress",
"build:renderer": "yarn webpack -c source/renderer/webpack.config.js --progress",
"build:cleanup": "rimraf ./dist",
"build:electron": "electron-rebuild -w usb --useCache -s --debug",
"build:electron": "electron-rebuild --useCache && electron-rebuild -w usb --useCache -s --debug",
"check:all": "yarn prettier:check && yarn lint && yarn compile && yarn stylelint && yarn lockfile:check && yarn i18n:manage && yarn storybook:build",
"start": "yarn electron ./",
"start:dev": "nodemon --watch 'dist/main' --exec 'NODE_ENV=development yarn start'",
Expand Down
5 changes: 4 additions & 1 deletion release.nix
Expand Up @@ -69,8 +69,11 @@ in {
in {
daedalus-installer = allArchesNoWindows;
yaml2json = allArchesNoWindows;
nodejs = allArchesNoWindows;
bridgeTable = {
cardano = allArches;
};
cardano-node = allArches;
}))
})) // {
recurseForDerivations = {};
}
5 changes: 5 additions & 0 deletions scripts/postinstall.sh
Expand Up @@ -2,4 +2,9 @@

if [[ "$CI" != "true" ]]; then
yarn lockfile:fix

# Let’s patch electron-rebuild to force correct Node.js headers to
# build native modules against even in `nix-shell`, otherwise, it
# doesn’t work reliably.
eval "$(nix-build -A rawapp.patchElectronRebuild)"
fi

0 comments on commit 61923c8

Please sign in to comment.