Skip to content

Commit

Permalink
matrix-synapse: pin netaddr at 1.0.0
Browse files Browse the repository at this point in the history
Netaddr 1.1.0 changes the behavior for partial address expansion, making
two tests fail:

- test_get_user_by_req_appservice_valid_token_bad_ip
- test_get_user_by_req_appservice_valid_token_good_ip
  • Loading branch information
mweinelt committed Mar 12, 2024
1 parent bf0578a commit d2e41f1
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions pkgs/servers/matrix-synapse/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchPypi
, python3
, openssl
, libiconv
Expand All @@ -12,10 +13,24 @@
}:

let
plugins = python3.pkgs.callPackage ./plugins { };
python = python3.override {
packageOverrides = self: super: {
netaddr = super.netaddr.overridePythonAttrs (oldAttrs: rec {
version = "1.0.0";

src = fetchPypi {
pname = "netaddr";
inherit version;
hash = "sha256-6wRrVTVOelv4AcBJAq6SO9aZGQJC2JsJnolvmycktNM=";
};
});
};
};

plugins = python.pkgs.callPackage ./plugins { };
tools = callPackage ./tools { };
in
python3.pkgs.buildPythonApplication rec {
python.pkgs.buildPythonApplication rec {
pname = "matrix-synapse";
version = "1.102.0";
format = "pyproject";
Expand Down Expand Up @@ -48,7 +63,7 @@ python3.pkgs.buildPythonApplication rec {
sed -i 's/Pillow = ".*"/Pillow = ">=5.4.0"/' pyproject.toml
'';

nativeBuildInputs = with python3.pkgs; [
nativeBuildInputs = with python.pkgs; [
poetry-core
rustPlatform.cargoSetupHook
setuptools-rust
Expand All @@ -62,7 +77,7 @@ python3.pkgs.buildPythonApplication rec {
libiconv
];

propagatedBuildInputs = with python3.pkgs; [
propagatedBuildInputs = with python.pkgs; [
attrs
bcrypt
bleach
Expand Down Expand Up @@ -95,7 +110,7 @@ python3.pkgs.buildPythonApplication rec {
]
++ twisted.optional-dependencies.tls;

passthru.optional-dependencies = with python3.pkgs; {
passthru.optional-dependencies = with python.pkgs; {
postgres = if isPyPy then [
psycopg2cffi
] else [
Expand Down Expand Up @@ -133,7 +148,7 @@ python3.pkgs.buildPythonApplication rec {

nativeCheckInputs = [
openssl
] ++ (with python3.pkgs; [
] ++ (with python.pkgs; [
mock
parameterized
])
Expand All @@ -154,15 +169,14 @@ python3.pkgs.buildPythonApplication rec {
NIX_BUILD_CORES=4
fi
PYTHONPATH=".:$PYTHONPATH" ${python3.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests
PYTHONPATH=".:$PYTHONPATH" ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests
runHook postCheck
'';

passthru = {
tests = { inherit (nixosTests) matrix-synapse matrix-synapse-workers; };
inherit plugins tools;
python = python3;
inherit plugins tools python;
};

meta = with lib; {
Expand Down

0 comments on commit d2e41f1

Please sign in to comment.