Merge master into staging-next

This commit is contained in:
github-actions[bot] 2021-12-02 00:01:31 +00:00 committed by GitHub
commit 4746376a5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 90 additions and 66 deletions

View File

@ -17,30 +17,26 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo 'PR_DIFF<<EOF' >> $GITHUB_ENV
gh api \
repos/NixOS/nixpkgs/pulls/${{github.event.number}}/files --paginate \
| jq '.[] | select(.status != "removed") | .filename' \
>> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
> "$HOME/changed_files"
- name: print list of changed files
run: |
cat "$HOME/changed_files"
- uses: actions/checkout@v2
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
if: env.PR_DIFF
- uses: cachix/install-nix-action@v16
if: env.PR_DIFF
with:
# nixpkgs commit is pinned so that it doesn't break
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/f93ecc4f6bc60414d8b73dbdf615ceb6a2c604df.tar.gz
- name: install editorconfig-checker
run: nix-env -iA editorconfig-checker -f '<nixpkgs>'
if: env.PR_DIFF
- name: Checking EditorConfig
if: env.PR_DIFF
run: |
echo "$PR_DIFF" | xargs editorconfig-checker -disable-indent-size
cat "$HOME/changed_files" | xargs -r editorconfig-checker -disable-indent-size
- if: ${{ failure() }}
run: |
echo "::error :: Hey! It looks like your changes don't follow our editorconfig settings. Read https://editorconfig.org/#download to configure your editor so you never see this error again."

View File

@ -597,9 +597,14 @@ class Machine:
break
return "".join(output_buffer)
def execute(self, command: str, check_return: bool = True) -> Tuple[int, str]:
def execute(
self, command: str, check_return: bool = True, timeout: Optional[int] = 900
) -> Tuple[int, str]:
self.connect()
if timeout is not None:
command = "timeout {} sh -c {}".format(timeout, shlex.quote(command))
out_command = f"( set -euo pipefail; {command} ) | (base64 --wrap 0; echo)\n"
assert self.shell
self.shell.send(out_command.encode())
@ -629,12 +634,12 @@ class Machine:
pass_fds=[self.shell.fileno()],
)
def succeed(self, *commands: str) -> str:
def succeed(self, *commands: str, timeout: Optional[int] = None) -> str:
"""Execute each command and check that it succeeds."""
output = ""
for command in commands:
with self.nested("must succeed: {}".format(command)):
(status, out) = self.execute(command)
(status, out) = self.execute(command, timeout=timeout)
if status != 0:
self.log("output: {}".format(out))
raise Exception(
@ -643,12 +648,12 @@ class Machine:
output += out
return output
def fail(self, *commands: str) -> str:
def fail(self, *commands: str, timeout: Optional[int] = None) -> str:
"""Execute each command and check that it fails."""
output = ""
for command in commands:
with self.nested("must fail: {}".format(command)):
(status, out) = self.execute(command)
(status, out) = self.execute(command, timeout=timeout)
if status == 0:
raise Exception(
"command `{}` unexpectedly succeeded".format(command)
@ -664,14 +669,14 @@ class Machine:
def check_success(_: Any) -> bool:
nonlocal output
status, output = self.execute(command)
status, output = self.execute(command, timeout=timeout)
return status == 0
with self.nested("waiting for success: {}".format(command)):
retry(check_success, timeout)
return output
def wait_until_fails(self, command: str) -> str:
def wait_until_fails(self, command: str, timeout: int = 900) -> str:
"""Wait until a command returns failure.
Throws an exception on timeout.
"""
@ -679,7 +684,7 @@ class Machine:
def check_failure(_: Any) -> bool:
nonlocal output
status, output = self.execute(command)
status, output = self.execute(command, timeout=timeout)
return status != 0
with self.nested("waiting for failure: {}".format(command)):

View File

@ -24,6 +24,8 @@ let
availableComponents = cfg.package.availableComponents;
explicitComponents = cfg.package.extraComponents;
usedPlatforms = config:
if isAttrs config then
optional (config ? platform) config.platform
@ -42,10 +44,13 @@ let
# } ];
useComponentPlatform = component: elem component (usedPlatforms cfg.config);
# Returns whether component is used in config
useExplicitComponent = component: elem component explicitComponents;
# Returns whether component is used in config or explicitly passed into package
useComponent = component:
hasAttrByPath (splitString "." component) cfg.config
|| useComponentPlatform component;
|| useComponentPlatform component
|| useExplicitComponent component;
# List of components used in config
extraComponents = filter useComponent availableComponents;

View File

@ -67,7 +67,7 @@ in
description = "";
};
options.message-level = mkOption {
type = types.ints.between 0 2;
type = types.ints.between 0 3;
default = 2;
description = "Set verbosity of transmission messages.";
};

View File

@ -24,6 +24,11 @@ in {
services.home-assistant = {
inherit configDir;
enable = true;
package = (pkgs.home-assistant.override {
extraComponents = [ "zha" ];
}).overrideAttrs (oldAttrs: {
doInstallCheck = false;
});
config = {
homeassistant = {
name = "Home";
@ -87,6 +92,8 @@ in {
with subtest("Check that capabilities are passed for emulated_hue to bind to port 80"):
hass.wait_for_open_port(80)
hass.succeed("curl --fail http://localhost:80/description.xml")
with subtest("Check extra components are considered in systemd unit hardening"):
hass.succeed("systemctl show -p DeviceAllow home-assistant.service | grep -q char-ttyUSB")
with subtest("Print log to ease debugging"):
output_log = hass.succeed("cat ${configDir}/home-assistant.log")
print("\n### home-assistant.log ###\n")

View File

@ -31,15 +31,15 @@
}
},
"dev": {
"version": "98.0.4710.4",
"sha256": "0ay4bn9963k7bbv31wfc1iy2z6n6jjk1h2mn7m7893i81raisk8m",
"sha256bin64": "0n4kb6iiv9aih7yzrnr9m7znqb2p37grlj8by6gpjfikx3fxf5gg",
"version": "98.0.4736.0",
"sha256": "1bakzvzx0604k20p16lxmbl0s8za6fy4akng35c1kzf350jznq7n",
"sha256bin64": "09adpl6b43fzlms081c1bs3vrlwrm3kq0mfcqff4q33i0wb5wl25",
"deps": {
"gn": {
"version": "2021-11-16",
"version": "2021-11-24",
"url": "https://gn.googlesource.com/gn",
"rev": "4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e",
"sha256": "0jwjfbxlbqxlz7wm46vyrxn3pgwyyd03as6gy5mcvvk9aialqh9f"
"rev": "b79031308cc878488202beb99883ec1f2efd9a6d",
"sha256": "1fdn48y0nvs2qm67qvp1i75d9278ddi5v3bpxgjf28zrh9yragwd"
}
}
},

View File

@ -24,7 +24,7 @@ let
in stdenv.mkDerivation rec {
pname = "signal-desktop";
version = "5.24.0"; # Please backport all updates to the stable channel.
version = "5.25.0"; # Please backport all updates to the stable channel.
# All releases have a limited lifetime and "expire" 90 days after the release.
# When releases "expire" the application becomes unusable until an update is
# applied. The expiration date for the current release can be extracted with:
@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
src = fetchurl {
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
sha256 = "1p19vs4wxlghv8cbsq5k4bl8h9fzr9izp4k4qs5fcnqiy1z92ycy";
sha256 = "0ql9rzxrisqms3plcrmf3fjinpxba10asmpsxvhn0zlfajy47d0a";
};
nativeBuildInputs = [

View File

@ -15,12 +15,14 @@
buildPythonPackage rec {
pname = "meshtastic";
version = "1.2.40";
version = "1.2.43";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "be8464037d0c8085350065b38e7a7b028db15f2524764dec0e3548ea5b53500f";
sha256 = "sha256-nGbULY/QJUv3sk8vYXvh/fhkab/vB3lGGhXRTjt8anI=";
};
propagatedBuildInputs = [
@ -35,18 +37,13 @@ buildPythonPackage rec {
timeago
];
postPatch = ''
# https://github.com/meshtastic/Meshtastic-python/pull/87
substituteInPlace setup.py \
--replace 'with open("README.md", "r") as fh:' "" \
--replace "long_description = fh.read()" "" \
--replace "long_description=long_description," 'long_description="",'
'';
# Project only provides PyPI releases which don't contain the tests
# https://github.com/meshtastic/Meshtastic-python/issues/86
doCheck = false;
pythonImportsCheck = [ "meshtastic" ];
pythonImportsCheck = [
"meshtastic"
];
meta = with lib; {
description = "Python API for talking to Meshtastic devices";

View File

@ -89,9 +89,9 @@ rec {
# https://docs.gradle.org/current/userguide/compatibility.html
gradle_7 = gen {
version = "7.3";
version = "7.3.1";
nativeVersion = "0.22-milestone-21";
sha256 = "04741q7avmn7rv9h5s6dqj4ibnvdylxrlhvj9wb5kixx96nm53yy";
sha256 = "0rkb9pdmvq0zidv8lv4im2j7gs949lg35r79l1hwf4pwi2k3ryws";
defaultJava = jdk17;
};

View File

@ -2,11 +2,11 @@
buildGraalvmNativeImage rec {
pname = "clj-kondo";
version = "2021.10.19";
version = "2021.12.01";
src = fetchurl {
url = "https://github.com/clj-kondo/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
sha256 = "sha256-i0OeQPZfQPUeXC/Bs84I91IahBKK6W1mFix97s8/lVA=";
sha256 = "sha256-AH2MAz++jjBNHWAsUOWkfdzyWzGfmcDBNKcJp4xbPxQ=";
};
extraNativeImageBuildArgs = [
@ -18,6 +18,7 @@ buildGraalvmNativeImage rec {
description = "A linter for Clojure code that sparks joy";
homepage = "https://github.com/clj-kondo/clj-kondo";
license = licenses.epl10;
changelog = "https://github.com/clj-kondo/clj-kondo/blob/v${versiont}/CHANGELOG.md";
maintainers = with maintainers; [ jlesquembre bandresen thiagokokada ];
};
}

View File

@ -888,7 +888,7 @@ in with py.pkgs; buildPythonApplication rec {
'';
passthru = {
inherit availableComponents;
inherit availableComponents extraComponents;
python = py;
tests = {
inherit (nixosTests) home-assistant;

View File

@ -4,11 +4,11 @@
with python3.pkgs; buildPythonPackage rec {
pname = "esphome-dashboard";
version = "20211021.0";
version = "20211201.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-stJ6fUs02XpCN671EztHTLkXd57eMo6472Q1e1/cbHY=";
sha256 = "sha256-/VARM59TI2Ff70Jq0smFMrt4o2G/wKSdcOreLfxMAMQ=";
};
# no tests

View File

@ -2,6 +2,7 @@
, pkgs
, python3
, fetchFromGitHub
, fetchpatch
, platformio
, esptool
, git
@ -16,18 +17,23 @@ let
in
with python.pkgs; buildPythonApplication rec {
pname = "esphome";
version = "2021.10.1";
version = "2021.11.4";
format = "setuptools";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-zVZantMYtDWkvFrXmX0HpUchmc3T2gbkrMiWGP2ibNc=";
sha256 = "sha256-hPnng3Jkb2FucEOar/MIjvWHKbT3NNxEn6CIr3sd1Ng=";
};
patches = [
# fix missing write permissions on src files before modifing them
./fix-src-permissions.patch
./fix-src-permissions.patch
(fetchpatch {
url = "https://github.com/esphome/esphome/commit/fbe1bca1b9896ba8c8b754c5a4faf790bffd887b.patch";
sha256 = "sha256-Iyc79iL2YkLGD81TbFK3GaCY2L9nTE9mKz6MQSNQWr8=";
})
];
postPatch = ''

View File

@ -32,6 +32,9 @@
, withDNSTAP ? false
, withTFO ? false
, withRedis ? false
# Avoid .lib depending on openssl.out
# The build gets a little hacky, so in some cases we disable this approach.
, withSlimLib ? stdenv.isLinux && !stdenv.hostPlatform.isMusl && !withDNSTAP
, libnghttp2
}:
@ -105,10 +108,9 @@ stdenv.mkDerivation rec {
--prefix PATH : ${lib.makeBinPath [ openssl ]}
'';
preFixup = lib.optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) # XXX: revisit
preFixup = lib.optionalString withSlimLib
# Build libunbound again, but only against nettle instead of openssl.
# This avoids gnutls.out -> unbound.lib -> openssl.out.
# There was some problem with this on Darwin; let's not complicate non-Linux.
''
configureFlags="$configureFlags --with-nettle=${nettle.dev} --with-libunbound-only"
configurePhase

View File

@ -9,17 +9,18 @@
, winetricks
, yad
, pytestCheckHook
, nix-update-script
}:
buildPythonApplication rec {
pname = "protontricks";
version = "1.6.1";
version = "1.6.2";
src = fetchFromGitHub {
owner = "Matoking";
repo = pname;
rev = version;
sha256 = "sha256-2ZOVcPCF1o8mNfHOWRFTjAEu0dWzaMxlMTcctn/ScxY=";
sha256 = "sha256-XC5ip12wlXRo/AaTFJWEZvEZPPC1WtXTyeYivvyHZaE=";
};
patches = [
@ -55,6 +56,10 @@ buildPythonApplication rec {
pythonImportsCheck = [ "protontricks" ];
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
homepage = "https://github.com/Matoking/protontricks";

View File

@ -1,5 +1,5 @@
diff --git a/src/protontricks/cli/main.py b/src/protontricks/cli/main.py
index d811cb7..a376a34 100755
index bd651aa..2b82aea 100755
--- a/src/protontricks/cli/main.py
+++ b/src/protontricks/cli/main.py
@@ -14,8 +14,8 @@ import sys
@ -57,9 +57,9 @@ index d811cb7..a376a34 100755
use_steam_runtime=use_steam_runtime,
- legacy_steam_runtime_path=legacy_steam_runtime_path,
use_bwrap=use_bwrap,
command=[str(winetricks_path)] + args.winetricks_command)
elif args.command:
@@ -296,7 +285,6 @@ def main(args=None):
command=[str(winetricks_path)] + args.winetricks_command
)
@@ -297,7 +286,6 @@ def main(args=None):
steam_app=steam_app,
command=args.command,
use_steam_runtime=use_steam_runtime,
@ -121,7 +121,7 @@ index be5322b..552f894 100644
APPINFO_STRUCT_SECTION = "<LLLLQ20sL"
diff --git a/src/protontricks/util.py b/src/protontricks/util.py
index 5252d6c..f16dfec 100644
index f2482fc..f9c1c33 100644
--- a/src/protontricks/util.py
+++ b/src/protontricks/util.py
@@ -5,15 +5,14 @@ import shutil
@ -243,7 +243,7 @@ index 5252d6c..f16dfec 100644
use_bwrap=True,
**kwargs):
"""Run an arbitrary command with the correct environment variables
@@ -351,7 +338,7 @@ def run_command(
@@ -353,7 +340,7 @@ def run_command(
os.environ["STEAM_RUNTIME_PATH"] = \
str(proton_app.required_tool_app.install_path)
os.environ["PROTON_LD_LIBRARY_PATH"] = \
@ -252,7 +252,7 @@ index 5252d6c..f16dfec 100644
runtime_name = proton_app.required_tool_app.name
logger.info(
@@ -372,11 +359,8 @@ def run_command(
@@ -374,11 +361,8 @@ def run_command(
"Current Steam Runtime not recognized by Protontricks."
)
else:
@ -265,7 +265,7 @@ index 5252d6c..f16dfec 100644
# When Steam Runtime is enabled, create a set of helper scripts
# that load the underlying Proton Wine executables with Steam Runtime
@@ -384,8 +368,6 @@ def run_command(
@@ -386,8 +370,6 @@ def run_command(
wine_bin_dir = create_wine_bin_dir(
proton_app=proton_app, use_bwrap=use_bwrap
)
@ -275,7 +275,7 @@ index 5252d6c..f16dfec 100644
os.environ["PATH"] = "".join([
str(wine_bin_dir), os.pathsep, os.environ["PATH"]
diff --git a/tests/cli/test_main.py b/tests/cli/test_main.py
index f714f2c..b03fac1 100644
index 605ae26..4bf7e80 100644
--- a/tests/cli/test_main.py
+++ b/tests/cli/test_main.py
@@ -116,15 +116,10 @@ class TestCLIRun:
@ -324,7 +324,7 @@ index f714f2c..b03fac1 100644
assert command.env["STEAM_RUNTIME_PATH"] == \
str(steam_runtime_soldier.install_path)
@@ -335,7 +326,6 @@ class TestCLIRun:
@@ -344,7 +335,6 @@ class TestCLIRun:
# Also ensure log messages are included in the error message
assert b"Found Steam directory at" in message
@ -332,7 +332,7 @@ index f714f2c..b03fac1 100644
def test_run_gui_provider_not_found(self, cli, home_dir, steam_app_factory):
"""
@@ -349,20 +339,6 @@ class TestCLIRun:
@@ -358,20 +348,6 @@ class TestCLIRun:
assert "YAD or Zenity is not installed" in result
@ -345,11 +345,11 @@ index f714f2c..b03fac1 100644
- steam_app_factory(name="Fake game 1", appid=10)
- result = cli(
- ["10", "winecfg"], env={"STEAM_RUNTIME": "invalid/path"},
- expect_exit=True
- expect_returncode=1
- )
-
- assert "Steam Runtime was enabled but couldn't be found" in result
-
def test_run_proton_not_found(self, cli, steam_dir, steam_app_factory):
steam_app_factory(name="Fake game 1", appid=10)
result = cli(["10", "winecfg"], expect_exit=True)
result = cli(["10", "winecfg"], expect_returncode=1)