Changeset e8ddd8a in trunk


Ignore:
Timestamp:
2024-12-12T19:16:38Z (4 months ago)
Author:
GitHub <noreply@…>
Children:
4809397, ef55c29
Parents:
dc6ea19 (diff), 4de3508 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
meejah <meejah@…> (2024-12-12 19:16:38)
git-committer:
GitHub <noreply@…> (2024-12-12 19:16:38)
Message:

Merge pull request #1403 from LeastAuthority?/4134.fix-circleci-nix

4134: Fix Nix jobs on CircleCI

Files:
1 added
8 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified .circleci/config.yml

    rdc6ea19 re8ddd8a  
    8888
    8989      - "nixos":
    90           name: "nixos-<<matrix.pythonVersion>>"
    91           nixpkgs: "nixpkgs-unstable"
     90          name: "<<matrix.nixpkgs>>-<<matrix.pythonVersion>>"
    9291          matrix:
    9392            parameters:
     93              nixpkgs:
     94                - "nixpkgs-24_11"
    9495              pythonVersion:
    95                 - "python39"
    9696                - "python310"
    9797                - "python311"
     98                - "python312"
    9899
    99100      # Eventually, test against PyPy 3.8
     
    556557            - "run":
    557558                name: "Unit Test"
     559                environment:
     560                  # Once dependencies are built, we can allow some more concurrency for our own
     561                  # test suite.
     562                  UNITTEST_CORES: 8
    558563                command: |
    559                   source .circleci/lib.sh
    560 
    561                   # Translate the nixpkgs selection into a flake reference we
    562                   # can use to override the default nixpkgs input.
    563                   NIXPKGS=$(nixpkgs_flake_reference <<parameters.nixpkgs>>)
    564 
    565                   cache_if_able nix run \
    566                     --override-input nixpkgs "$NIXPKGS" \
     564                  nix run \
    567565                    .#<<parameters.pythonVersion>>-unittest -- \
    568566                    --jobs $UNITTEST_CORES \
     
    694692      # Run in a highly Nix-capable environment.
    695693      - <<: *DOCKERHUB_AUTH
    696         image: "nixos/nix:2.16.1"
    697     environment:
    698       # currently, all NixOS builds are broken; ignore them
    699       ALLOWED_FAILURE: "yes"
    700 
    701       # CACHIX_AUTH_TOKEN is manually set in the CircleCI web UI and allows us
    702       # to push to CACHIX_NAME.  CACHIX_NAME tells cachix which cache to push
    703       # to.
    704       CACHIX_NAME: "tahoe-lafs-opensource"
     694        image: "nixos/nix:2.25.3"
     695    environment:
    705696      # Let us use features marked "experimental".  For example, most/all of
    706697      # the `nix <subcommand>` forms.
     
    725716
    726717    steps:
    727       - "run":
    728           # Get cachix for Nix-friendly caching.
    729           name: "Install Basic Dependencies"
    730           command: |
    731             # Get some build environment dependencies and let them float on a
    732             # certain release branch.  These aren't involved in the actual
    733             # package build (only in CI environment setup) so the fact that
    734             # they float shouldn't hurt reproducibility.
    735             NIXPKGS="nixpkgs/nixos-23.05"
    736             nix profile install $NIXPKGS#cachix $NIXPKGS#bash $NIXPKGS#jp
    737 
    738             # Activate our cachix cache for "binary substitution".  This sets
    739             # up configuration tht lets Nix download something from the cache
    740             # instead of building it locally, if possible.
    741             cachix use "${CACHIX_NAME}"
    742 
    743718      - "checkout"
    744719
    745720      - "run":
    746721          name: "Build Package"
    747           command: |
    748             source .circleci/lib.sh
    749             NIXPKGS=$(nixpkgs_flake_reference <<parameters.nixpkgs>>)
    750             cache_if_able nix build \
     722          environment:
     723            # CircleCI build environment looks like it has a zillion and a half cores.
     724            # Don't let Nix autodetect this high core count because it blows up memory
     725            # usage and fails the test run.  Pick a number of cores that suits the build
     726            # environment we're paying for (the free one!).
     727            DEPENDENCY_CORES: 3
     728          command: |
     729            nix build \
    751730              --verbose \
    752731              --print-build-logs \
    753732              --cores "$DEPENDENCY_CORES" \
    754               --override-input nixpkgs "$NIXPKGS" \
    755733              .#<<parameters.pythonVersion>>-tahoe-lafs
    756734
  • TabularUnified flake.lock

    rdc6ea19 re8ddd8a  
    44      "flake": false,
    55      "locked": {
    6         "lastModified": 1673956053,
    7         "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
     6        "lastModified": 1733328505,
     7        "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
    88        "owner": "edolstra",
    99        "repo": "flake-compat",
    10         "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
     10        "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
    1111        "type": "github"
    1212      },
     
    2222      },
    2323      "locked": {
    24         "lastModified": 1687709756,
    25         "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
     24        "lastModified": 1731533236,
     25        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
    2626        "owner": "numtide",
    2727        "repo": "flake-utils",
    28         "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
     28        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
    2929        "type": "github"
    3030      },
     
    3535      }
    3636    },
    37     "nixpkgs-22_11": {
     37    "nixpkgs-24_11": {
    3838      "locked": {
    39         "lastModified": 1688392541,
    40         "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=",
     39        "lastModified": 1733261153,
     40        "narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=",
    4141        "owner": "NixOS",
    4242        "repo": "nixpkgs",
    43         "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b",
     43        "rev": "b681065d0919f7eb5309a93cea2cfa84dec9aa88",
    4444        "type": "github"
    4545      },
    4646      "original": {
    4747        "owner": "NixOS",
    48         "ref": "nixos-22.11",
    49         "repo": "nixpkgs",
    50         "type": "github"
    51       }
    52     },
    53     "nixpkgs-23_05": {
    54       "locked": {
    55         "lastModified": 1689885880,
    56         "narHash": "sha256-2ikAcvHKkKh8J/eUrwMA+wy1poscC+oL1RkN1V3RmT8=",
    57         "owner": "NixOS",
    58         "repo": "nixpkgs",
    59         "rev": "fa793b06f56896b7d1909e4b69977c7bf842b2f0",
    60         "type": "github"
    61       },
    62       "original": {
    63         "owner": "NixOS",
    64         "ref": "nixos-23.05",
    65         "repo": "nixpkgs",
    66         "type": "github"
    67       }
    68     },
    69     "nixpkgs-unstable": {
    70       "locked": {
    71         "lastModified": 1689791806,
    72         "narHash": "sha256-QpXjfiyBFwa7MV/J6nM5FoBreks9O7j9cAZxV22MR8A=",
    73         "owner": "NixOS",
    74         "repo": "nixpkgs",
    75         "rev": "439ba0789ff84dddea64eb2d47a4a0d4887dbb1f",
    76         "type": "github"
    77       },
    78       "original": {
    79         "owner": "NixOS",
    80         "ref": "pull/244135/head",
     48        "ref": "nixos-24.11",
    8149        "repo": "nixpkgs",
    8250        "type": "github"
     
    8856        "flake-utils": "flake-utils",
    8957        "nixpkgs": [
    90           "nixpkgs-unstable"
     58          "nixpkgs-24_11"
    9159        ],
    92         "nixpkgs-22_11": "nixpkgs-22_11",
    93         "nixpkgs-23_05": "nixpkgs-23_05",
    94         "nixpkgs-unstable": "nixpkgs-unstable"
     60        "nixpkgs-24_11": "nixpkgs-24_11"
    9561      }
    9662    },
  • TabularUnified flake.nix

    rdc6ea19 re8ddd8a  
    11{
    22  description = "Tahoe-LAFS, free and open decentralized data store";
    3 
    4   nixConfig = {
    5     # Supply configuration for the build cache updated by our CI system.  This
    6     # should allow most users to avoid having to build a large number of
    7     # packages (otherwise necessary due to our Python package overrides).
    8     substituters = ["https://tahoe-lafs-opensource.cachix.org"];
    9     trusted-public-keys = ["tahoe-lafs-opensource.cachix.org-1:eIKCHOPJYceJ2gb74l6e0mayuSdXqiavxYeAio0LFGo="];
    10   };
    113
    124  inputs = {
     
    2113    # releases of NixOS at a time is worthwhile and then pins like these will
    2214    # help us test each of those releases.
    23     "nixpkgs-22_11" = {
    24       url = github:NixOS/nixpkgs?ref=nixos-22.11;
     15    "nixpkgs-24_11" = {
     16      url = github:NixOS/nixpkgs?ref=nixos-24.11;
    2517    };
    26     "nixpkgs-23_05" = {
    27       url = github:NixOS/nixpkgs?ref=nixos-23.05;
    28     };
    29 
    30     # We depend on a very new python-cryptography which is not yet available
    31     # from any release branch of nixpkgs.  However, it is contained in a PR
    32     # currently up for review.  Point our nixpkgs at that for now.
    33     "nixpkgs-unstable" = {
    34       url = github:NixOS/nixpkgs?ref=pull/244135/head;
    35     };
    36 
    37     # Point the default nixpkgs at one of those.  This avoids having getting a
    38     # _third_ package set involved and gives a way to provide what should be a
    39     # working experience by default (that is, if nixpkgs doesn't get
    40     # overridden).
    41     nixpkgs.follows = "nixpkgs-unstable";
     18
     19    # Point the default nixpkgs at one of those.
     20    nixpkgs.follows = "nixpkgs-24_11";
    4221
    4322    # Also get flake-utils for simplified multi-system definitions.
     
    154133        tahoe-lafs.passthru.extras.i2p ++
    155134        tahoe-lafs.passthru.extras.tor ++
    156         tahoe-lafs.passthru.extras.unittest
     135        tahoe-lafs.passthru.extras.unittest ++
     136        [ hatchling hatch-vcs ]
    157137      )).overrideAttrs (old: {
    158138        # See the similar override in makeRuntimeEnv'.
     
    220200                let
    221201                  python = "${makeTestEnv pyVersion}/bin/python";
     202                  hatchling = "${makeTestEnv pyVersion}/bin/hatchling";
    222203                in
    223204                  writeScript "unit-tests"
    224205                    ''
    225                     ${python} setup.py update_version
     206                    ${hatchling} build --hooks-only # Write _version.py
    226207                    export TAHOE_LAFS_HYPOTHESIS_PROFILE=ci
    227208                    export PYTHONPATH=$PWD/src
  • TabularUnified nix/python-overrides.nix

    rdc6ea19 re8ddd8a  
    4343  };
    4444
    45   # Some dependencies aren't packaged in nixpkgs so supply our own packages.
    46   pycddl = self.callPackage ./pycddl.nix { };
    47   txi2p = self.callPackage ./txi2p.nix { };
    48 
    49   # Some packages are of somewhat too-old versions - update them.
    50   klein = self.callPackage ./klein.nix {
    51     # Avoid infinite recursion.
    52     inherit (super) klein;
    53   };
    54   txtorcon = self.callPackage ./txtorcon.nix {
    55     inherit (super) txtorcon;
    56   };
    57 
    58   # With our customized package set a Twisted unit test fails.  Patch the
    59   # Twisted test suite to skip that test.
    60   # Filed upstream at https://github.com/twisted/twisted/issues/11877
    61   twisted = super.twisted.overrideAttrs (old: {
    62     patches = (old.patches or []) ++ [ ./twisted.patch ];
    63   });
    64 
    65   # Update the version of pyopenssl - and since we're doing that anyway, we
    66   # don't need the docs.  Unfortunately this triggers a lot of rebuilding of
    67   # dependent packages.
    68   pyopenssl = dontBuildDocs (self.callPackage ./pyopenssl.nix {
    69     inherit (super) pyopenssl;
    70   });
    71 
    72   # The cryptography that we get from nixpkgs to satisfy the pyopenssl upgrade
    73   # that we did breaks service-identity ... so get a newer version that works.
    74   service-identity = self.callPackage ./service-identity.nix { };
    75 
    7645  # collections-extended is currently broken for Python 3.11 in nixpkgs but
    7746  # we know where a working version lives.
    7847  collections-extended = self.callPackage ./collections-extended.nix {
     48    # Avoid infinite recursion.
    7949    inherit (super) collections-extended;
    8050  };
  • TabularUnified nix/tahoe-lafs.nix

    rdc6ea19 re8ddd8a  
    1010buildPythonPackage rec {
    1111  inherit pname version;
     12  pyproject = true;
    1213  src = tahoe-lafs-src;
    1314  propagatedBuildInputs = with pythonPackages; [
     
    2324    foolscap
    2425    future
     26    hatchling
     27    hatch-vcs
    2528    klein
    2629    magic-wormhole
     
    5154      ];
    5255      i2p = [
    53         txi2p
     56        txi2p-tahoe
    5457      ];
    5558      unittest = [
Note: See TracChangeset for help on using the changeset viewer.