From 144864d61cf0739f6d79d80e48e7d6c91467f6f4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 May 2021 20:58:59 +0200 Subject: [PATCH] Drop NixOS 19.03 --- CHANGELOG.md | 2 +- nix/ci.nix | 15 ++------ nix/default.nix | 4 +-- nix/sources.json | 12 ------- src/nix/modules/lib/assert.nix | 13 +++---- tests/arion-test-perl/README.md | 4 --- tests/arion-test-perl/default.nix | 60 ------------------------------- tests/default.nix | 5 +-- 8 files changed, 14 insertions(+), 101 deletions(-) delete mode 100644 tests/arion-test-perl/README.md delete mode 100644 tests/arion-test-perl/default.nix diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a49809..0ee237f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * Add a tested example for Traefik with label-based routing. -* Drop obsolete NixOS 19.09 and 20.03 support. It may still be usable there. +* Drop obsolete NixOS 19.03, 19.09 and 20.03 from CI. ## 0.1.2.0 -- 2020-03-05 diff --git a/nix/ci.nix b/nix/ci.nix index f44c5e2..a857704 100644 --- a/nix/ci.nix +++ b/nix/ci.nix @@ -5,17 +5,6 @@ let in dimension "Nixpkgs version" { - "nixos-19_03" = { - # flyingcircus.io latest long-term support is based off 19.03 - # https://flyingcircus.io/doc/ - # It is nice to have some level of support for their platform, - # but we don't guarantee any support. - nixpkgsSource = "nixos-19.03"; - enableDoc = false; - nixosTestIsPerl = true; - dockerSupportsSystemd = true; - nixosHasPodmanDockerSocket = false; - }; "nixos-20_09" = { nixpkgsSource = "nixos-20.09"; isReferenceNixpkgs = true; @@ -29,7 +18,7 @@ dimension "Nixpkgs version" { }; } ( _name: { nixpkgsSource, isReferenceNixpkgs ? false, enableDoc ? true, - nixosTestIsPerl ? false, dockerSupportsSystemd ? false, nixosHasPodmanDockerSocket ? true }: + dockerSupportsSystemd ? false, nixosHasPodmanDockerSocket ? true }: dimension "System" { @@ -39,7 +28,7 @@ dimension "Nixpkgs version" { system: { isReferenceTarget ? false, enableNixOSTests ? true }: let pkgs = import ./. { - inherit system nixosTestIsPerl dockerSupportsSystemd nixosHasPodmanDockerSocket; + inherit system dockerSupportsSystemd nixosHasPodmanDockerSocket; nixpkgsSrc = sources.${nixpkgsSource}; }; in diff --git a/nix/default.nix b/nix/default.nix index a880f2c..1bafe0e 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -2,7 +2,6 @@ , nixpkgsName ? "nixos-unstable" , nixpkgsSrc ? sources.${nixpkgsName} , system ? builtins.currentSystem -, nixosTestIsPerl ? false , dockerSupportsSystemd ? false , nixosHasPodmanDockerSocket ? true , ... @@ -14,9 +13,8 @@ import nixpkgsSrc ({ }; overlays = [ (_: _: { - inherit nixosTestIsPerl; arionTestingFlags = { - inherit nixosTestIsPerl dockerSupportsSystemd nixosHasPodmanDockerSocket; + inherit dockerSupportsSystemd nixosHasPodmanDockerSocket; }; }) (import ./overlay.nix) diff --git a/nix/sources.json b/nix/sources.json index d68b5da..29b95d2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -11,18 +11,6 @@ "url": "https://github.com/nmattia/niv/archive/fad2a6cbfb2e7cdebb7cb0ad2f5cc91e2c9bc06b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, - "nixos-19.03": { - "branch": "nixos-19.03", - "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", - "homepage": "https://github.com/NixOS/nixpkgs", - "owner": "NixOS", - "repo": "nixpkgs-channels", - "rev": "34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59", - "sha256": "11z6ajj108fy2q5g8y4higlcaqncrbjm3dnv17pvif6avagw4mcb", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs-channels/archive/34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "nixos-20.09": { "branch": "nixos-20.09", "description": "Nix Packages collection", diff --git a/src/nix/modules/lib/assert.nix b/src/nix/modules/lib/assert.nix index f9bf4a8..c1940d2 100644 --- a/src/nix/modules/lib/assert.nix +++ b/src/nix/modules/lib/assert.nix @@ -3,14 +3,15 @@ # based on nixpkgs/nixos/modules/system/activation/top-level.nix let - inherit (lib) filter concatStringsSep types mkOption; - - # lib.showWarnings since 19.09 - showWarnings = warnings: res: lib.fold (w: x: lib.warn w x) res warnings; - warn = msg: builtins.trace "warning: ${msg}"; + inherit (lib) + concatStringsSep + filter + mkOption + showWarnings + types + ; # Handle assertions and warnings - failedAssertions = map (x: x.message) (filter (x: !x.assertion) config.assertions); assertWarn = if failedAssertions != [] diff --git a/tests/arion-test-perl/README.md b/tests/arion-test-perl/README.md deleted file mode 100644 index 736afb7..0000000 --- a/tests/arion-test-perl/README.md +++ /dev/null @@ -1,4 +0,0 @@ - -This test suite exists only to keep tests around for older versions of NixOS. - -This will be removed when 19.09 becomes irrelevant. diff --git a/tests/arion-test-perl/default.nix b/tests/arion-test-perl/default.nix deleted file mode 100644 index 34c42b3..0000000 --- a/tests/arion-test-perl/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ pkgs, ... }: - -let - # To make some prebuilt derivations available in the vm - preEval = modules: import ../../src/nix/eval-composition.nix { - inherit modules; - inherit pkgs; - }; -in -{ - name = "arion-test"; - machine = { pkgs, lib, ... }: { - environment.systemPackages = [ - pkgs.arion - ]; - virtualisation.docker.enable = true; - - # no caches, because no internet - nix.binaryCaches = lib.mkForce []; - - # FIXME: Sandbox seems broken with current version of NixOS test - # w/ writable store. Error: - # machine# error: linking '/nix/store/7r8z2zvhwda85pgpdn5hzzz6hs1njklc-stdenv-linux.drv.chroot/nix/store/6v3y7s4q4wd16hsw393gjpxvcf9159bv-patch-shebangs.sh' to '/nix/store/6v3y7s4q4wd16hsw393gjpxvcf9159bv-patch-shebangs.sh': Operation not permitted - # - # There should be no reason why arion can't run without - # sandboxing, so please re-enable. - nix.useSandbox = false; - - virtualisation.writableStore = true; - virtualisation.pathsInNixDB = [ - # Pre-build the image because we don't want to build the world - # in the vm. - (preEval [ ../../examples/minimal/arion-compose.nix ]).config.out.dockerComposeYaml - (preEval [ ../../examples/full-nixos/arion-compose.nix ]).config.out.dockerComposeYaml - (preEval [ ../../examples/nixos-unit/arion-compose.nix ]).config.out.dockerComposeYaml - pkgs.stdenv - ]; - - virtualisation.memorySize = 512; - }; - testScript = '' - $machine->fail("curl localhost:8000"); - $machine->succeed("docker --version"); - - my $makeSubtest = sub { - my ( $subtestName, $exampleSrc ) = @_; - - subtest $subtestName => sub { - $machine->succeed("rm -rf work && cp -frT $exampleSrc work && cd work && NIX_PATH=nixpkgs='${pkgs.path}' arion up -d"); - $machine->waitUntilSucceeds("curl localhost:8000"); - $machine->succeed("cd work && NIX_PATH=nixpkgs='${pkgs.path}' arion down"); - $machine->waitUntilFails("curl localhost:8000"); - }; - }; - - $makeSubtest->("minimal", "${../../examples/minimal}"); - $makeSubtest->("full-nixos", "${../../examples/full-nixos}"); - $makeSubtest->("nixos-unit", "${../../examples/nixos-unit}"); - ''; -} diff --git a/tests/default.nix b/tests/default.nix index e134b37..d7a3c67 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,11 +1,12 @@ -{ pkgs ? import ../pkgs.nix, nixosTestIsPerl ? false, arionTestingFlags ? {} }: +{ pkgs ? import ../pkgs.nix, arionTestingFlags ? {} }: let inherit (pkgs) nixosTest recurseIntoAttrs arion; in recurseIntoAttrs { - test = if nixosTestIsPerl then nixosTest ./arion-test-perl else nixosTest ./arion-test; + test = nixosTest ./arion-test; + testWithPodman = if arionTestingFlags.nixosHasPodmanDockerSocket then nixosTest (pkgs.callPackage ./arion-test { usePodman = true; })