From 1f6daf02eb05d48f4ddce8f3443706473dec061b Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 29 Sep 2021 15:15:56 -0400 Subject: [PATCH 1/5] news fragment --- newsfragments/3808.installation | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/3808.installation diff --git a/newsfragments/3808.installation b/newsfragments/3808.installation new file mode 100644 index 000000000..157f08a0c --- /dev/null +++ b/newsfragments/3808.installation @@ -0,0 +1 @@ +Tahoe-LAFS now supports running on NixOS 21.05 with Python 3. From fc01835a56ee260970887eb999ed4d4dae9c7b4d Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 29 Sep 2021 15:16:01 -0400 Subject: [PATCH 2/5] ci configuration --- .circleci/config.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62d1bd752..ea3d50de5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,6 +42,9 @@ workflows: - "nixos-19-09": {} + - "nixos-21-05": + {} + # Test against PyPy 2.7 - "pypy27-buster": {} @@ -438,8 +441,7 @@ jobs: image: "tahoelafsci/fedora:29-py" user: "nobody" - - nixos-19-09: + nixos-19-09: &NIXOS docker: # Run in a highly Nix-capable environment. - <<: *DOCKERHUB_AUTH @@ -465,6 +467,15 @@ jobs: # them in parallel. nix-build --cores 3 --max-jobs 2 nix/ + nixos-21-05: + <<: *NIXOS + + environment: + # Note this doesn't look more similar to the 19.09 NIX_PATH URL because + # there was some internal shuffling by the NixOS project about how they + # publish stable revisions. + NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-21.05-small.tar.gz" + typechecks: docker: - <<: *DOCKERHUB_AUTH From 49ee4b8acfff3820f80a01d0fb8d2eab60f0a1d5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 29 Sep 2021 15:27:17 -0400 Subject: [PATCH 3/5] callPackage not directly available from python-self in newer nixpkgs --- nix/overlays.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nix/overlays.nix b/nix/overlays.nix index 14a47ca5a..f5ef72cc0 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -2,25 +2,25 @@ self: super: { python27 = super.python27.override { packageOverrides = python-self: python-super: { # eliot is not part of nixpkgs at all at this time. - eliot = python-self.callPackage ./eliot.nix { }; + eliot = python-self.pythonPackages.callPackage ./eliot.nix { }; # NixOS autobahn package has trollius as a dependency, although # it is optional. Trollius is unmaintained and fails on CI. - autobahn = python-super.callPackage ./autobahn.nix { }; + autobahn = python-super.pythonPackages.callPackage ./autobahn.nix { }; # Porting to Python 3 is greatly aided by the future package. A # slightly newer version than appears in nixos 19.09 is helpful. - future = python-super.callPackage ./future.nix { }; + future = python-super.pythonPackages.callPackage ./future.nix { }; # Need version of pyutil that supports Python 3. The version in 19.09 # is too old. - pyutil = python-super.callPackage ./pyutil.nix { }; + pyutil = python-super.pythonPackages.callPackage ./pyutil.nix { }; # Need a newer version of Twisted, too. - twisted = python-super.callPackage ./twisted.nix { }; + twisted = python-super.pythonPackages.callPackage ./twisted.nix { }; # collections-extended is not part of nixpkgs at this time. - collections-extended = python-super.callPackage ./collections-extended.nix { }; + collections-extended = python-super.pythonPackages.callPackage ./collections-extended.nix { }; }; }; } From 5a3028bdabf1a4674da8576d78f0026fb4f37517 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 29 Sep 2021 15:46:18 -0400 Subject: [PATCH 4/5] add a python3 expression most deps are in nixpkgs now but we still need an overlay for th very very recent collections-extended dependency --- .circleci/config.yml | 6 ++++-- nix/overlays.nix | 7 +++++++ nix/py3.nix | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 nix/py3.nix diff --git a/.circleci/config.yml b/.circleci/config.yml index ea3d50de5..dd877ca7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -449,6 +449,7 @@ jobs: environment: NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09-small.tar.gz" + SOURCE: "nix/" steps: - "checkout" @@ -465,7 +466,7 @@ jobs: # build a couple simple little dependencies that don't take # advantage of multiple cores and we get a little speedup by doing # them in parallel. - nix-build --cores 3 --max-jobs 2 nix/ + nix-build --cores 3 --max-jobs 2 "$SOURCE" nixos-21-05: <<: *NIXOS @@ -474,7 +475,8 @@ jobs: # Note this doesn't look more similar to the 19.09 NIX_PATH URL because # there was some internal shuffling by the NixOS project about how they # publish stable revisions. - NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-21.05-small.tar.gz" + NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/d32b07e6df276d78e3640eb43882b80c9b2b3459.tar.gz" + SOURCE: "nix/py3.nix" typechecks: docker: diff --git a/nix/overlays.nix b/nix/overlays.nix index f5ef72cc0..fbd0ce3bb 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -23,4 +23,11 @@ self: super: { collections-extended = python-super.pythonPackages.callPackage ./collections-extended.nix { }; }; }; + + python39 = super.python39.override { + packageOverrides = python-self: python-super: { + # collections-extended is not part of nixpkgs at this time. + collections-extended = python-super.pythonPackages.callPackage ./collections-extended.nix { }; + }; + }; } diff --git a/nix/py3.nix b/nix/py3.nix new file mode 100644 index 000000000..34ede49dd --- /dev/null +++ b/nix/py3.nix @@ -0,0 +1,7 @@ +# This is the main entrypoint for the Tahoe-LAFS derivation. +{ pkgs ? import { } }: +# Add our Python packages to nixpkgs to simplify the expression for the +# Tahoe-LAFS derivation. +let pkgs' = pkgs.extend (import ./overlays.nix); +# Evaluate the expression for our Tahoe-LAFS derivation. +in pkgs'.python39.pkgs.callPackage ./tahoe-lafs.nix { } From 49df402f0762b34c88b01d183b9d217da117cc79 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 29 Sep 2021 15:48:33 -0400 Subject: [PATCH 5/5] maybe this is the right url --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd877ca7f..2fc8e88e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -475,7 +475,7 @@ jobs: # Note this doesn't look more similar to the 19.09 NIX_PATH URL because # there was some internal shuffling by the NixOS project about how they # publish stable revisions. - NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/d32b07e6df276d78e3640eb43882b80c9b2b3459.tar.gz" + NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/d32b07e6df276d78e3640eb43882b80c9b2b3459.tar.gz" SOURCE: "nix/py3.nix" typechecks: