Skip to content

Commit

Permalink
Merge #166: Update nixpkgs (stable 19.09 -> 20.03)
Browse files Browse the repository at this point in the history
b9f07bf test: use older qemu version for travis compatibility (Erik Arvstedt)
026a22f use python testing from stable nixpkgs (Erik Arvstedt)
45de0d4 Travis: test electrs with unstable nixpkgs as well (Jonas Nick)
2d3a1e8 electrs: fix conditional cargoSha256 (Erik Arvstedt)
f5dbac3 nixops: fix format exception from upstream nixops (Jonas Nick)
c03ad1c Update nixpkgs (stable 19.09 -> 20.03) (Jonas Nick)
b7047c7 HWI: allow building with unstable nixpkgs (Jonas Nick)

Pull request description:

ACKs for top commit:
  nixbitcoin:
    ACK b9f07bf

Tree-SHA512: 20766cdbe465d01b4d503e76741307a7fba403db575869c1f9cf401941b05d5afa7db735772ac235cf88a35b8e4ce49f888adfa5ee9891d4264b5ed570baaca9
  • Loading branch information
jonasnick committed May 4, 2020
2 parents 199b9bf + b9f07bf commit ca2834a
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
jobs:
- TestModules=1 STABLE=1
- PKG=hwi STABLE=1
- PKG=hwi STABLE=0
- PKG=lightning-charge STABLE=1
- PKG=lightning-charge STABLE=0
- PKG=nanopos STABLE=1
Expand All @@ -29,8 +30,7 @@ env:
- PKG=elementsd STABLE=1
- PKG=elementsd STABLE=0
- PKG=electrs STABLE=1
# broken
# - PKG=electrs STABLE=0
- PKG=electrs STABLE=0
- PKG=liquid-swap STABLE=1
- PKG=nixops19_09 STABLE=1
script:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/electrs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ llvmPackages.clang ];
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";

cargoSha256 = if pkgs ? cargo-vendor then
# nixpkgs ≤ 19.09
cargoSha256 = if builtins.pathExists "${pkgs.path}/pkgs/build-support/rust/fetchcargo.nix" then
# nixpkgs ≤ 20.03
"19qs8if8fmygv6j74s6iwzm534fybwasjvmzdqcl996xhg75w6gi"
else
# for recent nixpkgs with cargo-native vendoring (introduced in nixpkgs PR #69274)
Expand Down
15 changes: 10 additions & 5 deletions pkgs/hwi/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{ stdenv, fetchurl, fetchFromGitHub, python3 }:

with stdenv.lib;
with python3.pkgs;

let
buildInputs = [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ];
python = python3.override {
packageOverrides = self: super: {
# HWI requires mnemonic <0.19 but nixpkgs has a newer version
mnemonic = self.callPackage ./mnemonic {};
# HWI requires ecdsa <0.14 but nixpkgs has a newer version
ecdsa = self.callPackage ./ecdsa {};
};
};
in
buildPythonPackage rec {
python.pkgs.buildPythonPackage rec {
pname = "hwi";
version = "1.0.3";

Expand All @@ -20,8 +26,7 @@ buildPythonPackage rec {
# TODO: enable tests
doCheck = false;

inherit buildInputs;
propagatedBuildInputs = buildInputs;
propagatedBuildInputs = with python.pkgs; [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ];

meta = with lib; {
homepage = https://github.com/bitcoin-core/hwi;
Expand Down
28 changes: 28 additions & 0 deletions pkgs/hwi/ecdsa/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pkgs
, six
}:

buildPythonPackage rec {
pname = "ecdsa";
version = "0.13.3";

src = fetchPypi {
inherit pname version;
sha256 = "163c80b064a763ea733870feb96f9dd9b92216cfcacd374837af18e4e8ec3d4d";
};

propagatedBuildInputs = [ six ];
# Only needed for tests
checkInputs = [ pkgs.openssl ];

meta = with stdenv.lib; {
description = "ECDSA cryptographic signature library";
homepage = "https://github.com/warner/python-ecdsa";
license = licenses.mit;
maintainers = with maintainers; [ aszlig ];
};

}
20 changes: 20 additions & 0 deletions pkgs/hwi/mnemonic/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ lib, fetchPypi, buildPythonPackage, pbkdf2 }:

buildPythonPackage rec {
pname = "mnemonic";
version = "0.18";

src = fetchPypi {
inherit pname version;
sha256 = "02a7306a792370f4a0c106c2cf1ce5a0c84b9dbd7e71c6792fdb9ad88a727f1d";
};

propagatedBuildInputs = [ pbkdf2 ];

meta = {
description = "Implementation of Bitcoin BIP-0039";
homepage = "https://github.com/trezor/python-mnemonic";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ np ];
};
}
13 changes: 12 additions & 1 deletion pkgs/nixops/release.nix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
('destDir', 'string'),
('user', 'string'),
('group', 'string'),

--- a/nixops/ssh_util.py
+++ b/nixops/ssh_util.py
@@ -278,6 +278,7 @@ class SSH(object):
Expand All @@ -54,3 +53,15 @@
master = self.get_master(flags, timeout, user)
flags = flags + self._get_flags()
if logged:

--- a/nixops/deployment.py
+++ b/nixops/deployment.py
@@ -748,6 +748,6 @@
if res == 100 or force_reboot or m.state == m.RESCUE:
if not allow_reboot and not force_reboot:
raise Exception("the new configuration requires a "
- "reboot to take effect (hint: use "
+ "reboot of '{}' to take effect (hint: use "
"‘--allow-reboot’)".format(m.name))
m.reboot_sync()
res = 0
8 changes: 4 additions & 4 deletions pkgs/nixpkgs-pinned.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ in
{
# To update, run ../helper/fetch-channel REV
nixpkgs = fetch {
rev = "839cd8d03aa55f067e23a64097fc5b7d7e02f468";
sha256 = "1w0xklkk9lbwvrx02gng71pyf476h223098692pji5wg5l0sgm02";
rev = "95b9c99f6d091273572ff1ec62b97b6ad3f68bdf";
sha256 = "1qcwr9binkwfayix88aljwssxi5djkwscx0rnwlk1yp9q60rgp3d";
};
nixpkgs-unstable = fetch {
rev = "7c2fc1ce23a805f3220d867f528ceb9bd848d2e1";
sha256 = "1g562hlp5ha11a41daav9bnq86n4nmbm3xzhpzmma8c4jn4k2p8y";
rev = "22a3bf9fb9edad917fb6cd1066d58b5e426ee975";
sha256 = "089hqg2r2ar5piw9q5z3iv0qbmfjc4rl5wkx9z16aqnlras72zsa";
};
}
22 changes: 7 additions & 15 deletions test/make-test.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
testArgs:

let
stablePkgs = import <nixpkgs> { config = {}; overlays = []; };
unstable = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs-unstable;
pkgs = import <nixpkgs> { config = {}; overlays = []; };

# Stable nixpkgs doesn't yet include the Python testing framework.
# Use unstable nixpkgs and patch it so that it uses stable nixpkgs for the VM
# machine configuration.
testingPkgs =
stablePkgs.runCommand "nixpkgs-testing" {} ''
cp -r ${unstable} $out
cd $out
chmod +w -R .
patch -p1 < ${./use-stable-pkgs.patch}
'';
pkgs19_09 = import (pkgs.fetchzip {
url = "https://github.com/NixOS/nixpkgs-channels/archive/a7ceb2536ab11973c59750c4c48994e3064a75fa.tar.gz";
sha256 = "0hka65f31njqpq7i07l22z5rs7lkdfcl4pbqlmlsvnysb74ynyg1";
}) { config = {}; overlays = []; };

test = (import "${testingPkgs}/nixos/tests/make-test-python.nix") testArgs;
test = (import "${pkgs.path}/nixos/tests/make-test-python.nix") testArgs;

fixedTest = { system ? builtins.currentSystem, ... }@args:
let
pkgs = (import testingPkgs { inherit system; config = {}; overlays = []; } );
pkgsFixed = pkgs // {
# Fix the black Python code formatter that's used in the test to allow the test
# script to have longer lines. The default width of 88 chars is too restrictive for
Expand All @@ -35,7 +27,7 @@ let
# QEMU 4.20 from unstable fails on Travis build nodes with message
# "error: failed to set MSR 0x48b to 0x159ff00000000"
# Use version 4.0.1 instead.
inherit (stablePkgs) qemu_test;
inherit (pkgs19_09) qemu_test;
};
in
test (args // { pkgs = pkgsFixed; });
Expand Down
28 changes: 0 additions & 28 deletions test/use-stable-pkgs.patch

This file was deleted.

0 comments on commit ca2834a

Please sign in to comment.