Skip to content

Commit e8ddd8a

Browse files
authored
Merge pull request tahoe-lafs#1403 from LeastAuthority/4134.fix-circleci-nix
4134: Fix Nix jobs on CircleCI
2 parents dc6ea19 + 4de3508 commit e8ddd8a

File tree

14 files changed

+47
-490
lines changed

14 files changed

+47
-490
lines changed

.circleci/config.yml

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ workflows:
8787
{}
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
100101
#- "pypy27-buster":
@@ -555,15 +556,12 @@ jobs:
555556
buildSteps:
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 \
569567
allmydata
@@ -693,15 +691,8 @@ executors:
693691
docker:
694692
# Run in a highly Nix-capable environment.
695693
- <<: *DOCKERHUB_AUTH
696-
image: "nixos/nix:2.16.1"
694+
image: "nixos/nix:2.25.3"
697695
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"
705696
# Let us use features marked "experimental". For example, most/all of
706697
# the `nix <subcommand>` forms.
707698
NIX_CONFIG: "experimental-features = nix-command flakes"
@@ -724,34 +715,21 @@ commands:
724715
type: "steps"
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"
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
747728
command: |
748-
source .circleci/lib.sh
749-
NIXPKGS=$(nixpkgs_flake_reference <<parameters.nixpkgs>>)
750-
cache_if_able nix build \
729+
nix build \
751730
--verbose \
752731
--print-build-logs \
753732
--cores "$DEPENDENCY_CORES" \
754-
--override-input nixpkgs "$NIXPKGS" \
755733
.#<<parameters.pythonVersion>>-tahoe-lafs
756734
757735
- steps: "<<parameters.buildSteps>>"

.circleci/lib.sh

Lines changed: 0 additions & 148 deletions
This file was deleted.

flake.lock

Lines changed: 13 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)