From d97875bc5f50389a931fa857691abba4127899b1 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sun, 10 Dec 2023 17:30:30 -0500 Subject: [PATCH 001/186] spotifywm: migrate to by-name --- .../spotifywm/default.nix => by-name/sp/spotifywm/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/audio/spotifywm/default.nix => by-name/sp/spotifywm/package.nix} (100%) diff --git a/pkgs/applications/audio/spotifywm/default.nix b/pkgs/by-name/sp/spotifywm/package.nix similarity index 100% rename from pkgs/applications/audio/spotifywm/default.nix rename to pkgs/by-name/sp/spotifywm/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 56dda5d65909..942e13ca7ab1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35524,8 +35524,6 @@ with pkgs; spotify-player = callPackage ../applications/audio/spotify-player { }; - spotifywm = callPackage ../applications/audio/spotifywm { }; - psst = callPackage ../applications/audio/psst { }; squeezelite = darwin.apple_sdk_11_0.callPackage ../applications/audio/squeezelite { From 2bc69ea034d5486ff687c00335ba2d020e7535d6 Mon Sep 17 00:00:00 2001 From: ocfox Date: Thu, 25 Jan 2024 02:11:22 +0800 Subject: [PATCH 002/186] transfer-sh: init at 1.6.1 --- pkgs/by-name/tr/transfer-sh/package.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkgs/by-name/tr/transfer-sh/package.nix diff --git a/pkgs/by-name/tr/transfer-sh/package.nix b/pkgs/by-name/tr/transfer-sh/package.nix new file mode 100644 index 000000000000..b30486848070 --- /dev/null +++ b/pkgs/by-name/tr/transfer-sh/package.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "transfer-sh"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "dutchcoders"; + repo = "transfer.sh"; + rev = "v${version}"; + hash = "sha256-V8E6RwzxKB6KeGPer5074e7y6XHn3ZD24PQMwTxw5lQ="; + }; + + vendorHash = "sha256-C8ZfUIGT9HiQQiJ2hk18uwGaQzNCIKp/Jiz6ePZkgDQ="; + + meta = with lib; { + description = "Easy and fast file sharing and pastebin server with access from the command-line"; + homepage = "https://github.com/dutchcoders/transfer.sh"; + changelog = "https://github.com/dutchcoders/transfer.sh/releases"; + mainProgram = "transfer.sh"; + license = licenses.mit; + maintainers = with maintainers; [ ocfox pinpox ]; + }; +} From 01e674ba9038a1943d6227468501eef08735ead2 Mon Sep 17 00:00:00 2001 From: ocfox Date: Thu, 25 Jan 2024 01:58:23 +0800 Subject: [PATCH 003/186] nixos/transfer-sh: init Co-authored-by: Pablo Ovelleiro Corral --- nixos/modules/module-list.nix | 1 + nixos/modules/services/misc/transfer-sh.nix | 102 ++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 nixos/modules/services/misc/transfer-sh.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 041169f0b052..4554cc333114 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -777,6 +777,7 @@ ./services/misc/tiddlywiki.nix ./services/misc/tp-auto-kbbl.nix ./services/misc/tuxclocker.nix + ./services/misc/transfer-sh.nix ./services/misc/tzupdate.nix ./services/misc/uhub.nix ./services/misc/weechat.nix diff --git a/nixos/modules/services/misc/transfer-sh.nix b/nixos/modules/services/misc/transfer-sh.nix new file mode 100644 index 000000000000..899d9dfc3c10 --- /dev/null +++ b/nixos/modules/services/misc/transfer-sh.nix @@ -0,0 +1,102 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.transfer-sh; + inherit (lib) + mkDefault mkEnableOption mkPackageOption mkIf mkOption + types mapAttrs isBool getExe boolToString mdDoc optionalAttrs; +in +{ + options.services.transfer-sh = { + enable = mkEnableOption (mdDoc "Easy and fast file sharing from the command-line"); + + package = mkPackageOption pkgs "transfer-sh" { }; + + settings = mkOption { + type = types.submodule { freeformType = with types; attrsOf (oneOf [ bool int str ]); }; + default = { }; + example = { + LISTENER = ":8080"; + BASEDIR = "/var/lib/transfer.sh"; + TLS_LISTENER_ONLY = false; + }; + description = mdDoc '' + Additional configuration for transfer-sh, see + + for supported values. + + For secrets use secretFile option instead. + ''; + }; + + provider = mkOption { + type = types.enum [ "local" "s3" "storj" "gdrive" ]; + default = "local"; + description = mdDoc "Storage providers to use"; + }; + + secretFile = mkOption { + type = types.nullOr types.path; + default = null; + example = "/run/secrets/transfer-sh.env"; + description = mdDoc '' + Path to file containing environment variables. + Useful for passing down secrets. + Some variables that can be considered secrets are: + - AWS_ACCESS_KEY + - AWS_ACCESS_KEY + - TLS_PRIVATE_KEY + - HTTP_AUTH_HTPASSWD + ''; + }; + }; + + config = + let + localProvider = (cfg.provider == "local"); + stateDirectory = "/var/lib/transfer.sh"; + in + mkIf cfg.enable + { + services.transfer-sh.settings = { + LISTENER = mkDefault ":8080"; + } // optionalAttrs localProvider { + BASEDIR = mkDefault stateDirectory; + }; + + systemd.services.transfer-sh = { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + environment = mapAttrs (_: v: if isBool v then boolToString v else toString v) cfg.settings; + serviceConfig = { + CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; + DevicePolicy = "closed"; + DynamicUser = true; + ExecStart = "${getExe cfg.package} --provider ${cfg.provider}"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + PrivateDevices = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; + RestrictNamespaces = true; + RestrictRealtime = true; + SystemCallArchitectures = [ "native" ]; + SystemCallFilter = [ "@system-service" ]; + StateDirectory = baseNameOf stateDirectory; + } // optionalAttrs (cfg.secretFile != null) { + EnvironmentFile = cfg.secretFile; + } // optionalAttrs localProvider { + ReadWritePaths = cfg.settings.BASEDIR; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ ocfox ]; +} From 2e4d7b7ad23ce9e95d828fe02d9ef5be3dd9e7be Mon Sep 17 00:00:00 2001 From: ocfox Date: Thu, 25 Jan 2024 12:23:53 +0800 Subject: [PATCH 004/186] nixosTests.transfer-sh: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/transfer-sh.nix | 20 ++++++++++++++++++++ pkgs/by-name/tr/transfer-sh/package.nix | 14 +++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/transfer-sh.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 1453a3875f6e..f8aa5d9e0fb5 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -901,6 +901,7 @@ in { tor = handleTest ./tor.nix {}; traefik = handleTestOn ["aarch64-linux" "x86_64-linux"] ./traefik.nix {}; trafficserver = handleTest ./trafficserver.nix {}; + transfer-sh = handleTest ./transfer-sh.nix {}; transmission = handleTest ./transmission.nix { transmission = pkgs.transmission; }; transmission_4 = handleTest ./transmission.nix { transmission = pkgs.transmission_4; }; # tracee requires bpf diff --git a/nixos/tests/transfer-sh.nix b/nixos/tests/transfer-sh.nix new file mode 100644 index 000000000000..f4ab7d28858e --- /dev/null +++ b/nixos/tests/transfer-sh.nix @@ -0,0 +1,20 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "transfer-sh"; + + meta = { + maintainers = with lib.maintainers; [ ocfox ]; + }; + + nodes.machine = { pkgs, ... }: { + services.transfer-sh = { + enable = true; + settings.LISTENER = ":1234"; + }; + }; + + testScript = '' + machine.wait_for_unit("transfer-sh.service") + machine.wait_for_open_port(1234) + machine.succeed("curl --fail http://localhost:1234/") + ''; +}) diff --git a/pkgs/by-name/tr/transfer-sh/package.nix b/pkgs/by-name/tr/transfer-sh/package.nix index b30486848070..d3b15ae2465b 100644 --- a/pkgs/by-name/tr/transfer-sh/package.nix +++ b/pkgs/by-name/tr/transfer-sh/package.nix @@ -1,4 +1,9 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib +, fetchFromGitHub +, buildGoModule +, nix-update-script +, nixosTests +}: buildGoModule rec { pname = "transfer-sh"; @@ -13,6 +18,13 @@ buildGoModule rec { vendorHash = "sha256-C8ZfUIGT9HiQQiJ2hk18uwGaQzNCIKp/Jiz6ePZkgDQ="; + passthru = { + tests = { + inherit (nixosTests) transfer-sh; + }; + updateScript = nix-update-script { }; + }; + meta = with lib; { description = "Easy and fast file sharing and pastebin server with access from the command-line"; homepage = "https://github.com/dutchcoders/transfer.sh"; From 77013c442ec421f5bc11da0b7a6ebb9953cd1bf3 Mon Sep 17 00:00:00 2001 From: ocfox Date: Thu, 25 Jan 2024 12:03:42 +0800 Subject: [PATCH 005/186] nixos/transfer-sh: add release note Co-authored-by: puzzlewolf --- nixos/doc/manual/release-notes/rl-2405.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 7be90e590085..900975581e39 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -53,6 +53,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [Anki Sync Server](https://docs.ankiweb.net/sync-server.html), the official sync server built into recent versions of Anki. Available as [services.anki-sync-server](#opt-services.anki-sync-server.enable). The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been marked deprecated and will be dropped after 24.05 due to lack of maintenance of the anki-sync-server softwares. +- [transfer-sh](https://github.com/dutchcoders/transfer.sh), a tool that supports easy and fast file sharing from the command-line. Available as [services.transfer-sh](#opt-services.transfer-sh.enable). + - [Suwayomi Server](https://github.com/Suwayomi/Suwayomi-Server), a free and open source manga reader server that runs extensions built for [Tachiyomi](https://tachiyomi.org). Available as [services.suwayomi-server](#opt-services.suwayomi-server.enable). - [ping_exporter](https://github.com/czerwonk/ping_exporter), a Prometheus exporter for ICMP echo requests. Available as [services.prometheus.exporters.ping](#opt-services.prometheus.exporters.ping.enable). From 0672c66c6a64d83127852fbd49265a203ce364e0 Mon Sep 17 00:00:00 2001 From: Kiskae Date: Mon, 29 Jan 2024 17:05:36 +0100 Subject: [PATCH 006/186] composefs: 1.0.2 -> 1.0.3 --- pkgs/by-name/co/composefs/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/co/composefs/package.nix b/pkgs/by-name/co/composefs/package.nix index eec9ef0de853..d83acd06e24b 100644 --- a/pkgs/by-name/co/composefs/package.nix +++ b/pkgs/by-name/co/composefs/package.nix @@ -23,13 +23,13 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "composefs"; - version = "1.0.2"; + version = "1.0.3"; src = fetchFromGitHub { owner = "containers"; repo = "composefs"; rev = "v${finalAttrs.version}"; - hash = "sha256-ViZkmuLFV5DN1nqWKGl+yaqhYUEOztZ1zGpxjr1U/dw="; + hash = "sha256-YmredtZZKMjzJW/kxiTUmdgO/1iPIKzJsuJz8DeEdGM="; }; strictDeps = true; From dc2e2dbdc4cca96b0c6a0546e11d1bb01c35f49f Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 21 Jan 2024 15:58:08 +0100 Subject: [PATCH 007/186] python3Packages.mmengine: disable failing tests Signed-off-by: Sefa Eyeoglu --- pkgs/development/python-modules/mmengine/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/mmengine/default.nix b/pkgs/development/python-modules/mmengine/default.nix index dd4e9095325f..347d22d569e0 100644 --- a/pkgs/development/python-modules/mmengine/default.nix +++ b/pkgs/development/python-modules/mmengine/default.nix @@ -69,6 +69,10 @@ buildPythonPackage rec { disabledTestPaths = [ # AttributeError "tests/test_fileio/test_backends/test_petrel_backend.py" + # Freezes forever? + "tests/test_runner/test_activation_checkpointing.py" + # missing dependencies + "tests/test_visualizer/test_vis_backend.py" ]; disabledTests = [ From a72076da44595d07a4e17a0247c13a77bb4ff79c Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Mon, 15 Jan 2024 15:43:13 -0500 Subject: [PATCH 008/186] maintainers: add leonm1 --- maintainers/maintainer-list.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index ee990c47c21e..6c8efe9c0bb3 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -10711,6 +10711,15 @@ githubId = 77865363; name = "Leonid Belyaev"; }; + leonm1 = { + github = "leonm1"; + githubId = 32306579; + keys = [{ + fingerprint = "C12D F14B DC9D 64E1 44C3 4D8A 755C DA4E 5923 416A"; + }]; + matrix = "@mattleon:matrix.org"; + name = "Matt Leon"; + }; leshainc = { email = "leshainc@fomalhaut.me"; github = "LeshaInc"; From 6d6935549997ea39cf5fa534c75456409c175482 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Sat, 28 Oct 2023 23:15:36 -0400 Subject: [PATCH 009/186] python-matter-server: link PAA certificates locally python-matter-server redownloads these certs on every startup and device commissioning. The development certificates used by default do not seem to change frequently (see https://github.com/project-chip/connectedhomeip/commits/v1.2.0.1/credentials/development/paa-root-certs), so we should be able to make the derivation pure by simply linking to the git repo directly. --- .../python-matter-server/default.nix | 32 +++++ .../link-paa-root-certs.patch | 126 ++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 pkgs/development/python-modules/python-matter-server/link-paa-root-certs.patch diff --git a/pkgs/development/python-modules/python-matter-server/default.nix b/pkgs/development/python-modules/python-matter-server/default.nix index 570ee23fcbf4..751880e45546 100644 --- a/pkgs/development/python-modules/python-matter-server/default.nix +++ b/pkgs/development/python-modules/python-matter-server/default.nix @@ -2,6 +2,8 @@ , buildPythonPackage , fetchFromGitHub , pythonOlder +, stdenvNoCC +, substituteAll # build , setuptools @@ -27,6 +29,29 @@ , pytestCheckHook }: +let + paaCerts = stdenvNoCC.mkDerivation rec { + pname = "matter-server-paa-certificates"; + version = "1.2.0.1"; + + src = fetchFromGitHub { + owner = "project-chip"; + repo = "connectedhomeip"; + rev = "refs/tags/v${version}"; + hash = "sha256-p3P0n5oKRasYz386K2bhN3QVfN6oFndFIUWLEUWB0ss="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp $src/credentials/development/paa-root-certs/* $out/ + + runHook postInstall + ''; + }; +in + buildPythonPackage rec { pname = "python-matter-server"; version = "5.5.3"; @@ -41,6 +66,13 @@ buildPythonPackage rec { hash = "sha256-8daAABR5l8ZEX+PR4XrxRHlLllgnOVE4Q9yY/7UQXHw="; }; + patches = [ + (substituteAll { + src = ./link-paa-root-certs.patch; + paacerts = paaCerts; + }) + ]; + postPatch = '' substituteInPlace pyproject.toml \ --replace 'version = "0.0.0"' 'version = "${version}"' diff --git a/pkgs/development/python-modules/python-matter-server/link-paa-root-certs.patch b/pkgs/development/python-modules/python-matter-server/link-paa-root-certs.patch new file mode 100644 index 000000000000..a788f69144b8 --- /dev/null +++ b/pkgs/development/python-modules/python-matter-server/link-paa-root-certs.patch @@ -0,0 +1,126 @@ +diff --git a/matter_server/server/const.py b/matter_server/server/const.py +index b6cd839..f9f798f 100644 +--- a/matter_server/server/const.py ++++ b/matter_server/server/const.py +@@ -5,14 +5,4 @@ from typing import Final + # The minimum schema version (of a client) the server can support + MIN_SCHEMA_VERSION = 5 + +-# the paa-root-certs path is hardcoded in the sdk at this time +-# and always uses the development subfolder +-# regardless of anything you pass into instantiating the controller +-# revisit this once matter 1.1 is released +-PAA_ROOT_CERTS_DIR: Final[pathlib.Path] = ( +- pathlib.Path(__file__) +- .parent.resolve() +- .parent.resolve() +- .parent.resolve() +- .joinpath("credentials/development/paa-root-certs") +-) ++PAA_ROOT_CERTS_DIR: Final[pathlib.Path] = pathlib.Path("@paacerts@") +diff --git a/matter_server/server/helpers/paa_certificates.py b/matter_server/server/helpers/paa_certificates.py +index 9ac5a10..25230c1 100644 +--- a/matter_server/server/helpers/paa_certificates.py ++++ b/matter_server/server/helpers/paa_certificates.py +@@ -58,84 +58,14 @@ async def fetch_dcl_certificates( + fetch_production_certificates: bool = True, + ) -> int: + """Fetch DCL PAA Certificates.""" +- LOGGER.info("Fetching the latest PAA root certificates from DCL.") +- if not PAA_ROOT_CERTS_DIR.is_dir(): +- loop = asyncio.get_running_loop() +- await loop.run_in_executor(None, makedirs, PAA_ROOT_CERTS_DIR) +- fetch_count: int = 0 +- base_urls = set() +- # determine which url's need to be queried. +- # if we're going to fetch both prod and test, do test first +- # so any duplicates will be overwritten/preferred by the production version +- # NOTE: While Matter is in BETA we fetch the test certificates by default +- if fetch_test_certificates: +- base_urls.add(TEST_URL) +- if fetch_production_certificates: +- base_urls.add(PRODUCTION_URL) + +- try: +- async with ClientSession(raise_for_status=True) as http_session: +- for url_base in base_urls: +- # fetch the paa certificates list +- async with http_session.get( +- f"{url_base}/dcl/pki/root-certificates" +- ) as response: +- result = await response.json() +- paa_list = result["approvedRootCertificates"]["certs"] +- # grab each certificate +- for paa in paa_list: +- # do not fetch a certificate if we already fetched it +- if paa["subjectKeyId"] in LAST_CERT_IDS: +- continue +- async with http_session.get( +- f"{url_base}/dcl/pki/certificates/{paa['subject']}/{paa['subjectKeyId']}" +- ) as response: +- result = await response.json() +- +- certificate_data: dict = result["approvedCertificates"]["certs"][0] +- certificate: str = certificate_data["pemCert"] +- subject = certificate_data["subjectAsText"] +- certificate = certificate.rstrip("\n") +- +- await write_paa_root_cert( +- certificate, +- subject, +- ) +- LAST_CERT_IDS.add(paa["subjectKeyId"]) +- fetch_count += 1 +- except ClientError as err: +- LOGGER.warning( +- "Fetching latest certificates failed: error %s", err, exc_info=err +- ) +- else: +- LOGGER.info("Fetched %s PAA root certificates from DCL.", fetch_count) +- +- return fetch_count ++ return 0 + + + async def fetch_git_certificates() -> int: + """Fetch Git PAA Certificates.""" +- fetch_count = 0 +- LOGGER.info("Fetching the latest PAA root certificates from Git.") +- try: +- async with ClientSession(raise_for_status=True) as http_session: +- for cert in GIT_CERTS: +- if cert in LAST_CERT_IDS: +- continue + +- async with http_session.get(f"{GIT_URL}/{cert}.pem") as response: +- certificate = await response.text() +- await write_paa_root_cert(certificate, cert) +- LAST_CERT_IDS.add(cert) +- fetch_count += 1 +- except ClientError as err: +- LOGGER.warning( +- "Fetching latest certificates failed: error %s", err, exc_info=err +- ) +- +- LOGGER.info("Fetched %s PAA root certificates from Git.", fetch_count) +- +- return fetch_count ++ return 0 + + + async def fetch_certificates( +@@ -144,12 +74,4 @@ async def fetch_certificates( + ) -> int: + """Fetch PAA Certificates.""" + +- fetch_count = await fetch_dcl_certificates( +- fetch_test_certificates=fetch_test_certificates, +- fetch_production_certificates=fetch_production_certificates, +- ) +- +- if fetch_test_certificates: +- fetch_count += await fetch_git_certificates() +- +- return fetch_count ++ return 0 + From c0846f900a71e9bde3bf292882506cbb7cc97528 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Sat, 28 Oct 2023 23:16:44 -0400 Subject: [PATCH 010/186] matter-server: add nixos service module New module to run the python-matter-server executable as a sandboxed system service. --- .../manual/release-notes/rl-2405.section.md | 4 + nixos/modules/module-list.nix | 1 + .../home-automation/matter-server.nix | 125 ++++++++++++++++++ nixos/tests/all-tests.nix | 1 + nixos/tests/matter-server.nix | 45 +++++++ 5 files changed, 176 insertions(+) create mode 100644 nixos/modules/services/home-automation/matter-server.nix create mode 100644 nixos/tests/matter-server.nix diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 70ee02183f4f..93d7aea124fd 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -62,6 +62,10 @@ In addition to numerous new and upgraded packages, this release has the followin - [hebbot](https://github.com/haecker-felix/hebbot), a Matrix bot to generate "This Week in X" like blog posts. Available as [services.hebbot](#opt-services.hebbot.enable). +- [Python Matter Server](https://github.com/home-assistant-libs/python-matter-server), a + Matter Controller Server exposing websocket connections for use with other services, notably Home Assistant. + Available as [services.matter-server](#opt-services.matter-server.enable) + - [Anki Sync Server](https://docs.ankiweb.net/sync-server.html), the official sync server built into recent versions of Anki. Available as [services.anki-sync-server](#opt-services.anki-sync-server.enable). The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been marked deprecated and will be dropped after 24.05 due to lack of maintenance of the anki-sync-server softwares. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ec022713e12e..fedded7a5f3f 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -580,6 +580,7 @@ ./services/home-automation/govee2mqtt.nix ./services/home-automation/home-assistant.nix ./services/home-automation/homeassistant-satellite.nix + ./services/home-automation/matter-server.nix ./services/home-automation/zigbee2mqtt.nix ./services/home-automation/zwave-js.nix ./services/logging/SystemdJournal2Gelf.nix diff --git a/nixos/modules/services/home-automation/matter-server.nix b/nixos/modules/services/home-automation/matter-server.nix new file mode 100644 index 000000000000..864ef9e20083 --- /dev/null +++ b/nixos/modules/services/home-automation/matter-server.nix @@ -0,0 +1,125 @@ +{ lib +, pkgs +, config +, ... +}: + +with lib; + +let + cfg = config.services.matter-server; + storageDir = "matter-server"; + storagePath = "/var/lib/${storageDir}"; + vendorId = "4939"; # home-assistant vendor ID +in + +{ + meta.maintainers = with lib.maintainers; [ leonm1 ]; + + options.services.matter-server = with types; { + enable = mkEnableOption (lib.mdDoc "Matter-server"); + + package = mkPackageOptionMD pkgs "python-matter-server" { }; + + port = mkOption { + type = types.port; + default = 5580; + description = "Port to expose the matter-server service on."; + }; + + logLevel = mkOption { + type = types.enum [ "critical" "error" "warning" "info" "debug" ]; + default = "info"; + description = "Verbosity of logs from the matter-server"; + }; + + extraArgs = mkOption { + type = listOf str; + default = []; + description = '' + Extra arguments to pass to the matter-server executable. + See https://github.com/home-assistant-libs/python-matter-server?tab=readme-ov-file#running-the-development-server for options. + ''; + }; + }; + + config = mkIf cfg.enable { + systemd.services.matter-server = { + after = [ "network-online.target" ]; + before = [ "home-assistant.service" ]; + wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + description = "Matter Server"; + environment.HOME = storagePath; + serviceConfig = { + ExecStart = (concatStringsSep " " [ + "${cfg.package}/bin/matter-server" + "--port" (toString cfg.port) + "--vendorid" vendorId + "--storage-path" storagePath + "--log-level" "${cfg.logLevel}" + "${escapeShellArgs cfg.extraArgs}" + ]); + # Start with a clean root filesystem, and allowlist what the container + # is permitted to access. + TemporaryFileSystem = "/"; + # Allowlist /nix/store (to allow the binary to find its dependencies) + # and dbus. + ReadOnlyPaths = "/nix/store /run/dbus"; + # Let systemd manage `/var/lib/matter-server` for us inside the + # ephemeral TemporaryFileSystem. + StateDirectory = storageDir; + # `python-matter-server` writes to /data even when a storage-path is + # specified. This bind-mount points /data at the systemd-managed + # /var/lib/matter-server, so all files get dropped into the state + # directory. + BindPaths = "${storagePath}:/data"; + + # Hardening bits + AmbientCapabilities = ""; + CapabilityBoundingSet = ""; + DevicePolicy = "closed"; + DynamicUser = true; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateTmp = true; + PrivateUsers = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_NETLINK" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallFilter = concatStringsSep " " [ + "~" # Blocklist + "@clock" + "@cpu-emulation" + "@debug" + "@module" + "@mount" + "@obsolete" + "@privileged" + "@raw-io" + "@reboot" + "@resources" + "@swap" + ]; + UMask = "0077"; + }; + }; + }; +} + diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 31af6ec64214..11753128e747 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -510,6 +510,7 @@ in { mastodon = discoverTests (import ./web-apps/mastodon { inherit handleTestOn; }); pixelfed = discoverTests (import ./web-apps/pixelfed { inherit handleTestOn; }); mate = handleTest ./mate.nix {}; + matter-server = handleTest ./matter-server.nix {}; matomo = handleTest ./matomo.nix {}; matrix-appservice-irc = handleTest ./matrix/appservice-irc.nix {}; matrix-conduit = handleTest ./matrix/conduit.nix {}; diff --git a/nixos/tests/matter-server.nix b/nixos/tests/matter-server.nix new file mode 100644 index 000000000000..c646e9840d19 --- /dev/null +++ b/nixos/tests/matter-server.nix @@ -0,0 +1,45 @@ +import ./make-test-python.nix ({ pkgs, lib, ...} : + +let + chipVersion = pkgs.python311Packages.home-assistant-chip-core.version; +in + +{ + name = "matter-server"; + meta.maintainers = with lib.maintainers; [ leonm1 ]; + + nodes = { + machine = { config, ... }: { + services.matter-server = { + enable = true; + port = 1234; + }; + }; + }; + + testScript = /* python */ '' + start_all() + + machine.wait_for_unit("matter-server.service") + machine.wait_for_open_port(1234) + + with subtest("Check websocket server initialized"): + output = machine.succeed("echo \"\" | ${pkgs.websocat}/bin/websocat ws://localhost:1234/ws") + machine.log(output) + + assert '"sdk_version": "${chipVersion}"' in output, ( + 'CHIP version \"${chipVersion}\" not present in websocket message' + ) + + assert '"fabric_id": 1' in output, ( + "fabric_id not propagated to server" + ) + + with subtest("Check storage directory is created"): + machine.succeed("ls /var/lib/matter-server/chip.json") + + with subtest("Check systemd hardening"): + _, output = machine.execute("systemd-analyze security matter-server.service | grep -v '✓'") + machine.log(output) + ''; +}) From ac04ecbace9586d12250bef0052d95bce230b48b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 14 Feb 2024 23:34:18 +0000 Subject: [PATCH 011/186] wofi: 1.4 -> 1.4.1 --- pkgs/applications/misc/wofi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/wofi/default.nix b/pkgs/applications/misc/wofi/default.nix index 97aba94d1770..30e7072644f3 100644 --- a/pkgs/applications/misc/wofi/default.nix +++ b/pkgs/applications/misc/wofi/default.nix @@ -11,13 +11,13 @@ }: stdenv.mkDerivation rec { pname = "wofi"; - version = "1.4"; + version = "1.4.1"; src = fetchFromSourcehut { repo = pname; owner = "~scoopta"; rev = "v${version}"; - sha256 = "sha256-zzBD1OPPlOjAUaJOlMf6k1tSai1w1ZvOwy2sSOWI7AM="; + sha256 = "sha256-aedoUhVfk8ljmQ23YxVmGZ00dPpRftW2dnRAgXmtV/w="; vc = "hg"; }; From 712ac796e5be1c6bcafad54d46b7cdcd7fdc7bcb Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 19 Feb 2024 22:02:27 +0100 Subject: [PATCH 012/186] tests.nixpkgs-check-by-name: Improve inherit detection Detect inherit's better, such that a future commit can use this information in an error message --- .../nixpkgs-check-by-name/src/nix_file.rs | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index 836c5e2dcdda..ea0833792f3c 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -5,7 +5,6 @@ use anyhow::Context; use rnix::ast; use rnix::ast::Expr; use rnix::ast::HasEntry; -use rnix::SyntaxKind; use rowan::ast::AstNode; use rowan::TextSize; use rowan::TokenAtOffset; @@ -158,6 +157,22 @@ impl NixFile { ) }; + if ast::Attr::can_cast(node.kind()) { + // Something like `foo`, `"foo"` or `${"foo"}` + } else if ast::Inherit::can_cast(node.kind()) { + // Something like `inherit ` or `inherit () ` + // This is the only other way how `builtins.unsafeGetAttrPos` can return + // attribute positions, but we only look for ones like ` = `, so + // ignore this + return Ok(None); + } else { + // However, anything else is not expected and smells like a bug + anyhow::bail!( + "Node in {} is neither an attribute node, nor an inherit node: {node:?}", + self.path.display() + ) + } + // node looks like "foo" let Some(attrpath_node) = node.parent() else { anyhow::bail!( @@ -166,10 +181,14 @@ impl NixFile { ) }; - if attrpath_node.kind() != SyntaxKind::NODE_ATTRPATH { - // This can happen for e.g. `inherit foo`, so definitely not a syntactic `callPackage` - return Ok(None); + if !ast::Attrpath::can_cast(attrpath_node.kind()) { + // We know that `node` is an attribute, its parent should be an attribute path + anyhow::bail!( + "In {}, attribute parent node is not an attribute path node: {attrpath_node:?}", + self.path.display() + ) } + // attrpath_node looks like "foo.bar" let Some(attrpath_value_node) = attrpath_node.parent() else { anyhow::bail!( @@ -408,6 +427,7 @@ mod tests { /**/quuux/**/=/**/5/**/;/*E*/ inherit toInherit; + inherit (toInherit) toInherit; } "#}; @@ -424,11 +444,13 @@ mod tests { (8, 3, Some("quux\n # B\n =\n # C\n 5\n # D\n ;")), (17, 7, Some("quuux/**/=/**/5/**/;")), (19, 10, None), + (20, 22, None), ]; for (line, column, expected_result) in cases { let actual_result = nix_file - .attrpath_value_at(line, column)? + .attrpath_value_at(line, column) + .context(format!("line {line}, column {column}"))? .map(|node| node.to_string()); assert_eq!(actual_result.as_deref(), expected_result); } @@ -501,7 +523,9 @@ mod tests { ]; for (line, expected_result) in cases { - let actual_result = nix_file.call_package_argument_info_at(line, 3, temp_dir.path())?; + let actual_result = nix_file + .call_package_argument_info_at(line, 3, temp_dir.path()) + .context(format!("line {line}"))?; assert_eq!(actual_result, expected_result); } From a61c8c9f5c19030102f62820db1ad037311702f7 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 19 Feb 2024 22:28:01 +0100 Subject: [PATCH 013/186] tests.nixpkgs-check-by-name: Fix allowing non-path overrides An edge case was allowed when it shouldn't be: A package defined in `pkgs/by-name` could be overridden in `all-packages.nix` if it was of the form `callPackage () { }`. This is not right, it's required that the first argument be the path matching the package to be overridden. --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 36 +++++++++---------- .../tests/override-non-path/all-packages.nix | 5 +++ .../tests/override-non-path/default.nix | 1 + .../tests/override-non-path/expected | 1 + .../pkgs/by-name/fo/foo/package.nix | 1 + 5 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/override-non-path/all-packages.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/override-non-path/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/override-non-path/pkgs/by-name/fo/foo/package.nix diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index e90a95533144..1322f0faaf91 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -195,7 +195,6 @@ fn by_name( use ByNameAttribute::*; let relative_package_file = structure::relative_file_for_package(attribute_name); - let absolute_package_file = nixpkgs_path.join(&relative_package_file); // At this point we know that `pkgs/by-name/fo/foo/package.nix` has to exists. // This match decides whether the attribute `foo` is defined accordingly @@ -284,23 +283,17 @@ fn by_name( .call_package_argument_info_at( location.line, location.column, - // We're passing `pkgs/by-name/fo/foo/package.nix` here, which causes - // the function to verify that `` is the same path, - // making `syntactic_call_package.relative_path` end up as `""` - // TODO: This is confusing and should be improved - &absolute_package_file, + nixpkgs_path, )?; // At this point, we completed two different checks for whether it's a // `callPackage` match (is_semantic_call_package, optional_syntactic_call_package) { // Something like ` = { ... }` - // or a `pkgs.callPackage` but with the wrong file (false, None) - // Something like ` = pythonPackages.callPackage ./pkgs/by-name/...` + // Something like ` = pythonPackages.callPackage ...` | (false, Some(_)) // Something like ` = bar` where `bar = pkgs.callPackage ...` - // or a `callPackage` but with the wrong file | (true, None) => { // All of these are not of the expected form, so error out // TODO: Make error more specific, don't lump everything together @@ -309,18 +302,25 @@ fn by_name( package_name: attribute_name.to_owned(), }.into() } - // Something like ` = pkgs.callPackage ./pkgs/by-name/...`, - // with the correct file + // Something like ` = pkgs.callPackage ...` (true, Some(syntactic_call_package)) => { - Success( - // Manual definitions with empty arguments are not allowed - // anymore - if syntactic_call_package.empty_arg { - Loose(()) + if let Some(path) = syntactic_call_package.relative_path { + if path == relative_package_file { + // Manual definitions with empty arguments are not allowed + // anymore + Success(if syntactic_call_package.empty_arg { Loose(()) } else { Tight }) } else { - Tight + NixpkgsProblem::WrongCallPackage { + relative_package_file: relative_package_file.to_owned(), + package_name: attribute_name.to_owned(), + }.into() } - ) + } else { + NixpkgsProblem::WrongCallPackage { + relative_package_file: relative_package_file.to_owned(), + package_name: attribute_name.to_owned(), + }.into() + } } } } else { diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/all-packages.nix new file mode 100644 index 000000000000..f07e7a42744a --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/all-packages.nix @@ -0,0 +1,5 @@ +self: super: { + + foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; + +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected new file mode 100644 index 000000000000..9df788191ece --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -0,0 +1 @@ +pkgs.foo: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/fo/foo/package.nix { ... }` with a non-empty second argument. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/pkgs/by-name/fo/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/pkgs/by-name/fo/foo/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/pkgs/by-name/fo/foo/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv From 24069b982dcb3b64bb3de2fc3c7b3463f4b00723 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 19 Feb 2024 23:35:18 +0100 Subject: [PATCH 014/186] tests.nixpkgs-check-by-name: Better error for non-syntactic callPackage --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 70 ++++++++++++----- .../nixpkgs-check-by-name/src/nix_file.rs | 75 +++++++++++-------- .../src/nixpkgs_problem.rs | 13 ++++ .../expected | 3 +- .../tests/override-no-call-package/expected | 3 +- 5 files changed, 111 insertions(+), 53 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index 1322f0faaf91..122c4b734897 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -51,6 +51,26 @@ struct Location { pub column: usize, } +impl Location { + // Creates a [String] from a [Location], in a format like `{file}:{line}:{column}`, + // where `file` is relative to the given [Path]. + fn to_relative_string(&self, nixpkgs_path: &Path) -> anyhow::Result { + let relative = self.file.strip_prefix(nixpkgs_path).with_context(|| { + format!( + "An attributes location ({}) is outside Nixpkgs ({})", + self.file.display(), + nixpkgs_path.display() + ) + })?; + Ok(format!( + "{}:{}:{}", + relative.display(), + self.line, + self.column + )) + } +} + #[derive(Deserialize)] pub enum AttributeVariant { /// The attribute is not an attribute set, we're limited in the amount of information we can get @@ -289,37 +309,47 @@ fn by_name( // At this point, we completed two different checks for whether it's a // `callPackage` match (is_semantic_call_package, optional_syntactic_call_package) { - // Something like ` = { ... }` - (false, None) + // Something like ` = foo` + (_, Err(definition)) => NixpkgsProblem::NonSyntacticCallPackage { + package_name: attribute_name.to_owned(), + location: location.to_relative_string(nixpkgs_path)?, + definition, + } + .into(), // Something like ` = pythonPackages.callPackage ...` - | (false, Some(_)) - // Something like ` = bar` where `bar = pkgs.callPackage ...` - | (true, None) => { + (false, Ok(_)) => { // All of these are not of the expected form, so error out // TODO: Make error more specific, don't lump everything together NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), - package_name: attribute_name.to_owned(), - }.into() + relative_package_file: relative_package_file.to_owned(), + package_name: attribute_name.to_owned(), + } + .into() } // Something like ` = pkgs.callPackage ...` - (true, Some(syntactic_call_package)) => { + (true, Ok(syntactic_call_package)) => { if let Some(path) = syntactic_call_package.relative_path { if path == relative_package_file { // Manual definitions with empty arguments are not allowed // anymore - Success(if syntactic_call_package.empty_arg { Loose(()) } else { Tight }) + Success(if syntactic_call_package.empty_arg { + Loose(()) + } else { + Tight + }) } else { NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), - package_name: attribute_name.to_owned(), - }.into() + relative_package_file: relative_package_file.to_owned(), + package_name: attribute_name.to_owned(), + } + .into() } } else { NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), - package_name: attribute_name.to_owned(), - }.into() + relative_package_file: relative_package_file.to_owned(), + package_name: attribute_name.to_owned(), + } + .into() } } } @@ -423,16 +453,16 @@ fn handle_non_by_name_attribute( // `callPackage` match (is_semantic_call_package, optional_syntactic_call_package) { // Something like ` = { }` - (false, None) + (false, Err(_)) // Something like ` = pythonPackages.callPackage ...` - | (false, Some(_)) + | (false, Ok(_)) // Something like ` = bar` where `bar = pkgs.callPackage ...` - | (true, None) => { + | (true, Err(_)) => { // In all of these cases, it's not possible to migrate the package to `pkgs/by-name` NonApplicable } // Something like ` = pkgs.callPackage ...` - (true, Some(syntactic_call_package)) => { + (true, Ok(syntactic_call_package)) => { // It's only possible to migrate such a definitions if.. match syntactic_call_package.relative_path { Some(ref rel_path) if rel_path.starts_with(utils::BASE_SUBPATH) => { diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index ea0833792f3c..3840f1dc479d 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -86,8 +86,9 @@ pub struct CallPackageArgumentInfo { impl NixFile { /// Returns information about callPackage arguments for an attribute at a specific line/column /// index. - /// If the location is not of the form ` = callPackage ;`, `None` is - /// returned. + /// If the location is not of the form ` = callPackage ;`, `Ok(Err(String))` is + /// returned, with String being how the definition looks like. + /// /// This function only returns `Err` for problems that can't be caused by the Nix contents, /// but rather problems in this programs code itself. /// @@ -108,7 +109,7 @@ impl NixFile { /// /// You'll get back /// ```rust - /// Some(CallPackageArgumentInfo { path = Some("default.nix"), empty_arg: true }) + /// Ok(Ok(CallPackageArgumentInfo { path = Some("default.nix"), empty_arg: true })) /// ``` /// /// Note that this also returns the same for `pythonPackages.callPackage`. It doesn't make an @@ -118,11 +119,15 @@ impl NixFile { line: usize, column: usize, relative_to: &Path, - ) -> anyhow::Result> { - let Some(attrpath_value) = self.attrpath_value_at(line, column)? else { - return Ok(None); - }; - self.attrpath_value_call_package_argument_info(attrpath_value, relative_to) + ) -> anyhow::Result> { + Ok(match self.attrpath_value_at(line, column)? { + Err(definition) => Err(definition), + Ok(attrpath_value) => { + let definition = attrpath_value.to_string(); + self.attrpath_value_call_package_argument_info(attrpath_value, relative_to)? + .ok_or(definition) + } + }) } // Internal function mainly to make it independently testable @@ -130,7 +135,7 @@ impl NixFile { &self, line: usize, column: usize, - ) -> anyhow::Result> { + ) -> anyhow::Result> { let index = self.line_index.fromlinecolumn(line, column); let token_at_offset = self @@ -164,7 +169,7 @@ impl NixFile { // This is the only other way how `builtins.unsafeGetAttrPos` can return // attribute positions, but we only look for ones like ` = `, so // ignore this - return Ok(None); + return Ok(Err(node.to_string())); } else { // However, anything else is not expected and smells like a bug anyhow::bail!( @@ -208,7 +213,7 @@ impl NixFile { // unwrap is fine because we confirmed that we can cast with the above check. // We could avoid this `unwrap` for a `clone`, since `cast` consumes the argument, // but we still need it for the error message when the cast fails. - Ok(Some(ast::AttrpathValue::cast(attrpath_value_node).unwrap())) + Ok(Ok(ast::AttrpathValue::cast(attrpath_value_node).unwrap())) } // Internal function mainly to make attrpath_value_at independently testable @@ -437,14 +442,14 @@ mod tests { // These are builtins.unsafeGetAttrPos locations for the attributes let cases = [ - (2, 3, Some("foo = 1;")), - (3, 3, Some(r#""bar" = 2;"#)), - (4, 3, Some(r#"${"baz"} = 3;"#)), - (5, 3, Some(r#""${"qux"}" = 4;"#)), - (8, 3, Some("quux\n # B\n =\n # C\n 5\n # D\n ;")), - (17, 7, Some("quuux/**/=/**/5/**/;")), - (19, 10, None), - (20, 22, None), + (2, 3, Ok("foo = 1;")), + (3, 3, Ok(r#""bar" = 2;"#)), + (4, 3, Ok(r#"${"baz"} = 3;"#)), + (5, 3, Ok(r#""${"qux"}" = 4;"#)), + (8, 3, Ok("quux\n # B\n =\n # C\n 5\n # D\n ;")), + (17, 7, Ok("quuux/**/=/**/5/**/;")), + (19, 10, Err("inherit toInherit;")), + (20, 22, Err("inherit (toInherit) toInherit;")), ]; for (line, column, expected_result) in cases { @@ -452,7 +457,13 @@ mod tests { .attrpath_value_at(line, column) .context(format!("line {line}, column {column}"))? .map(|node| node.to_string()); - assert_eq!(actual_result.as_deref(), expected_result); + let owned_expected_result = expected_result + .map(|x| x.to_string()) + .map_err(|x| x.to_string()); + assert_eq!( + actual_result, owned_expected_result, + "line {line}, column {column}" + ); } Ok(()) @@ -481,41 +492,41 @@ mod tests { let nix_file = NixFile::new(&file)?; let cases = [ - (2, None), - (3, None), - (4, None), - (5, None), + (2, Err("a.sub = null;")), + (3, Err("b = null;")), + (4, Err("c = import ./file.nix;")), + (5, Err("d = import ./file.nix { };")), ( 6, - Some(CallPackageArgumentInfo { + Ok(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: true, }), ), ( 7, - Some(CallPackageArgumentInfo { + Ok(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: true, }), ), ( 8, - Some(CallPackageArgumentInfo { + Ok(CallPackageArgumentInfo { relative_path: None, empty_arg: true, }), ), ( 9, - Some(CallPackageArgumentInfo { + Ok(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: false, }), ), ( 10, - Some(CallPackageArgumentInfo { + Ok(CallPackageArgumentInfo { relative_path: None, empty_arg: false, }), @@ -525,8 +536,10 @@ mod tests { for (line, expected_result) in cases { let actual_result = nix_file .call_package_argument_info_at(line, 3, temp_dir.path()) - .context(format!("line {line}"))?; - assert_eq!(actual_result, expected_result); + .context(format!("line {line}"))? + .map_err(|x| x); + let owned_expected_result = expected_result.map_err(|x| x.to_string()); + assert_eq!(actual_result, owned_expected_result, "line {line}"); } Ok(()) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index e13869adaa41..18001eb44ecd 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -44,6 +44,11 @@ pub enum NixpkgsProblem { relative_package_file: PathBuf, package_name: String, }, + NonSyntacticCallPackage { + package_name: String, + location: String, + definition: String, + }, NonDerivation { relative_package_file: PathBuf, package_name: String, @@ -164,6 +169,14 @@ impl fmt::Display for NixpkgsProblem { "pkgs.{package_name}: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage {} {{ ... }}` with a non-empty second argument.", relative_package_file.display() ), + NixpkgsProblem::NonSyntacticCallPackage { package_name, location, definition } => + write!( + f, + "Because {} exists, the attribute `pkgs.{package_name}` must be defined as `callPackage {} {{ ... }}`. This is however not the case: The attribute is defined in {location} as\n\t{}", + structure::relative_dir_for_package(package_name).display(), + structure::relative_file_for_package(package_name).display(), + definition, + ), NixpkgsProblem::NonDerivation { relative_package_file, package_name } => write!( f, diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index 9df788191ece..f590ef4ff9fa 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -1 +1,2 @@ -pkgs.foo: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/fo/foo/package.nix { ... }` with a non-empty second argument. +Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined as `callPackage pkgs/by-name/fo/foo/package.nix { ... }`. This is however not the case: The attribute is defined in all-packages.nix:4:3 as + foo = self.bar; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index 51479e22d26f..25fc867b04fe 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -1 +1,2 @@ -pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument. +Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined as `callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }`. This is however not the case: The attribute is defined in all-packages.nix:2:3 as + nonDerivation = self.someDrv; From 9b89ddcab78486dafae41e83205add23950c3f18 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 20 Feb 2024 23:30:30 +0000 Subject: [PATCH 015/186] twitterBootstrap: 5.3.2 -> 5.3.3 --- pkgs/development/web/twitter-bootstrap/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/twitter-bootstrap/default.nix b/pkgs/development/web/twitter-bootstrap/default.nix index 86b35decf676..328154ef810f 100644 --- a/pkgs/development/web/twitter-bootstrap/default.nix +++ b/pkgs/development/web/twitter-bootstrap/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "bootstrap"; - version = "5.3.2"; + version = "5.3.3"; src = fetchurl { url = "https://github.com/twbs/bootstrap/releases/download/v${finalAttrs.version}/bootstrap-${finalAttrs.version}-dist.zip"; - hash = "sha256-hUlReGqLkaBeQ9DyIATFyddhdeFv1vUNeTnnsBhMPgk="; + hash = "sha256-WwokWrhFiVFmjSn9FJ/GyOY8Z2l378I4IqIjwIJF3ho="; }; nativeBuildInputs = [ unzip ]; From a53b07e2523978518efc6ae161ef9ffba7933d6e Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 22 Feb 2024 23:04:40 +0100 Subject: [PATCH 016/186] tests.nixpkgs-check-by-name: Improve error for wrong package file --- pkgs/test/nixpkgs-check-by-name/Cargo.lock | 7 +++ pkgs/test/nixpkgs-check-by-name/Cargo.toml | 3 +- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 63 +++++++++++-------- pkgs/test/nixpkgs-check-by-name/src/main.rs | 2 +- .../src/nixpkgs_problem.rs | 53 +++++++++++++++- .../tests/override-different-file/expected | 9 ++- 6 files changed, 106 insertions(+), 31 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/Cargo.lock b/pkgs/test/nixpkgs-check-by-name/Cargo.lock index 904a9cff0e78..b02f7075ab61 100644 --- a/pkgs/test/nixpkgs-check-by-name/Cargo.lock +++ b/pkgs/test/nixpkgs-check-by-name/Cargo.lock @@ -299,6 +299,7 @@ dependencies = [ "itertools", "lazy_static", "regex", + "relative-path", "rnix", "rowan", "serde", @@ -392,6 +393,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +[[package]] +name = "relative-path" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" + [[package]] name = "rnix" version = "0.11.0" diff --git a/pkgs/test/nixpkgs-check-by-name/Cargo.toml b/pkgs/test/nixpkgs-check-by-name/Cargo.toml index 5240cd69f996..1b8f8e9085d4 100644 --- a/pkgs/test/nixpkgs-check-by-name/Cargo.toml +++ b/pkgs/test/nixpkgs-check-by-name/Cargo.toml @@ -15,7 +15,8 @@ lazy_static = "1.4.0" colored = "2.0.4" itertools = "0.11.0" rowan = "0.15.11" +indoc = "2.0.4" +relative-path = "1.9.2" [dev-dependencies] temp-env = "0.3.5" -indoc = "2.0.4" diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index 122c4b734897..fa06e38c357a 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -52,22 +52,19 @@ struct Location { } impl Location { - // Creates a [String] from a [Location], in a format like `{file}:{line}:{column}`, - // where `file` is relative to the given [Path]. - fn to_relative_string(&self, nixpkgs_path: &Path) -> anyhow::Result { - let relative = self.file.strip_prefix(nixpkgs_path).with_context(|| { - format!( - "An attributes location ({}) is outside Nixpkgs ({})", - self.file.display(), - nixpkgs_path.display() - ) - })?; - Ok(format!( - "{}:{}:{}", - relative.display(), - self.line, - self.column - )) + // Returns the [file] field, but relative to Nixpkgs + fn relative_file(&self, nixpkgs_path: &Path) -> anyhow::Result { + Ok(self + .file + .strip_prefix(nixpkgs_path) + .with_context(|| { + format!( + "The file ({}) is outside Nixpkgs ({})", + self.file.display(), + nixpkgs_path.display() + ) + })? + .to_path_buf()) } } @@ -295,16 +292,24 @@ fn by_name( // We should expect manual definitions to have a location, otherwise we can't // enforce the expected format if let Some(location) = location { - // Parse the Nix file in the location and figure out whether it's an - // attribute definition of the form `= callPackage `, + // Parse the Nix file in the location + let nix_file = nix_file_store.get(&location.file)?; + + // The relative path of the Nix file, for error messages + let relative_file = + location.relative_file(nixpkgs_path).with_context(|| { + format!( + "Failed to resolve location file of attribute {attribute_name}" + ) + })?; + + // Figure out whether it's an attribute definition of the form `= callPackage `, // returning the arguments if so. - let optional_syntactic_call_package = nix_file_store - .get(&location.file)? - .call_package_argument_info_at( + let optional_syntactic_call_package = nix_file.call_package_argument_info_at( location.line, location.column, nixpkgs_path, - )?; + ).with_context(|| format!("Failed to get the definition info for attribute {attribute_name}"))?; // At this point, we completed two different checks for whether it's a // `callPackage` @@ -312,7 +317,9 @@ fn by_name( // Something like ` = foo` (_, Err(definition)) => NixpkgsProblem::NonSyntacticCallPackage { package_name: attribute_name.to_owned(), - location: location.to_relative_string(nixpkgs_path)?, + file: relative_file, + line: location.line, + column: location.column, definition, } .into(), @@ -338,13 +345,19 @@ fn by_name( Tight }) } else { - NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), + // Wrong path + NixpkgsProblem::WrongCallPackagePath { package_name: attribute_name.to_owned(), + file: relative_file, + line: location.line, + column: location.column, + actual_path: path, + expected_path: relative_package_file, } .into() } } else { + // No path NixpkgsProblem::WrongCallPackage { relative_package_file: relative_package_file.to_owned(), package_name: attribute_name.to_owned(), diff --git a/pkgs/test/nixpkgs-check-by-name/src/main.rs b/pkgs/test/nixpkgs-check-by-name/src/main.rs index 0d0ddcd7e632..24415424914e 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/main.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/main.rs @@ -249,7 +249,7 @@ mod tests { if actual_errors != expected_errors { panic!( - "Failed test case {name}, expected these errors:\n\n{}\n\nbut got these:\n\n{}", + "Failed test case {name}, expected these errors:\n=======\n{}\n=======\nbut got these:\n=======\n{}\n=======", expected_errors, actual_errors ); } diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 18001eb44ecd..dda89895697f 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -1,8 +1,11 @@ use crate::structure; use crate::utils::PACKAGE_NIX_FILENAME; +use indoc::writedoc; +use relative_path::RelativePath; use std::ffi::OsString; use std::fmt; use std::io; +use std::path::Path; use std::path::PathBuf; /// Any problem that can occur when checking Nixpkgs @@ -44,9 +47,19 @@ pub enum NixpkgsProblem { relative_package_file: PathBuf, package_name: String, }, + WrongCallPackagePath { + package_name: String, + file: PathBuf, + line: usize, + column: usize, + actual_path: PathBuf, + expected_path: PathBuf, + }, NonSyntacticCallPackage { package_name: String, - location: String, + file: PathBuf, + line: usize, + column: usize, definition: String, }, NonDerivation { @@ -169,12 +182,32 @@ impl fmt::Display for NixpkgsProblem { "pkgs.{package_name}: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage {} {{ ... }}` with a non-empty second argument.", relative_package_file.display() ), - NixpkgsProblem::NonSyntacticCallPackage { package_name, location, definition } => + NixpkgsProblem::WrongCallPackagePath { package_name, file, line, column, actual_path, expected_path } => + writedoc! { + f, + " + - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + + {package_name} = callPackage {} {{ /* ... */ }} + + This is however not the case: The first `callPackage` argument is the wrong path. + It is defined in {}:{}:{} as + + {package_name} = callPackage {} {{ /* ... */ }}", + structure::relative_dir_for_package(package_name).display(), + create_path_expr(file, expected_path), + file.display(), line, column, + create_path_expr(file, actual_path), + }, + NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => write!( f, - "Because {} exists, the attribute `pkgs.{package_name}` must be defined as `callPackage {} {{ ... }}`. This is however not the case: The attribute is defined in {location} as\n\t{}", + "Because {} exists, the attribute `pkgs.{package_name}` must be defined as `callPackage {} {{ ... }}`. This is however not the case: The attribute is defined in {}:{}:{} as\n\t{}", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), + file.display(), + line, + column, definition, ), NixpkgsProblem::NonDerivation { relative_package_file, package_name } => @@ -284,3 +317,17 @@ impl fmt::Display for NixpkgsProblem { } } } + +/// Creates a Nix path expression that when put into Nix file `from_file`, would point to the `to_file`. +fn create_path_expr(from_file: impl AsRef, to_file: impl AsRef) -> String { + // FIXME: Clean these unwrap's up + // But these should never trigger because we only call this function with relative paths, and only + // with `from_file` being an actual file (so there's always a parent) + let from = RelativePath::from_path(&from_file) + .unwrap() + .parent() + .unwrap(); + let to = RelativePath::from_path(&to_file).unwrap(); + let rel = from.relative(to); + format!("./{rel}") +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 51479e22d26f..3566b15bdbc4 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -1 +1,8 @@ -pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like + + nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ } + + This is however not the case: The first `callPackage` argument is the wrong path. + It is defined in all-packages.nix:2:3 as + + nonDerivation = callPackage ./someDrv.nix { /* ... */ } From 7258d472bcd8886be8b1463bea6030d1afe93bbf Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 22 Feb 2024 23:43:02 +0100 Subject: [PATCH 017/186] tests.nixpkgs-check-by-name: Improve non-syntactic callPackage error more --- pkgs/test/nixpkgs-check-by-name/Cargo.lock | 30 +++++++++++++++ pkgs/test/nixpkgs-check-by-name/Cargo.toml | 1 + .../src/nixpkgs_problem.rs | 38 +++++++++++++++---- .../expected | 10 ++++- .../tests/override-different-file/expected | 4 +- .../tests/override-no-call-package/expected | 10 ++++- 6 files changed, 79 insertions(+), 14 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/Cargo.lock b/pkgs/test/nixpkgs-check-by-name/Cargo.lock index b02f7075ab61..19435c2ab76e 100644 --- a/pkgs/test/nixpkgs-check-by-name/Cargo.lock +++ b/pkgs/test/nixpkgs-check-by-name/Cargo.lock @@ -306,6 +306,7 @@ dependencies = [ "serde_json", "temp-env", "tempfile", + "textwrap", ] [[package]] @@ -489,6 +490,12 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "strsim" version = "0.10.0" @@ -534,12 +541,35 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + [[package]] name = "unicode-ident" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + [[package]] name = "utf8parse" version = "0.2.1" diff --git a/pkgs/test/nixpkgs-check-by-name/Cargo.toml b/pkgs/test/nixpkgs-check-by-name/Cargo.toml index 1b8f8e9085d4..50cdabb7e2dd 100644 --- a/pkgs/test/nixpkgs-check-by-name/Cargo.toml +++ b/pkgs/test/nixpkgs-check-by-name/Cargo.toml @@ -17,6 +17,7 @@ itertools = "0.11.0" rowan = "0.15.11" indoc = "2.0.4" relative-path = "1.9.2" +textwrap = "0.16.1" [dev-dependencies] temp-env = "0.3.5" diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index dda89895697f..d8ae2db4dc22 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -188,28 +188,50 @@ impl fmt::Display for NixpkgsProblem { " - Because {} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage {} {{ /* ... */ }} + {package_name} = callPackage {} {{ /* ... */ }}; This is however not the case: The first `callPackage` argument is the wrong path. It is defined in {}:{}:{} as - {package_name} = callPackage {} {{ /* ... */ }}", + {package_name} = callPackage {} {{ /* ... */ }};", structure::relative_dir_for_package(package_name).display(), create_path_expr(file, expected_path), file.display(), line, column, create_path_expr(file, actual_path), }, - NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => - write!( + NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => { + // This is needed such multi-line definitions don't look odd + // A bit round-about, but it works and we might not need anything more complicated + let definition_indented = + // The entire code should be indented 4 spaces + textwrap::indent( + // But first we want to strip the code's natural indentation + &textwrap::dedent( + // The definition _doesn't_ include the leading spaces, but we can + // recover those from the column + &format!("{}{definition}", + " ".repeat(column - 1)), + ), + " ", + ); + writedoc!( f, - "Because {} exists, the attribute `pkgs.{package_name}` must be defined as `callPackage {} {{ ... }}`. This is however not the case: The attribute is defined in {}:{}:{} as\n\t{}", + " + - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + + {package_name} = callPackage {} {{ /* ... */ }}; + + This is however not the case. + It is defined in {}:{} as + + {}", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), line, - column, - definition, - ), + definition_indented, + ) + } NixpkgsProblem::NonDerivation { relative_package_file, package_name } => write!( f, diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index f590ef4ff9fa..e62009633885 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -1,2 +1,8 @@ -Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined as `callPackage pkgs/by-name/fo/foo/package.nix { ... }`. This is however not the case: The attribute is defined in all-packages.nix:4:3 as - foo = self.bar; +- Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like + + foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + + This is however not the case. + It is defined in all-packages.nix:4 as + + foo = self.bar; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 3566b15bdbc4..18bf137364fe 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -1,8 +1,8 @@ - Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like - nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ } + nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; This is however not the case: The first `callPackage` argument is the wrong path. It is defined in all-packages.nix:2:3 as - nonDerivation = callPackage ./someDrv.nix { /* ... */ } + nonDerivation = callPackage ./someDrv.nix { /* ... */ }; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index 25fc867b04fe..e31f9eb6d539 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -1,2 +1,8 @@ -Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined as `callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }`. This is however not the case: The attribute is defined in all-packages.nix:2:3 as - nonDerivation = self.someDrv; +- Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like + + nonDerivation = callPackage pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; + + This is however not the case. + It is defined in all-packages.nix:2 as + + nonDerivation = self.someDrv; From 75cdccd6c4753efe4fa543a05e4d1741cfb63218 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 00:10:20 +0100 Subject: [PATCH 018/186] tests.nixpkgs-check-by-name: Improve more errors --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 38 ++++----- .../nixpkgs-check-by-name/src/nix_file.rs | 35 ++++---- .../src/nixpkgs_problem.rs | 79 +++++++++++++++---- .../tests/alt-callPackage/all-packages.nix | 7 ++ .../tests/alt-callPackage/default.nix | 1 + .../tests/alt-callPackage/expected | 8 ++ .../pkgs/by-name/fo/foo/package.nix | 1 + .../all-packages.nix | 1 - .../tests/override-no-file/expected | 9 ++- .../tests/override-non-path/expected | 9 ++- 10 files changed, 134 insertions(+), 54 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/all-packages.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/pkgs/by-name/fo/foo/package.nix diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index fa06e38c357a..ddeac2a445b3 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -305,7 +305,7 @@ fn by_name( // Figure out whether it's an attribute definition of the form `= callPackage `, // returning the arguments if so. - let optional_syntactic_call_package = nix_file.call_package_argument_info_at( + let (optional_syntactic_call_package, definition) = nix_file.call_package_argument_info_at( location.line, location.column, nixpkgs_path, @@ -315,7 +315,7 @@ fn by_name( // `callPackage` match (is_semantic_call_package, optional_syntactic_call_package) { // Something like ` = foo` - (_, Err(definition)) => NixpkgsProblem::NonSyntacticCallPackage { + (_, None) => NixpkgsProblem::NonSyntacticCallPackage { package_name: attribute_name.to_owned(), file: relative_file, line: location.line, @@ -324,17 +324,16 @@ fn by_name( } .into(), // Something like ` = pythonPackages.callPackage ...` - (false, Ok(_)) => { - // All of these are not of the expected form, so error out - // TODO: Make error more specific, don't lump everything together - NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), - package_name: attribute_name.to_owned(), - } - .into() + (false, Some(_)) => NixpkgsProblem::NonToplevelCallPackage { + package_name: attribute_name.to_owned(), + file: relative_file, + line: location.line, + column: location.column, + definition, } + .into(), // Something like ` = pkgs.callPackage ...` - (true, Ok(syntactic_call_package)) => { + (true, Some(syntactic_call_package)) => { if let Some(path) = syntactic_call_package.relative_path { if path == relative_package_file { // Manual definitions with empty arguments are not allowed @@ -358,9 +357,12 @@ fn by_name( } } else { // No path - NixpkgsProblem::WrongCallPackage { - relative_package_file: relative_package_file.to_owned(), + NixpkgsProblem::NonPath { package_name: attribute_name.to_owned(), + file: relative_file, + line: location.line, + column: location.column, + definition, } .into() } @@ -451,7 +453,7 @@ fn handle_non_by_name_attribute( // Parse the Nix file in the location and figure out whether it's an // attribute definition of the form `= callPackage `, // returning the arguments if so. - let optional_syntactic_call_package = nix_file_store + let (optional_syntactic_call_package, _definition) = nix_file_store .get(&location.file)? .call_package_argument_info_at( location.line, @@ -466,16 +468,16 @@ fn handle_non_by_name_attribute( // `callPackage` match (is_semantic_call_package, optional_syntactic_call_package) { // Something like ` = { }` - (false, Err(_)) + (false, None) // Something like ` = pythonPackages.callPackage ...` - | (false, Ok(_)) + | (false, Some(_)) // Something like ` = bar` where `bar = pkgs.callPackage ...` - | (true, Err(_)) => { + | (true, None) => { // In all of these cases, it's not possible to migrate the package to `pkgs/by-name` NonApplicable } // Something like ` = pkgs.callPackage ...` - (true, Ok(syntactic_call_package)) => { + (true, Some(syntactic_call_package)) => { // It's only possible to migrate such a definitions if.. match syntactic_call_package.relative_path { Some(ref rel_path) if rel_path.starts_with(utils::BASE_SUBPATH) => { diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index 3840f1dc479d..1382f389e2da 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -119,13 +119,14 @@ impl NixFile { line: usize, column: usize, relative_to: &Path, - ) -> anyhow::Result> { + ) -> anyhow::Result<(Option, String)> { Ok(match self.attrpath_value_at(line, column)? { - Err(definition) => Err(definition), + Err(definition) => (None, definition), Ok(attrpath_value) => { let definition = attrpath_value.to_string(); - self.attrpath_value_call_package_argument_info(attrpath_value, relative_to)? - .ok_or(definition) + let attrpath_value = + self.attrpath_value_call_package_argument_info(attrpath_value, relative_to)?; + (attrpath_value, definition) } }) } @@ -492,41 +493,41 @@ mod tests { let nix_file = NixFile::new(&file)?; let cases = [ - (2, Err("a.sub = null;")), - (3, Err("b = null;")), - (4, Err("c = import ./file.nix;")), - (5, Err("d = import ./file.nix { };")), + (2, None), + (3, None), + (4, None), + (5, None), ( 6, - Ok(CallPackageArgumentInfo { + Some(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: true, }), ), ( 7, - Ok(CallPackageArgumentInfo { + Some(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: true, }), ), ( 8, - Ok(CallPackageArgumentInfo { + Some(CallPackageArgumentInfo { relative_path: None, empty_arg: true, }), ), ( 9, - Ok(CallPackageArgumentInfo { + Some(CallPackageArgumentInfo { relative_path: Some(PathBuf::from("file.nix")), empty_arg: false, }), ), ( 10, - Ok(CallPackageArgumentInfo { + Some(CallPackageArgumentInfo { relative_path: None, empty_arg: false, }), @@ -534,12 +535,10 @@ mod tests { ]; for (line, expected_result) in cases { - let actual_result = nix_file + let (actual_result, _definition) = nix_file .call_package_argument_info_at(line, 3, temp_dir.path()) - .context(format!("line {line}"))? - .map_err(|x| x); - let owned_expected_result = expected_result.map_err(|x| x.to_string()); - assert_eq!(actual_result, owned_expected_result, "line {line}"); + .context(format!("line {line}"))?; + assert_eq!(actual_result, expected_result, "line {line}"); } Ok(()) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index d8ae2db4dc22..54976306df32 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -47,6 +47,20 @@ pub enum NixpkgsProblem { relative_package_file: PathBuf, package_name: String, }, + NonToplevelCallPackage { + package_name: String, + file: PathBuf, + line: usize, + column: usize, + definition: String, + }, + NonPath { + package_name: String, + file: PathBuf, + line: usize, + column: usize, + definition: String, + }, WrongCallPackagePath { package_name: String, file: PathBuf, @@ -182,6 +196,42 @@ impl fmt::Display for NixpkgsProblem { "pkgs.{package_name}: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage {} {{ ... }}` with a non-empty second argument.", relative_package_file.display() ), + NixpkgsProblem::NonToplevelCallPackage { package_name, file, line, column, definition } => + writedoc!( + f, + " + - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + + {package_name} = callPackage {} {{ /* ... */ }}; + + This is however not the case: A different `callPackage` is used. + It is defined in {}:{} as + + {}", + structure::relative_dir_for_package(package_name).display(), + structure::relative_file_for_package(package_name).display(), + file.display(), + line, + indent_definition(*column, definition.clone()), + ), + NixpkgsProblem::NonPath { package_name, file, line, column, definition } => + writedoc!( + f, + " + - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + + {package_name} = callPackage {} {{ /* ... */ }}; + + This is however not the case: The first callPackage argument is not right: + It is defined in {}:{} as + + {}", + structure::relative_dir_for_package(package_name).display(), + structure::relative_file_for_package(package_name).display(), + file.display(), + line, + indent_definition(*column, definition.clone()), + ), NixpkgsProblem::WrongCallPackagePath { package_name, file, line, column, actual_path, expected_path } => writedoc! { f, @@ -200,20 +250,6 @@ impl fmt::Display for NixpkgsProblem { create_path_expr(file, actual_path), }, NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => { - // This is needed such multi-line definitions don't look odd - // A bit round-about, but it works and we might not need anything more complicated - let definition_indented = - // The entire code should be indented 4 spaces - textwrap::indent( - // But first we want to strip the code's natural indentation - &textwrap::dedent( - // The definition _doesn't_ include the leading spaces, but we can - // recover those from the column - &format!("{}{definition}", - " ".repeat(column - 1)), - ), - " ", - ); writedoc!( f, " @@ -229,7 +265,7 @@ impl fmt::Display for NixpkgsProblem { structure::relative_file_for_package(package_name).display(), file.display(), line, - definition_indented, + indent_definition(*column, definition.clone()), ) } NixpkgsProblem::NonDerivation { relative_package_file, package_name } => @@ -340,6 +376,19 @@ impl fmt::Display for NixpkgsProblem { } } +fn indent_definition(column: usize, definition: String) -> String { + // The entire code should be indented 4 spaces + textwrap::indent( + // But first we want to strip the code's natural indentation + &textwrap::dedent( + // The definition _doesn't_ include the leading spaces, but we can + // recover those from the column + &format!("{}{definition}", " ".repeat(column - 1)), + ), + " ", + ) +} + /// Creates a Nix path expression that when put into Nix file `from_file`, would point to the `to_file`. fn create_path_expr(from_file: impl AsRef, to_file: impl AsRef) -> String { // FIXME: Clean these unwrap's up diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/all-packages.nix new file mode 100644 index 000000000000..399f8eee0a18 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/all-packages.nix @@ -0,0 +1,7 @@ +self: super: { + + alt.callPackage = self.lib.callPackageWith {}; + + foo = self.alt.callPackage ({ }: self.someDrv) { }; + +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected new file mode 100644 index 000000000000..25d2e6c4fa6a --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -0,0 +1,8 @@ +- Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like + + foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + + This is however not the case: A different `callPackage` is used. + It is defined in all-packages.nix:5 as + + foo = self.alt.callPackage ({ }: self.someDrv) { }; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/pkgs/by-name/fo/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/pkgs/by-name/fo/foo/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/pkgs/by-name/fo/foo/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix index 3e0ea20c2281..e31aa831b814 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix @@ -2,5 +2,4 @@ self: super: { bar = (x: x) self.callPackage ./pkgs/by-name/fo/foo/package.nix { someFlag = true; }; foo = self.bar; - } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index 51479e22d26f..0f8a4cb65eef 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -1 +1,8 @@ -pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like + + nonDerivation = callPackage pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; + + This is however not the case: The first callPackage argument is not right: + It is defined in all-packages.nix:2 as + + nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index 9df788191ece..41e40a9b3c3f 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -1 +1,8 @@ -pkgs.foo: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/fo/foo/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like + + foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + + This is however not the case: The first callPackage argument is not right: + It is defined in all-packages.nix:3 as + + foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; From db7562e886d07ab365e8c55c50cf93dd709121ab Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 01:01:57 +0100 Subject: [PATCH 019/186] tests.nixpkgs-check-by-name: Improve errors relating to the base branch --- pkgs/test/nixpkgs-check-by-name/src/main.rs | 94 ++++++++++++------- .../tests/aliases/expected | 1 + .../tests/alt-callPackage/expected | 1 + .../tests/base-fixed/base/default.nix | 1 + .../tests/base-fixed/base/pkgs/by-name/foo | 0 .../tests/base-fixed/default.nix | 1 + .../tests/base-fixed/expected | 1 + .../tests/base-fixed/pkgs/by-name/README.md | 0 .../tests/base-still-broken/base/default.nix | 1 + .../base-still-broken/base/pkgs/by-name/foo | 0 .../tests/base-still-broken/default.nix | 1 + .../tests/base-still-broken/expected | 3 + .../tests/base-still-broken/pkgs/by-name/bar | 0 .../tests/broken-autocall/expected | 1 + .../tests/callPackage-syntax/expected | 1 + .../tests/empty-base/expected | 1 + .../tests/incorrect-shard/expected | 1 + .../tests/internalCallPackage/expected | 1 + .../tests/invalid-package-name/expected | 1 + .../tests/invalid-shard-name/expected | 1 + .../tests/manual-definition/expected | 1 + .../tests/missing-package-nix/expected | 1 + .../tests/move-to-non-by-name/expected | 1 + .../tests/multiple-failures/expected | 1 + .../tests/new-package-non-by-name/expected | 1 + .../tests/no-by-name/expected | 2 +- .../tests/no-eval/expected | 1 + .../tests/non-attrs/expected | 1 + .../tests/non-derivation/expected | 1 + .../expected | 1 + .../tests/one-letter/expected | 1 + .../only-callPackage-derivations/expected | 1 + .../tests/override-different-file/expected | 1 + .../tests/override-empty-arg-gradual/expected | 1 + .../tests/override-empty-arg/expected | 1 + .../tests/override-no-call-package/expected | 1 + .../tests/override-no-file/expected | 1 + .../tests/override-non-path/expected | 1 + .../tests/override-success/expected | 1 + .../tests/package-dir-is-file/expected | 1 + .../tests/package-nix-dir/expected | 1 + .../tests/package-variants/expected | 1 + .../tests/ref-absolute/expected | 1 + .../tests/ref-escape/expected | 1 + .../tests/ref-nix-path/expected | 1 + .../tests/ref-path-subexpr/expected | 1 + .../tests/ref-success/expected | 1 + .../tests/shard-file/expected | 1 + .../tests/sorted-order/expected | 1 + .../tests/success/expected | 1 + .../tests/symlink-escape/expected | 1 + .../tests/symlink-invalid/expected | 1 + .../tests/unknown-location/expected | 1 + .../tests/uppercase/expected | 1 + .../tests/with-readme/expected | 1 + 55 files changed, 110 insertions(+), 37 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/aliases/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/pkgs/by-name/foo create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-fixed/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-fixed/pkgs/by-name/README.md create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/pkgs/by-name/foo create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/pkgs/by-name/bar create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/callPackage-syntax/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/empty-base/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/one-letter/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/only-callPackage-derivations/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/override-success/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/package-variants/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/ref-success/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/success/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/uppercase/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/with-readme/expected diff --git a/pkgs/test/nixpkgs-check-by-name/src/main.rs b/pkgs/test/nixpkgs-check-by-name/src/main.rs index 24415424914e..d5ea2c67438b 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/main.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/main.rs @@ -47,14 +47,8 @@ pub struct Args { fn main() -> ExitCode { let args = Args::parse(); match process(&args.base, &args.nixpkgs, false, &mut io::stderr()) { - Ok(true) => { - eprintln!("{}", "Validated successfully".green()); - ExitCode::SUCCESS - } - Ok(false) => { - eprintln!("{}", "Validation failed, see above errors".yellow()); - ExitCode::from(1) - } + Ok(true) => ExitCode::SUCCESS, + Ok(false) => ExitCode::from(1), Err(e) => { eprintln!("{} {:#}", "I/O error: ".yellow(), e); ExitCode::from(2) @@ -82,29 +76,58 @@ pub fn process( keep_nix_path: bool, error_writer: &mut W, ) -> anyhow::Result { - // Check the main Nixpkgs first - let main_result = check_nixpkgs(main_nixpkgs, keep_nix_path, error_writer)?; - let check_result = main_result.result_map(|nixpkgs_version| { - // If the main Nixpkgs doesn't have any problems, run the ratchet checks against the base - // Nixpkgs - check_nixpkgs(base_nixpkgs, keep_nix_path, error_writer)?.result_map( - |base_nixpkgs_version| { - Ok(ratchet::Nixpkgs::compare( - base_nixpkgs_version, - nixpkgs_version, - )) - }, - ) - })?; - match check_result { - Failure(errors) => { + // TODO: Run in parallel + let base_result = check_nixpkgs(base_nixpkgs, keep_nix_path)?; + let main_result = check_nixpkgs(main_nixpkgs, keep_nix_path)?; + + match (base_result, main_result) { + (Failure(_), Failure(errors)) => { + // Base branch fails and the PR doesn't fix it and may also introduce additional problems for error in errors { writeln!(error_writer, "{}", error.to_string().red())? } + writeln!(error_writer, "{}", "The base branch is broken and still has above problems with this PR, these need to be fixed first.\nConsider reverting the PR that introduced these problems in order to prevent more failures of unrelated PRs.".yellow())?; Ok(false) } - Success(()) => Ok(true), + (Failure(_), Success(_)) => { + // Base branch fails, but the PR fixes it + writeln!( + error_writer, + "{}", + "The base branch was broken, but this PR fixes it, nice job!".green() + )?; + Ok(true) + } + (Success(_), Failure(errors)) => { + // Base branch succeeds, the PR breaks it + for error in errors { + writeln!(error_writer, "{}", error.to_string().red())? + } + writeln!( + error_writer, + "{}", + "This PR introduces the above problems, merging would break the base branch" + .yellow() + )?; + Ok(false) + } + (Success(base), Success(main)) => { + // Both base and main branch succeed, check ratchet state + match ratchet::Nixpkgs::compare(base, main) { + Failure(errors) => { + for error in errors { + writeln!(error_writer, "{}", error.to_string().red())? + } + writeln!(error_writer, "{}", "This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch".yellow())?; + Ok(false) + } + Success(()) => { + writeln!(error_writer, "{}", "Validated successfully".green())?; + Ok(true) + } + } + } } } @@ -113,10 +136,9 @@ pub fn process( /// This does not include ratchet checks, see ../README.md#ratchet-checks /// Instead a `ratchet::Nixpkgs` value is returned, whose `compare` method allows performing the /// ratchet check against another result. -pub fn check_nixpkgs( +pub fn check_nixpkgs( nixpkgs_path: &Path, keep_nix_path: bool, - error_writer: &mut W, ) -> validation::Result { let mut nix_file_store = NixFileStore::default(); @@ -129,11 +151,7 @@ pub fn check_nixpkgs( })?; if !nixpkgs_path.join(utils::BASE_SUBPATH).exists() { - writeln!( - error_writer, - "Given Nixpkgs path does not contain a {} subdirectory, no check necessary.", - utils::BASE_SUBPATH - )?; + // No pkgs/by-name directory, always valid Success(ratchet::Nixpkgs::default()) } else { check_structure(&nixpkgs_path, &mut nix_file_store)?.result_map(|package_names| @@ -163,8 +181,8 @@ mod tests { continue; } - let expected_errors = - fs::read_to_string(path.join("expected")).unwrap_or(String::new()); + let expected_errors = fs::read_to_string(path.join("expected")) + .expect("No expected file for test {name}"); test_nixpkgs(&name, &path, &expected_errors)?; } @@ -201,7 +219,7 @@ mod tests { test_nixpkgs( "case_sensitive", &path, - "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\n", + "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\nThis PR introduces the above problems, merging would break the base branch\n", )?; Ok(()) @@ -225,7 +243,11 @@ mod tests { let tmpdir = temp_root.path().join("symlinked"); temp_env::with_var("TMPDIR", Some(&tmpdir), || { - test_nixpkgs("symlinked_tmpdir", Path::new("tests/success"), "") + test_nixpkgs( + "symlinked_tmpdir", + Path::new("tests/success"), + "Validated successfully\n", + ) }) } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/aliases/expected b/pkgs/test/nixpkgs-check-by-name/tests/aliases/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/aliases/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected index 25d2e6c4fa6a..3abb613de096 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:5 as foo = self.alt.callPackage ({ }: self.someDrv) { }; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/pkgs/by-name/foo b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/base/pkgs/by-name/foo new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected new file mode 100644 index 000000000000..feb6cce2fd04 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected @@ -0,0 +1 @@ +The base branch was broken, but this PR fixes it, nice job! diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/pkgs/by-name/README.md b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/pkgs/by-name/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/pkgs/by-name/foo b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/base/pkgs/by-name/foo new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected new file mode 100644 index 000000000000..4f0d08357d1f --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected @@ -0,0 +1,3 @@ +pkgs/by-name/bar: This is a file, but it should be a directory. +The base branch is broken and still has above problems with this PR, these need to be fixed first. +Consider reverting the PR that introduced these problems in order to prevent more failures of unrelated PRs. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/pkgs/by-name/bar b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/pkgs/by-name/bar new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected b/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected index fff17c6c7cd5..6b937106b806 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected @@ -1 +1,2 @@ pkgs.foo: This attribute is not defined but it should be defined automatically as pkgs/by-name/fo/foo/package.nix +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/callPackage-syntax/expected b/pkgs/test/nixpkgs-check-by-name/tests/callPackage-syntax/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/callPackage-syntax/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/empty-base/expected b/pkgs/test/nixpkgs-check-by-name/tests/empty-base/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/empty-base/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected b/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected index 3627368c0ef0..ec1918cace8c 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected @@ -1 +1,2 @@ pkgs/by-name/aa/FOO: Incorrect directory location, should be pkgs/by-name/fo/FOO instead. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected index 404795ee5c79..9fef30d14f37 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected @@ -1 +1,2 @@ pkgs.foo: This attribute is defined using `_internalCallByNamePackageFile`, which is an internal function not intended for manual use. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected index 8c8eafdcb3d1..aac1b186ca49 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected @@ -1 +1,2 @@ pkgs/by-name/fo/fo@: Invalid package directory name "fo@", must be ASCII characters consisting of a-z, A-Z, 0-9, "-" or "_". +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected index 248aa8877966..ce7c2695424c 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected @@ -1 +1,2 @@ pkgs/by-name/A: Invalid directory name "A", must be at most 2 ASCII characters consisting of a-z, 0-9, "-" or "_". +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index 29d33f7dbdc0..1cc970b7fd72 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -1,2 +1,3 @@ pkgs.noEval: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/noEval/package.nix { ... }` with a non-empty second argument. pkgs.onlyMove: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/on/onlyMove/package.nix { ... }` with a non-empty second argument. +This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected b/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected index ce1afcbf2d34..93c882b2bd3c 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected @@ -1 +1,2 @@ pkgs/by-name/fo/foo: Missing required "package.nix" file. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected index 96da50b52491..8a2116aebcb9 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected @@ -2,3 +2,4 @@ pkgs.foo1: This top-level package was previously defined in pkgs/by-name/fo/foo1 pkgs.foo2: This top-level package was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { }` (e.g. in `pkgs/top-level/all-packages.nix`). Please move the package back and remove the manual `callPackage`. pkgs.foo3: This top-level package was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` (e.g. in `pkgs/top-level/all-packages.nix`). While the manual `callPackage` is still needed, it's not necessary to move the package files. pkgs.foo4: This top-level package was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` (e.g. in `pkgs/top-level/all-packages.nix`). While the manual `callPackage` is still needed, it's not necessary to move the package files. +This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected index ff5d18556ef0..303884cb7944 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected @@ -11,3 +11,4 @@ pkgs/by-name/ba/foo: File package.nix at line 3 contains the path expression ".. pkgs/by-name/ba/foo: File package.nix at line 4 contains the nix search path expression "" which may point outside the directory of that package. pkgs/by-name/ba/foo: File package.nix at line 5 contains the path expression "./${"test"}", which is not yet supported and may point outside the directory of that package. pkgs/by-name/fo/foo: Missing required "package.nix" file. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected index 3f294f26dfd8..31eff28f3c88 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected @@ -2,3 +2,4 @@ pkgs.new1: This is a new top-level package of the form `callPackage ... { }`. Pl pkgs.new2: This is a new top-level package of the form `callPackage ./without-config.nix { }`. Please define it in pkgs/by-name/ne/new2/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. pkgs.new3: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/ne/new3/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{ }`, the manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is still needed. pkgs.new4: This is a new top-level package of the form `callPackage ./with-config.nix { }`. Please define it in pkgs/by-name/ne/new4/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{ }`, the manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is still needed. +This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/no-by-name/expected index ddcb2df46e5f..defae2634c34 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/no-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/no-by-name/expected @@ -1 +1 @@ -Given Nixpkgs path does not contain a pkgs/by-name subdirectory, no check necessary. +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/expected b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected index e6c923790102..48acbec1210d 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected @@ -1 +1,2 @@ pkgs.nonDerivation: This attribute defined by pkgs/by-name/no/nonDerivation/package.nix is not a derivation +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected index e6c923790102..48acbec1210d 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected @@ -1 +1,2 @@ pkgs.nonDerivation: This attribute defined by pkgs/by-name/no/nonDerivation/package.nix is not a derivation +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index e62009633885..d1a31336504a 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:4 as foo = self.bar; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/one-letter/expected b/pkgs/test/nixpkgs-check-by-name/tests/one-letter/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/one-letter/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/only-callPackage-derivations/expected b/pkgs/test/nixpkgs-check-by-name/tests/only-callPackage-derivations/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/only-callPackage-derivations/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 18bf137364fe..6f439dd4b7d0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:2:3 as nonDerivation = callPackage ./someDrv.nix { /* ... */ }; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg-gradual/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg-gradual/expected index e69de29bb2d1..defae2634c34 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg-gradual/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg-gradual/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index 51479e22d26f..bf96b181d7fe 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -1 +1,2 @@ pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument. +This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index e31f9eb6d539..54d1eb51be34 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:2 as nonDerivation = self.someDrv; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index 0f8a4cb65eef..a1980fdc08da 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:2 as nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index 41e40a9b3c3f..c8cb5be6d8ee 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -6,3 +6,4 @@ It is defined in all-packages.nix:3 as foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-success/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-success/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-success/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected index 3ad4b8f820f5..864978b9b731 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected @@ -1 +1,2 @@ pkgs/by-name/fo/foo: This path is a file, but it should be a directory. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected b/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected index 67a0c69fe29e..82ad2ce85bbf 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected @@ -1 +1,2 @@ pkgs/by-name/fo/foo: "package.nix" must be a file. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/package-variants/expected b/pkgs/test/nixpkgs-check-by-name/tests/package-variants/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/package-variants/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected index 7d20c32aad68..0e0e876d5561 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected @@ -1 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "/foo" which cannot be resolved: No such file or directory (os error 2). +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected index 3d7fb64e80a3..f414e4145674 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected @@ -1 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "../." which may point outside the directory of that package. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected index b0cdff4a4778..7b47a786a8be 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected @@ -1 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the nix search path expression "" which may point outside the directory of that package. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected index ad662af27a86..1905841a63df 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected @@ -1 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "./${"test"}", which is not yet supported and may point outside the directory of that package. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-success/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-success/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-success/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected index 447b38e6b6c1..4a02d99778a9 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected @@ -1 +1,2 @@ pkgs/by-name/fo: This is a file, but it should be a directory. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index 349e9ad47c41..b835348cc3cf 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -2,3 +2,4 @@ pkgs.a: This attribute is manually defined (most likely in pkgs/top-level/all-pa pkgs.b: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/b/b/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. pkgs.c: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/c/c/package.nix { ... }` with a non-empty second argument. pkgs.d: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/d/d/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. +This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/success/expected b/pkgs/test/nixpkgs-check-by-name/tests/success/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/success/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected b/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected index 335c5d6b6e5d..e6c183207e57 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected @@ -1 +1,2 @@ pkgs/by-name/fo/foo: Path package.nix is a symlink pointing to a path outside the directory of that package. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected b/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected index c1e7a28205a7..01de2702f7d5 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected @@ -1 +1,2 @@ pkgs/by-name/fo/foo: Path foo is a symlink which cannot be resolved: No such file or directory (os error 2). +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected index 2a248c23ab50..d66a3185e701 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected @@ -1 +1,2 @@ pkgs.foo: Cannot determine the location of this attribute using `builtins.unsafeGetAttrPos`. +This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/uppercase/expected b/pkgs/test/nixpkgs-check-by-name/tests/uppercase/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/uppercase/expected @@ -0,0 +1 @@ +Validated successfully diff --git a/pkgs/test/nixpkgs-check-by-name/tests/with-readme/expected b/pkgs/test/nixpkgs-check-by-name/tests/with-readme/expected new file mode 100644 index 000000000000..defae2634c34 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/with-readme/expected @@ -0,0 +1 @@ +Validated successfully From f5e9b88af41e5c11b766fa9846d5f65b68fb2351 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 01:15:22 +0100 Subject: [PATCH 020/186] tests.nixpkgs-check-by-name: Evaluate base and main branch in parallel --- pkgs/test/nixpkgs-check-by-name/src/main.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/main.rs b/pkgs/test/nixpkgs-check-by-name/src/main.rs index d5ea2c67438b..c92d0af64969 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/main.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/main.rs @@ -1,4 +1,5 @@ use crate::nix_file::NixFileStore; +use std::panic; mod eval; mod nix_file; mod nixpkgs_problem; @@ -17,6 +18,7 @@ use colored::Colorize; use std::io; use std::path::{Path, PathBuf}; use std::process::ExitCode; +use std::thread; /// Program to check the validity of pkgs/by-name /// @@ -46,7 +48,7 @@ pub struct Args { fn main() -> ExitCode { let args = Args::parse(); - match process(&args.base, &args.nixpkgs, false, &mut io::stderr()) { + match process(args.base, args.nixpkgs, false, &mut io::stderr()) { Ok(true) => ExitCode::SUCCESS, Ok(false) => ExitCode::from(1), Err(e) => { @@ -71,15 +73,19 @@ fn main() -> ExitCode { /// - `Ok(false)` if there are problems, all of which will be written to `error_writer`. /// - `Ok(true)` if there are no problems pub fn process( - base_nixpkgs: &Path, - main_nixpkgs: &Path, + base_nixpkgs: PathBuf, + main_nixpkgs: PathBuf, keep_nix_path: bool, error_writer: &mut W, ) -> anyhow::Result { + // Very easy to parallelise this, since it's totally independent + let base_thread = thread::spawn(move || check_nixpkgs(&base_nixpkgs, keep_nix_path)); + let main_result = check_nixpkgs(&main_nixpkgs, keep_nix_path)?; - // TODO: Run in parallel - let base_result = check_nixpkgs(base_nixpkgs, keep_nix_path)?; - let main_result = check_nixpkgs(main_nixpkgs, keep_nix_path)?; + let base_result = match base_thread.join() { + Ok(res) => res?, + Err(e) => panic::resume_unwind(e), + }; match (base_result, main_result) { (Failure(_), Failure(errors)) => { @@ -262,7 +268,7 @@ mod tests { // We don't want coloring to mess up the tests let writer = temp_env::with_var("NO_COLOR", Some("1"), || -> anyhow::Result<_> { let mut writer = vec![]; - process(base_nixpkgs, &path, true, &mut writer) + process(base_nixpkgs.to_owned(), path.to_owned(), true, &mut writer) .with_context(|| format!("Failed test case {name}"))?; Ok(writer) })?; From eb1f01440af0f73fdc8e4e214a9a8b70358df971 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 01:53:45 +0100 Subject: [PATCH 021/186] tests.nixpkgs-check-by-name: More consistent errors --- pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs | 6 +++--- .../nixpkgs-check-by-name/tests/alt-callPackage/expected | 2 +- .../tests/non-syntactical-callPackage-by-name/expected | 2 +- .../tests/override-no-call-package/expected | 2 +- .../nixpkgs-check-by-name/tests/override-no-file/expected | 2 +- .../nixpkgs-check-by-name/tests/override-non-path/expected | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 54976306df32..808cda47cc1a 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -202,7 +202,7 @@ impl fmt::Display for NixpkgsProblem { " - Because {} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage {} {{ /* ... */ }}; + {package_name} = callPackage ./{} {{ /* ... */ }}; This is however not the case: A different `callPackage` is used. It is defined in {}:{} as @@ -220,7 +220,7 @@ impl fmt::Display for NixpkgsProblem { " - Because {} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage {} {{ /* ... */ }}; + {package_name} = callPackage ./{} {{ /* ... */ }}; This is however not the case: The first callPackage argument is not right: It is defined in {}:{} as @@ -255,7 +255,7 @@ impl fmt::Display for NixpkgsProblem { " - Because {} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage {} {{ /* ... */ }}; + {package_name} = callPackage ./{} {{ /* ... */ }}; This is however not the case. It is defined in {}:{} as diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected index 3abb613de096..80d79ecaba12 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -1,6 +1,6 @@ - Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like - foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; This is however not the case: A different `callPackage` is used. It is defined in all-packages.nix:5 as diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index d1a31336504a..5f914d1fce96 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -1,6 +1,6 @@ - Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like - foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; This is however not the case. It is defined in all-packages.nix:4 as diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index 54d1eb51be34..f1fc4892b2ab 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -1,6 +1,6 @@ - Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like - nonDerivation = callPackage pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; + nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; This is however not the case. It is defined in all-packages.nix:2 as diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index a1980fdc08da..040d7c635f7a 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -1,6 +1,6 @@ - Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like - nonDerivation = callPackage pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; + nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; This is however not the case: The first callPackage argument is not right: It is defined in all-packages.nix:2 as diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index c8cb5be6d8ee..1f15c6473b4a 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -1,6 +1,6 @@ - Because pkgs/by-name/fo/foo exists, the attribute `pkgs.foo` must be defined like - foo = callPackage pkgs/by-name/fo/foo/package.nix { /* ... */ }; + foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; This is however not the case: The first callPackage argument is not right: It is defined in all-packages.nix:3 as From 1c4308c35211e91bb97dedaaa1f0cba6e5b8322c Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 01:54:05 +0100 Subject: [PATCH 022/186] tests.nixpkgs-check-by-name: Better error for empty second arg --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 8 ++++- .../src/nixpkgs_problem.rs | 33 ++++++++++++++----- .../test/nixpkgs-check-by-name/src/ratchet.rs | 12 +++---- .../nixpkgs-check-by-name/src/references.rs | 4 +-- .../tests/manual-definition/expected | 18 ++++++++-- .../tests/override-empty-arg/expected | 9 ++++- .../tests/sorted-order/expected | 18 ++++++++-- 7 files changed, 77 insertions(+), 25 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index ddeac2a445b3..4748e907db72 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -339,7 +339,13 @@ fn by_name( // Manual definitions with empty arguments are not allowed // anymore Success(if syntactic_call_package.empty_arg { - Loose(()) + Loose(NixpkgsProblem::EmptyArgument { + package_name: attribute_name.to_owned(), + file: relative_file, + line: location.line, + column: location.column, + definition, + }) } else { Tight }) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 808cda47cc1a..cf40238f9cb6 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -4,11 +4,11 @@ use indoc::writedoc; use relative_path::RelativePath; use std::ffi::OsString; use std::fmt; -use std::io; use std::path::Path; use std::path::PathBuf; /// Any problem that can occur when checking Nixpkgs +#[derive(Clone)] pub enum NixpkgsProblem { ShardNonDir { relative_shard_path: PathBuf, @@ -43,9 +43,12 @@ pub enum NixpkgsProblem { relative_package_file: PathBuf, package_name: String, }, - WrongCallPackage { - relative_package_file: PathBuf, + EmptyArgument { package_name: String, + file: PathBuf, + line: usize, + column: usize, + definition: String, }, NonToplevelCallPackage { package_name: String, @@ -87,7 +90,7 @@ pub enum NixpkgsProblem { UnresolvableSymlink { relative_package_dir: PathBuf, subpath: PathBuf, - io_error: io::Error, + io_error: String, }, PathInterpolation { relative_package_dir: PathBuf, @@ -112,7 +115,7 @@ pub enum NixpkgsProblem { subpath: PathBuf, line: usize, text: String, - io_error: io::Error, + io_error: String, }, MovedOutOfByName { package_name: String, @@ -190,11 +193,23 @@ impl fmt::Display for NixpkgsProblem { "pkgs.{package_name}: This attribute is not defined but it should be defined automatically as {}", relative_package_file.display() ), - NixpkgsProblem::WrongCallPackage { relative_package_file, package_name } => - write!( + NixpkgsProblem::EmptyArgument { package_name, file, line, column, definition } => + writedoc!( f, - "pkgs.{package_name}: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage {} {{ ... }}` with a non-empty second argument.", - relative_package_file.display() + " + - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + + {package_name} = callPackage ./{} {{ /* ... */ }}; + + Notably the second argument must not be empty, which is not the case. + It is defined in {}:{} as + + {}", + structure::relative_dir_for_package(package_name).display(), + structure::relative_file_for_package(package_name).display(), + file.display(), + line, + indent_definition(*column, definition.clone()), ), NixpkgsProblem::NonToplevelCallPackage { package_name, file, line, column, definition } => writedoc!( diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index 200bf92c516a..bdc1fbec4a27 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -4,7 +4,6 @@ use crate::nix_file::CallPackageArgumentInfo; use crate::nixpkgs_problem::NixpkgsProblem; -use crate::structure; use crate::validation::{self, Validation, Validation::Success}; use std::collections::HashMap; @@ -127,17 +126,14 @@ impl RatchetState { pub enum ManualDefinition {} impl ToNixpkgsProblem for ManualDefinition { - type ToContext = (); + type ToContext = NixpkgsProblem; fn to_nixpkgs_problem( - name: &str, + _name: &str, _optional_from: Option<()>, - _to: &Self::ToContext, + to: &Self::ToContext, ) -> NixpkgsProblem { - NixpkgsProblem::WrongCallPackage { - relative_package_file: structure::relative_file_for_package(name), - package_name: name.to_owned(), - } + (*to).clone() } } diff --git a/pkgs/test/nixpkgs-check-by-name/src/references.rs b/pkgs/test/nixpkgs-check-by-name/src/references.rs index 169e996300ba..b716b99099c4 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/references.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/references.rs @@ -66,7 +66,7 @@ fn check_path( Err(io_error) => NixpkgsProblem::UnresolvableSymlink { relative_package_dir: relative_package_dir.to_path_buf(), subpath: subpath.to_path_buf(), - io_error, + io_error: io_error.to_string(), } .into(), } @@ -160,7 +160,7 @@ fn check_nix_file( subpath: subpath.to_path_buf(), line, text, - io_error: e, + io_error: e.to_string(), } .into(), ResolvedPath::Within(..) => { diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index 1cc970b7fd72..e619887012d0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -1,3 +1,17 @@ -pkgs.noEval: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/noEval/package.nix { ... }` with a non-empty second argument. -pkgs.onlyMove: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/on/onlyMove/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/no/noEval exists, the attribute `pkgs.noEval` must be defined like + + noEval = callPackage ./pkgs/by-name/no/noEval/package.nix { /* ... */ }; + + Notably the second argument must not be empty, which is not the case. + It is defined in all-packages.nix:9 as + + noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; +- Because pkgs/by-name/on/onlyMove exists, the attribute `pkgs.onlyMove` must be defined like + + onlyMove = callPackage ./pkgs/by-name/on/onlyMove/package.nix { /* ... */ }; + + Notably the second argument must not be empty, which is not the case. + It is defined in all-packages.nix:7 as + + onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index bf96b181d7fe..dc64698f4bfa 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -1,2 +1,9 @@ -pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like + + nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; + + Notably the second argument must not be empty, which is not the case. + It is defined in all-packages.nix:2 as + + nonDerivation = self.callPackage ./pkgs/by-name/no/nonDerivation/package.nix { }; This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index b835348cc3cf..d96d0d5638e5 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -1,5 +1,19 @@ -pkgs.a: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/a/a/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/a/a exists, the attribute `pkgs.a` must be defined like + + a = callPackage ./pkgs/by-name/a/a/package.nix { /* ... */ }; + + Notably the second argument must not be empty, which is not the case. + It is defined in all-packages.nix:2 as + + a = self.callPackage ./pkgs/by-name/a/a/package.nix { }; pkgs.b: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/b/b/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. -pkgs.c: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/c/c/package.nix { ... }` with a non-empty second argument. +- Because pkgs/by-name/c/c exists, the attribute `pkgs.c` must be defined like + + c = callPackage ./pkgs/by-name/c/c/package.nix { /* ... */ }; + + Notably the second argument must not be empty, which is not the case. + It is defined in all-packages.nix:4 as + + c = self.callPackage ./pkgs/by-name/c/c/package.nix { }; pkgs.d: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/d/d/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch From ce271786deaef526b9c99da85bf84ab4ff24a472 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 02:16:49 +0100 Subject: [PATCH 023/186] tests.nixpkgs-check-by-name: More spaces in errors --- .../nixpkgs-check-by-name/src/nixpkgs_problem.rs | 15 ++++++++++----- .../tests/alt-callPackage/expected | 1 + .../tests/manual-definition/expected | 2 ++ .../non-syntactical-callPackage-by-name/expected | 1 + .../tests/override-different-file/expected | 1 + .../tests/override-empty-arg/expected | 1 + .../tests/override-no-call-package/expected | 1 + .../tests/override-no-file/expected | 1 + .../tests/override-non-path/expected | 1 + 9 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index cf40238f9cb6..762d0e9fb0e0 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -204,7 +204,8 @@ impl fmt::Display for NixpkgsProblem { Notably the second argument must not be empty, which is not the case. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -222,7 +223,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: A different `callPackage` is used. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -240,7 +242,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: The first callPackage argument is not right: It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), @@ -258,7 +261,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case: The first `callPackage` argument is the wrong path. It is defined in {}:{}:{} as - {package_name} = callPackage {} {{ /* ... */ }};", + {package_name} = callPackage {} {{ /* ... */ }}; + ", structure::relative_dir_for_package(package_name).display(), create_path_expr(file, expected_path), file.display(), line, column, @@ -275,7 +279,8 @@ impl fmt::Display for NixpkgsProblem { This is however not the case. It is defined in {}:{} as - {}", + {} + ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), file.display(), diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected index 80d79ecaba12..2d05db0d4699 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:5 as foo = self.alt.callPackage ({ }: self.someDrv) { }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index e619887012d0..71d78019604b 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -6,6 +6,7 @@ It is defined in all-packages.nix:9 as noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; + - Because pkgs/by-name/on/onlyMove exists, the attribute `pkgs.onlyMove` must be defined like onlyMove = callPackage ./pkgs/by-name/on/onlyMove/package.nix { /* ... */ }; @@ -14,4 +15,5 @@ It is defined in all-packages.nix:7 as onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index 5f914d1fce96..f56585ac4678 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:4 as foo = self.bar; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 6f439dd4b7d0..571ec8e09a5c 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2:3 as nonDerivation = callPackage ./someDrv.nix { /* ... */ }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index dc64698f4bfa..257030e9a6c0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.callPackage ./pkgs/by-name/no/nonDerivation/package.nix { }; + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index f1fc4892b2ab..eb13c4df1e88 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.someDrv; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index 040d7c635f7a..31679e55b7d6 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:2 as nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; + This PR introduces the above problems, merging would break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index 1f15c6473b4a..e7fd8242f5f4 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -6,4 +6,5 @@ It is defined in all-packages.nix:3 as foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; + This PR introduces the above problems, merging would break the base branch From d2fa5bafa9faff354c13c3117deb3025ca4a5795 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 02:17:47 +0100 Subject: [PATCH 024/186] tests.nixpkgs-check-by-name: Improve errors for new packages Or rather, make it more consistent --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 2 +- .../src/nixpkgs_problem.rs | 35 +++++++++++++------ .../test/nixpkgs-check-by-name/src/ratchet.rs | 7 ++-- .../tests/move-to-non-by-name/expected | 16 ++++++--- .../tests/new-package-non-by-name/expected | 24 ++++++++++--- .../tests/sorted-order/expected | 14 ++++++-- 6 files changed, 75 insertions(+), 23 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index 4748e907db72..a8427a27ee43 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -504,7 +504,7 @@ fn handle_non_by_name_attribute( _ => { // Otherwise, the path is outside `pkgs/by-name`, which means it can be // migrated - Loose(syntactic_call_package) + Loose((syntactic_call_package, location.file)) } } } diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 762d0e9fb0e0..fac789e3e03f 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -121,11 +121,13 @@ pub enum NixpkgsProblem { package_name: String, call_package_path: Option, empty_arg: bool, + file: PathBuf, }, NewPackageNotUsingByName { package_name: String, call_package_path: Option, empty_arg: bool, + file: PathBuf, }, InternalCallPackageUsed { attr_name: String, @@ -340,7 +342,7 @@ impl fmt::Display for NixpkgsProblem { subpath.display(), text, ), - NixpkgsProblem::MovedOutOfByName { package_name, call_package_path, empty_arg } => { + NixpkgsProblem::MovedOutOfByName { package_name, call_package_path, empty_arg, file } => { let call_package_arg = if let Some(path) = &call_package_path { format!("./{}", path.display()) @@ -348,22 +350,30 @@ impl fmt::Display for NixpkgsProblem { "...".into() }; if *empty_arg { - write!( + writedoc!( f, - "pkgs.{package_name}: This top-level package was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ }}` (e.g. in `pkgs/top-level/all-packages.nix`). Please move the package back and remove the manual `callPackage`.", + " + - Attribute `pkgs.{package_name} was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {}. + Please move the package back and remove the manual `callPackage`. + ", structure::relative_file_for_package(package_name).display(), + file.display(), ) } else { // This can happen if users mistakenly assume that for custom arguments, // pkgs/by-name can't be used. - write!( + writedoc!( f, - "pkgs.{package_name}: This top-level package was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` (e.g. in `pkgs/top-level/all-packages.nix`). While the manual `callPackage` is still needed, it's not necessary to move the package files.", + " + - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {}. + While the manual `callPackage` is still needed, it's not necessary to move the package files. + ", structure::relative_file_for_package(package_name).display(), + file.display(), ) } }, - NixpkgsProblem::NewPackageNotUsingByName { package_name, call_package_path, empty_arg } => { + NixpkgsProblem::NewPackageNotUsingByName { package_name, call_package_path, empty_arg, file } => { let call_package_arg = if let Some(path) = &call_package_path { format!("./{}", path.display()) @@ -372,13 +382,18 @@ impl fmt::Display for NixpkgsProblem { }; let extra = if *empty_arg { - "Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore." + format!("Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {} is needed anymore.", file.display()) } else { - "Since the second `callPackage` argument is not `{ }`, the manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is still needed." + format!("Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {} is still needed.", file.display()) }; - write!( + writedoc!( f, - "pkgs.{package_name}: This is a new top-level package of the form `callPackage {call_package_arg} {{ }}`. Please define it in {} instead. See `pkgs/by-name/README.md` for more details. {extra}", + " + - Attribute `pkgs.{package_name}` is a new top-level package using `pkgs.callPackage {call_package_arg} {{ /* ... */ }}`. + Please define it in {} instead. + See `pkgs/by-name/README.md` for more details. + {extra} + ", structure::relative_file_for_package(package_name).display(), ) }, diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index bdc1fbec4a27..28036d3689f1 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -6,6 +6,7 @@ use crate::nix_file::CallPackageArgumentInfo; use crate::nixpkgs_problem::NixpkgsProblem; use crate::validation::{self, Validation, Validation::Success}; use std::collections::HashMap; +use std::path::PathBuf; /// The ratchet value for the entirety of Nixpkgs. #[derive(Default)] @@ -145,24 +146,26 @@ impl ToNixpkgsProblem for ManualDefinition { pub enum UsesByName {} impl ToNixpkgsProblem for UsesByName { - type ToContext = CallPackageArgumentInfo; + type ToContext = (CallPackageArgumentInfo, PathBuf); fn to_nixpkgs_problem( name: &str, optional_from: Option<()>, - to: &Self::ToContext, + (to, file): &Self::ToContext, ) -> NixpkgsProblem { if let Some(()) = optional_from { NixpkgsProblem::MovedOutOfByName { package_name: name.to_owned(), call_package_path: to.relative_path.clone(), empty_arg: to.empty_arg, + file: file.to_owned(), } } else { NixpkgsProblem::NewPackageNotUsingByName { package_name: name.to_owned(), call_package_path: to.relative_path.clone(), empty_arg: to.empty_arg, + file: file.to_owned(), } } } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected index 8a2116aebcb9..3319cc271ac9 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected @@ -1,5 +1,13 @@ -pkgs.foo1: This top-level package was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { }` (e.g. in `pkgs/top-level/all-packages.nix`). Please move the package back and remove the manual `callPackage`. -pkgs.foo2: This top-level package was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { }` (e.g. in `pkgs/top-level/all-packages.nix`). Please move the package back and remove the manual `callPackage`. -pkgs.foo3: This top-level package was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` (e.g. in `pkgs/top-level/all-packages.nix`). While the manual `callPackage` is still needed, it's not necessary to move the package files. -pkgs.foo4: This top-level package was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` (e.g. in `pkgs/top-level/all-packages.nix`). While the manual `callPackage` is still needed, it's not necessary to move the package files. +- Attribute `pkgs.foo1 was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. + Please move the package back and remove the manual `callPackage`. + +- Attribute `pkgs.foo2 was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. + Please move the package back and remove the manual `callPackage`. + +- Attribute `pkgs.foo3` was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. + While the manual `callPackage` is still needed, it's not necessary to move the package files. + +- Attribute `pkgs.foo4` was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. + While the manual `callPackage` is still needed, it's not necessary to move the package files. + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected index 31eff28f3c88..a7db19e5fd90 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected @@ -1,5 +1,21 @@ -pkgs.new1: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/ne/new1/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. -pkgs.new2: This is a new top-level package of the form `callPackage ./without-config.nix { }`. Please define it in pkgs/by-name/ne/new2/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. -pkgs.new3: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/ne/new3/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{ }`, the manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is still needed. -pkgs.new4: This is a new top-level package of the form `callPackage ./with-config.nix { }`. Please define it in pkgs/by-name/ne/new4/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{ }`, the manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is still needed. +- Attribute `pkgs.new1` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. + Please define it in pkgs/by-name/ne/new1/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is needed anymore. + +- Attribute `pkgs.new2` is a new top-level package using `pkgs.callPackage ./without-config.nix { /* ... */ }`. + Please define it in pkgs/by-name/ne/new2/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is needed anymore. + +- Attribute `pkgs.new3` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. + Please define it in pkgs/by-name/ne/new3/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is still needed. + +- Attribute `pkgs.new4` is a new top-level package using `pkgs.callPackage ./with-config.nix { /* ... */ }`. + Please define it in pkgs/by-name/ne/new4/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is still needed. + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index d96d0d5638e5..2b3c2cdeee18 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -6,7 +6,12 @@ It is defined in all-packages.nix:2 as a = self.callPackage ./pkgs/by-name/a/a/package.nix { }; -pkgs.b: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/b/b/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. + +- Attribute `pkgs.b` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. + Please define it in pkgs/by-name/b/b/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/all-packages.nix is needed anymore. + - Because pkgs/by-name/c/c exists, the attribute `pkgs.c` must be defined like c = callPackage ./pkgs/by-name/c/c/package.nix { /* ... */ }; @@ -15,5 +20,10 @@ pkgs.b: This is a new top-level package of the form `callPackage ... { }`. Pleas It is defined in all-packages.nix:4 as c = self.callPackage ./pkgs/by-name/c/c/package.nix { }; -pkgs.d: This is a new top-level package of the form `callPackage ... { }`. Please define it in pkgs/by-name/d/d/package.nix instead. See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` (e.g. in `pkgs/top-level/all-packages.nix`) is needed anymore. + +- Attribute `pkgs.d` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. + Please define it in pkgs/by-name/d/d/package.nix instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/all-packages.nix is needed anymore. + This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch From 64da6178bf10b92f57352d7d0cfca7eebbd527df Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 23 Feb 2024 02:32:27 +0100 Subject: [PATCH 025/186] tests.nixpkgs-check-by-name: Fix internal docs --- pkgs/test/nixpkgs-check-by-name/src/nix_file.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index 1382f389e2da..0176164e2cea 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -86,7 +86,7 @@ pub struct CallPackageArgumentInfo { impl NixFile { /// Returns information about callPackage arguments for an attribute at a specific line/column /// index. - /// If the location is not of the form ` = callPackage ;`, `Ok(Err(String))` is + /// If the location is not of the form ` = callPackage ;`, `Ok((None, String))` is /// returned, with String being how the definition looks like. /// /// This function only returns `Err` for problems that can't be caused by the Nix contents, @@ -109,7 +109,10 @@ impl NixFile { /// /// You'll get back /// ```rust - /// Ok(Ok(CallPackageArgumentInfo { path = Some("default.nix"), empty_arg: true })) + /// Ok(( + /// Some(CallPackageArgumentInfo { path = Some("default.nix"), empty_arg: true }), + /// "foo = self.callPackage ./default.nix { };", + /// )) /// ``` /// /// Note that this also returns the same for `pythonPackages.callPackage`. It doesn't make an From 132162cb7ac45a060227613b030e0a4a476bb0a1 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 16 Feb 2024 15:55:18 +0100 Subject: [PATCH 026/186] ptcollab: 0.6.4.7 -> 0.6.4.8 --- .../pt/ptcollab/package.nix} | 28 +++++++++---------- pkgs/top-level/all-packages.nix | 4 ++- 2 files changed, 17 insertions(+), 15 deletions(-) rename pkgs/{applications/audio/ptcollab/default.nix => by-name/pt/ptcollab/package.nix} (74%) diff --git a/pkgs/applications/audio/ptcollab/default.nix b/pkgs/by-name/pt/ptcollab/package.nix similarity index 74% rename from pkgs/applications/audio/ptcollab/default.nix rename to pkgs/by-name/pt/ptcollab/package.nix index ca98012c3ff5..f03d89e7c490 100644 --- a/pkgs/applications/audio/ptcollab/default.nix +++ b/pkgs/by-name/pt/ptcollab/package.nix @@ -1,40 +1,39 @@ -{ mkDerivation +{ stdenv , lib -, stdenv , fetchFromGitHub , nix-update-script +, libsForQt5 , libvorbis , pkg-config -, qmake -, qtbase -, qttools -, qtmultimedia , rtmidi }: -mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ptcollab"; - version = "0.6.4.7"; + version = "0.6.4.8"; src = fetchFromGitHub { owner = "yuxshao"; repo = "ptcollab"; - rev = "v${version}"; - hash = "sha256-KYNov/HbKM2d8VVO8iyWA3XWFDE9iWeKkRCNC1xlPNw="; + rev = "v${finalAttrs.version}"; + hash = "sha256-9u2K79QJRfYKL66e1lsRrQMEqmKTWbK+ucal3/u4rP4="; }; nativeBuildInputs = [ pkg-config + ] ++ (with libsForQt5; [ qmake qttools - ]; + wrapQtAppsHook + ]); buildInputs = [ libvorbis + rtmidi + ] ++ (with libsForQt5; [ qtbase qtmultimedia - rtmidi - ]; + ]); postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' # Move appbundles to Applications before wrapping happens @@ -54,8 +53,9 @@ mkDerivation rec { meta = with lib; { description = "Experimental pxtone editor where you can collaborate with friends"; homepage = "https://yuxshao.github.io/ptcollab/"; + changelog = "https://github.com/yuxshao/ptcollab/releases/tag/v${finalAttrs.version}"; license = licenses.mit; maintainers = with maintainers; [ OPNA2608 ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3023859f6f6..11581d2603d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30326,7 +30326,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Cocoa CoreAudio Foundation; }; - ptcollab = libsForQt5.callPackage ../applications/audio/ptcollab { }; + ptcollab = callPackage ../by-name/pt/ptcollab/package.nix { + stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; + }; schismtracker = callPackage ../applications/audio/schismtracker { inherit (darwin.apple_sdk.frameworks) Cocoa; From 4973402708a4806a4e9424bda05ccbf6174bcfb6 Mon Sep 17 00:00:00 2001 From: happysalada Date: Sun, 25 Feb 2024 09:15:33 -0500 Subject: [PATCH 027/186] python310Packages.fairseq: fix build; disable hydra hydra fails for an obscure reason, this can be re-enabled once the failure is investigated and fixed --- pkgs/development/python-modules/fairseq/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/fairseq/default.nix b/pkgs/development/python-modules/fairseq/default.nix index 35275c32780a..e784f8ec0b0d 100644 --- a/pkgs/development/python-modules/fairseq/default.nix +++ b/pkgs/development/python-modules/fairseq/default.nix @@ -96,6 +96,7 @@ buildPythonPackage rec { disabledTests = [ # this test requires xformers "test_xformers_single_forward_parity" + "test_mask_for_xformers" # this test requires iopath "test_file_io_async" # these tests require network access @@ -105,6 +106,8 @@ buildPythonPackage rec { "test_waitk_checkpoint" "test_sotasty_es_en_600m_checkpoint" "test_librispeech_s2t_conformer_s_checkpoint" + # TODO research failure + "test_multilingual_translation_latent_depth" ]; disabledTestPaths = [ @@ -117,6 +120,7 @@ buildPythonPackage rec { homepage = "https://github.com/pytorch/fairseq"; license = licenses.mit; platforms = platforms.linux; + hydraPlatforms = []; maintainers = with maintainers; [ happysalada ]; }; } From 5135272cb67ed613216928341e5f398269c4ee08 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Feb 2024 14:52:00 -0300 Subject: [PATCH 028/186] live555: 2023.11.30 -> 2024.02.15 --- pkgs/by-name/li/live555/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/live555/package.nix b/pkgs/by-name/li/live555/package.nix index b08ed44f4854..6e87127e5321 100644 --- a/pkgs/by-name/li/live555/package.nix +++ b/pkgs/by-name/li/live555/package.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "live555"; - version = "2023.11.30"; + version = "2024.02.15"; src = fetchurl { urls = [ @@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: { "https://download.videolan.org/contrib/live555/live.${finalAttrs.version}.tar.gz" "mirror://sourceforge/slackbuildsdirectlinks/live.${finalAttrs.version}.tar.gz" ]; - hash = "sha256-xue+9YtdAM2XkzAY6dU2PZ3n6bvPwlULIHqBqc8wuSU="; + hash = "sha256-yHloxqGRxK1Re6dSFDr4ZENh7/ASewle/QCtstWZ354="; }; patches = [ From 524a9eca5e9b7feb47671f04c10ca296d66b71ca Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Feb 2024 14:53:38 -0300 Subject: [PATCH 029/186] live555: 2024.02.15 -> 2024.02.23 --- pkgs/by-name/li/live555/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/live555/package.nix b/pkgs/by-name/li/live555/package.nix index 6e87127e5321..123b775cea97 100644 --- a/pkgs/by-name/li/live555/package.nix +++ b/pkgs/by-name/li/live555/package.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "live555"; - version = "2024.02.15"; + version = "2024.02.23"; src = fetchurl { urls = [ @@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: { "https://download.videolan.org/contrib/live555/live.${finalAttrs.version}.tar.gz" "mirror://sourceforge/slackbuildsdirectlinks/live.${finalAttrs.version}.tar.gz" ]; - hash = "sha256-yHloxqGRxK1Re6dSFDr4ZENh7/ASewle/QCtstWZ354="; + hash = "sha256-85JWXfsPAvocX5PiKXw9Xkd4zm2akzxMeETsZ3xm2wg="; }; patches = [ From 03863969b717da4896652e05cc5c4c66afd18bef Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Feb 2024 05:46:08 +0000 Subject: [PATCH 030/186] rsgain: 3.4 -> 3.5 --- pkgs/by-name/rs/rsgain/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/rs/rsgain/package.nix b/pkgs/by-name/rs/rsgain/package.nix index 79b86ca95493..adb2be57332c 100644 --- a/pkgs/by-name/rs/rsgain/package.nix +++ b/pkgs/by-name/rs/rsgain/package.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "rsgain"; - version = "3.4"; + version = "3.5"; src = fetchFromGitHub { owner = "complexlogic"; repo = "rsgain"; rev = "v${version}"; - sha256 = "sha256-AiNjsrwTF6emcwXo2TPMbs8mLavGS7NsvytAppMGKfY="; + sha256 = "sha256-qIRtdgfGDNbZk9TQ3GC3lYetRqjOk8QPhAb4MuFuN0U="; }; cmakeFlags = ["-DCMAKE_BUILD_TYPE='Release'"]; From 950ac6fe425d9020ccea2bbd93ae25269b547d86 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Mon, 26 Feb 2024 14:08:04 +0100 Subject: [PATCH 031/186] rPackages.gifski: fixed build --- pkgs/development/r-modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index e7005357f2bb..709170c6ce24 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -943,7 +943,7 @@ let cargoDeps = pkgs.rustPlatform.fetchCargoTarball { src = attrs.src; sourceRoot = "gifski/src/myrustlib"; - hash = "sha256-vBrTQ+5JZA8554Aasbqw7mbaOfJNQjrOpG00IXAcamI="; + hash = "sha256-e6nuiQU22GiO2I+bu0muyICGrdkCLSZUDHDz2mM2hz0="; }; cargoRoot = "src/myrustlib"; From e320f9245df0eace86c8f0e1c14dcb6b68e5f879 Mon Sep 17 00:00:00 2001 From: Ryan Gibb Date: Mon, 26 Feb 2024 11:59:28 +0000 Subject: [PATCH 032/186] libvpl: patch to search `/run/opengl-drivers/lib/` for runtime implementations --- .../by-name/li/libvpl/opengl-driver-lib.patch | 19 +++++++++++++++++++ pkgs/by-name/li/libvpl/package.nix | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/by-name/li/libvpl/opengl-driver-lib.patch diff --git a/pkgs/by-name/li/libvpl/opengl-driver-lib.patch b/pkgs/by-name/li/libvpl/opengl-driver-lib.patch new file mode 100644 index 000000000000..5913190a5384 --- /dev/null +++ b/pkgs/by-name/li/libvpl/opengl-driver-lib.patch @@ -0,0 +1,19 @@ +--- a/libvpl/src/mfx_dispatcher_vpl_loader.cpp ++++ b/libvpl/src/mfx_dispatcher_vpl_loader.cpp +@@ -548,6 +548,16 @@ mfxStatus LoaderCtxVPL::BuildListOfCandidateLibs() { + it++; + } + ++ // fourth priority ++ searchDirList.clear(); ++ searchDirList.push_back("@driverLink@/lib"); ++ it = searchDirList.begin(); ++ while (it != searchDirList.end()) { ++ STRING_TYPE nextDir = (*it); ++ sts = SearchDirForLibs(nextDir, m_libInfoList, LIB_PRIORITY_05); ++ it++; ++ } ++ + // lowest priority: legacy MSDK installation + searchDirList.clear(); + GetSearchPathsLegacy(searchDirList); diff --git a/pkgs/by-name/li/libvpl/package.nix b/pkgs/by-name/li/libvpl/package.nix index 8a647916ca63..f28287053beb 100644 --- a/pkgs/by-name/li/libvpl/package.nix +++ b/pkgs/by-name/li/libvpl/package.nix @@ -3,6 +3,8 @@ , fetchFromGitHub , cmake , pkg-config +, substituteAll +, addDriverRunpath }: stdenv.mkDerivation (finalAttrs: { @@ -32,6 +34,13 @@ stdenv.mkDerivation (finalAttrs: { "-DBUILD_TOOLS=OFF" ]; + patches = [ + (substituteAll { + src = ./opengl-driver-lib.patch; + inherit (addDriverRunpath) driverLink; + }) + ]; + meta = with lib; { description = "Intel Video Processing Library"; homepage = "https://intel.github.io/libvpl/"; From 72f3c3e8e215923c6a4b4f85923faed4f4e7f3cf Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Mon, 26 Feb 2024 17:20:26 +0100 Subject: [PATCH 033/186] rPackages.rmatio: fixed build --- pkgs/development/r-modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index e7005357f2bb..b8804d9edb64 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -405,7 +405,7 @@ let rjags = [ pkgs.jags ]; rJava = with pkgs; [ zlib bzip2.dev icu xz.dev pcre.dev jdk libzip ]; Rlibeemd = [ pkgs.gsl ]; - rmatio = [ pkgs.zlib.dev ]; + rmatio = [ pkgs.zlib.dev pkgs.pkg-config ]; Rmpfr = with pkgs; [ gmp mpfr.dev ]; Rmpi = [ pkgs.mpi ]; RMySQL = with pkgs; [ zlib libmysqlclient openssl.dev ]; From 542b6bf2e82bf5468572af3cc112ac7a462a8950 Mon Sep 17 00:00:00 2001 From: Kiskae Date: Mon, 29 Jan 2024 17:05:55 +0100 Subject: [PATCH 034/186] composefs: inherit nixosTests --- pkgs/by-name/co/composefs/package.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/composefs/package.nix b/pkgs/by-name/co/composefs/package.nix index d83acd06e24b..6d0b6b9319b9 100644 --- a/pkgs/by-name/co/composefs/package.nix +++ b/pkgs/by-name/co/composefs/package.nix @@ -16,6 +16,7 @@ , fsverity-utils , nix-update-script , testers +, nixosTests , fuseSupport ? lib.meta.availableOn stdenv.hostPlatform fuse3 , enableValgrindCheck ? false @@ -69,7 +70,11 @@ stdenv.mkDerivation (finalAttrs: { passthru = { updateScript = nix-update-script { }; - tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + tests = { + # Broken on aarch64 unrelated to this package: https://github.com/NixOS/nixpkgs/issues/291398 + inherit (nixosTests) activation-etc-overlay-immutable activation-etc-overlay-mutable; + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; }; meta = { From 38306315fb439b0adc8dbc0c1f3501f170155721 Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sat, 24 Feb 2024 19:19:48 +0100 Subject: [PATCH 035/186] yamlscript: init at 0.1.38 --- pkgs/by-name/ya/yamlscript/package.nix | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/by-name/ya/yamlscript/package.nix diff --git a/pkgs/by-name/ya/yamlscript/package.nix b/pkgs/by-name/ya/yamlscript/package.nix new file mode 100644 index 000000000000..dd86546d72d4 --- /dev/null +++ b/pkgs/by-name/ya/yamlscript/package.nix @@ -0,0 +1,40 @@ +{ lib, buildGraalvmNativeImage, fetchurl }: + +buildGraalvmNativeImage rec { + pname = "yamlscript"; + version = "0.1.38"; + + src = fetchurl { + url = "https://github.com/yaml/yamlscript/releases/download/${version}/yamlscript.cli-${version}-standalone.jar"; + hash = "sha256-cdRMmeJTlkEmF4jbElrXgobSU+VIvh/k9Lr9WkOSTl8="; + }; + + executable = "ys"; + + extraNativeImageBuildArgs = [ + "--native-image-info" + "--no-fallback" + "--initialize-at-build-time" + "--enable-preview" + "-H:+ReportExceptionStackTraces" + "-H:IncludeResources=SCI_VERSION" + "-H:Log=registerResource:" + "-J-Dclojure.spec.skip-macros=true" + "-J-Dclojure.compiler.direct-linking=true" + ]; + + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/ys -e 'say: (+ 1 2)' | fgrep 3 + ''; + + meta = with lib; { + description = "Programming in YAML"; + homepage = "https://github.com/yaml/yamlscript"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.mit; + mainProgram = "ys"; + maintainers = with maintainers; [ sgo ]; + }; +} From c1ccf3e36c621c3a6dfdf3961579c7c059179876 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Feb 2024 02:58:35 +0000 Subject: [PATCH 036/186] cloud-init: 23.4.3 -> 23.4.4 --- pkgs/tools/virtualization/cloud-init/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/virtualization/cloud-init/default.nix b/pkgs/tools/virtualization/cloud-init/default.nix index 2bbdf2104954..dd6e6c483a33 100644 --- a/pkgs/tools/virtualization/cloud-init/default.nix +++ b/pkgs/tools/virtualization/cloud-init/default.nix @@ -17,14 +17,14 @@ python3.pkgs.buildPythonApplication rec { pname = "cloud-init"; - version = "23.4.3"; + version = "23.4.4"; namePrefix = ""; src = fetchFromGitHub { owner = "canonical"; repo = "cloud-init"; rev = "refs/tags/${version}"; - hash = "sha256-oYZr0Zvo6hn9sWtgSAGgfK2stHO247f0WUbzIIWUP18="; + hash = "sha256-imA3C2895W4vbBT9TsELT1H9QfNIxntNQLsniv+/FGg="; }; patches = [ From 881167e93f0d8636e937bc6a6a13459f0f829538 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 25 Feb 2024 20:25:05 +0100 Subject: [PATCH 037/186] python311Packages.jaxtyping: 0.2.25 -> 0.2.26 Diff: https://github.com/google/jaxtyping/compare/refs/tags/v0.2.25...v0.2.26 --- .../python-modules/jaxtyping/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/jaxtyping/default.nix b/pkgs/development/python-modules/jaxtyping/default.nix index cb73681bc276..26e638f98e32 100644 --- a/pkgs/development/python-modules/jaxtyping/default.nix +++ b/pkgs/development/python-modules/jaxtyping/default.nix @@ -3,6 +3,7 @@ , pythonOlder , fetchFromGitHub , hatchling +, pythonRelaxDepsHook , numpy , typeguard , typing-extensions @@ -19,7 +20,7 @@ let self = buildPythonPackage rec { pname = "jaxtyping"; - version = "0.2.25"; + version = "0.2.26"; pyproject = true; disabled = pythonOlder "3.9"; @@ -28,16 +29,12 @@ let owner = "google"; repo = "jaxtyping"; rev = "refs/tags/v${version}"; - hash = "sha256-+JqpI5xrM7o73LG6oMix88Jr5aptmWYjJQcqUNo7icg="; + hash = "sha256-2QDTRNH2/9FPU5xrQx7yZRHwEWqj0PUNzcCuKwY4yNg="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "typeguard>=2.13.3,<3" "typeguard" - ''; - nativeBuildInputs = [ hatchling + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -46,6 +43,10 @@ let typing-extensions ]; + pythonRelaxDeps = [ + "typeguard" + ]; + nativeCheckInputs = [ cloudpickle equinox From 67538576647556187f34781568bb93a687dc859d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Feb 2024 20:07:47 +0100 Subject: [PATCH 038/186] nixos/tailscale: add option to pass flags to tailscaled --- nixos/modules/services/networking/tailscale.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/tailscale.nix b/nixos/modules/services/networking/tailscale.nix index f11fe57d6ce5..972299a4697a 100644 --- a/nixos/modules/services/networking/tailscale.nix +++ b/nixos/modules/services/networking/tailscale.nix @@ -66,6 +66,13 @@ in { default = []; example = ["--ssh"]; }; + + extraDaemonFlags = mkOption { + description = lib.mdDoc "Extra flags to pass to {command}`tailscaled`."; + type = types.listOf types.str; + default = []; + example = ["--no-logs-no-support"]; + }; }; config = mkIf cfg.enable { @@ -80,7 +87,7 @@ in { ] ++ lib.optional config.networking.resolvconf.enable config.networking.resolvconf.package; serviceConfig.Environment = [ "PORT=${toString cfg.port}" - ''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName}"'' + ''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName} ${lib.concatStringsSep " " cfg.extraDaemonFlags}"'' ] ++ (lib.optionals (cfg.permitCertUid != null) [ "TS_PERMIT_CERT_UID=${cfg.permitCertUid}" ]); From 5df62e8e430462e134ec5f97d4242995b54b6de8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 10 Feb 2024 09:42:01 +0000 Subject: [PATCH 039/186] mmv: 2.5.1 -> 2.6 --- pkgs/tools/misc/mmv/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/mmv/default.nix b/pkgs/tools/misc/mmv/default.nix index c8ce33207787..f2d2bd81ae11 100644 --- a/pkgs/tools/misc/mmv/default.nix +++ b/pkgs/tools/misc/mmv/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { pname = "mmv"; - version = "2.5.1"; + version = "2.6"; src = fetchFromGitHub { owner = "rrthomas"; repo = "mmv"; rev = "v${version}"; - sha256 = "sha256-01MJjYVPfDaRkzitqKXTJZHbkkZTEaFoyYZEEMizHp0="; + sha256 = "sha256-hYSTENSmkJP5rAemDyTzbzMKFrWYcMpsJDRWq43etTM="; fetchSubmodules = true; }; @@ -19,11 +19,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gengetopt m4 git gnupg perl autoconf automake help2man pkg-config ]; buildInputs = [ boehmgc ]; + enableParallelBuilding = true; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-function-declaration" "-Wno-error=implicit-int" + "-Wno-error=int-conversion" ]; }; From 7a269ff69b8a2e5bb63f553eb6b0e878f5f7e868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Tue, 27 Feb 2024 22:33:03 +0100 Subject: [PATCH 040/186] wasm-tools: 1.200.0 -> 1.201.0 --- pkgs/tools/misc/wasm-tools/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/wasm-tools/default.nix b/pkgs/tools/misc/wasm-tools/default.nix index d72e726da863..539850306bfe 100644 --- a/pkgs/tools/misc/wasm-tools/default.nix +++ b/pkgs/tools/misc/wasm-tools/default.nix @@ -5,19 +5,19 @@ rustPlatform.buildRustPackage rec { pname = "wasm-tools"; - version = "1.200.0"; + version = "1.201.0"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = pname; rev = "v${version}"; - hash = "sha256-GuN70HiCmqBRwcosXqzT8sl5SRCTttOPIRl6pxaQiec="; + hash = "sha256-L3wo6a9rxqZ8Rjz8nejbfdTgQclFFp2ShdP6QECbrmg="; fetchSubmodules = true; }; # Disable cargo-auditable until https://github.com/rust-secure-code/cargo-auditable/issues/124 is solved. auditable = false; - cargoHash = "sha256-T9p1PvgiAZrj82ABx7KX2InZACQ/ff7N0zPKGTCTBPk="; + cargoHash = "sha256-XzU43bcoRGHhVmpkcKvdRH9UybjTkQWH8RKBqsM/31M="; cargoBuildFlags = [ "--package" "wasm-tools" ]; cargoTestFlags = [ "--all" ]; From dcff4f831836e249db5e808aeac6ca71d498cdc7 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 27 Jan 2024 11:15:29 -0500 Subject: [PATCH 041/186] zfs_2_2: Rename from zfsStable The `zfs` alias already has equivalent semantics. Instead, make this like zfs_2_1 so folks who want to pin a specific release series can do so easily and clearly to have more control over when more substantial updates occur. Rename all tests to match the pkg attr they are testing. --- nixos/tests/zfs.nix | 10 +++++----- pkgs/os-specific/linux/zfs/{stable.nix => 2_2.nix} | 4 ++-- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 ++-- pkgs/top-level/linux-kernels.nix | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) rename pkgs/os-specific/linux/zfs/{stable.nix => 2_2.nix} (90%) diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 0b411b0b9d8a..a9bf66607574 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -192,22 +192,22 @@ let in { # maintainer: @raitobezarius - series_2_1 = makeZfsTest "2.1-series" { + series_2_1 = makeZfsTest "zfs_2_1" { zfsPackage = pkgs.zfs_2_1; kernelPackages = pkgs.linuxPackages; }; - stable = makeZfsTest "stable" { - zfsPackage = pkgs.zfsStable; + series_2_2 = makeZfsTest "zfs_2_2" { + zfsPackage = pkgs.zfs_2_2; kernelPackages = pkgs.linuxPackages; }; - unstable = makeZfsTest "unstable" rec { + unstable = makeZfsTest "zfsUnstable" rec { zfsPackage = pkgs.zfsUnstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; }; - unstableWithSystemdStage1 = makeZfsTest "unstable" rec { + unstableWithSystemdStage1 = makeZfsTest "zfsUnstable" rec { zfsPackage = pkgs.zfsUnstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; enableSystemdStage1 = true; diff --git a/pkgs/os-specific/linux/zfs/stable.nix b/pkgs/os-specific/linux/zfs/2_2.nix similarity index 90% rename from pkgs/os-specific/linux/zfs/stable.nix rename to pkgs/os-specific/linux/zfs/2_2.nix index 7ca1d5be3787..3e5d262f73d0 100644 --- a/pkgs/os-specific/linux/zfs/stable.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -12,7 +12,7 @@ in callPackage ./generic.nix args { # You have to ensure that in `pkgs/top-level/linux-kernels.nix` # this attribute is the correct one for this package. - kernelModuleAttribute = "zfs"; + kernelModuleAttribute = "zfs_2_2"; # check the release notes for compatible kernels kernelCompatible = kernel.kernelOlder "6.8"; @@ -23,7 +23,7 @@ callPackage ./generic.nix args { tests = [ nixosTests.zfs.installer - nixosTests.zfs.stable + nixosTests.zfs.series_2_2 ]; hash = "sha256-Bzkow15OitUUQ+mTYhCXgTrQl+ao/B4feleHY/rSSjg="; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5d0ef64bf9a6..ddfed4a09550 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1211,6 +1211,7 @@ mapAliases ({ ### Z ### zabbix40 = throw "'zabbix40' has been removed as it has reached end of life"; # Added 2024-01-07 + zfsStable = zfs; # Added 2024-02-26 zinc = zincsearch; # Added 2023-05-28 zkg = throw "'zkg' has been replaced by 'zeek'"; zq = zed.overrideAttrs (old: { meta = old.meta // { mainProgram = "zq"; }; }); # Added 2023-02-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8a5bb73d67b..6d4f19c255e0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28729,13 +28729,13 @@ with pkgs; zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix { configFile = "user"; }; - zfsStable = callPackage ../os-specific/linux/zfs/stable.nix { + zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { configFile = "user"; }; zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix { configFile = "user"; }; - zfs = zfsStable; + zfs = zfs_2_2; ### DATA diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 47838b60569f..7df1bb0c0081 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -565,7 +565,7 @@ in { configFile = "kernel"; inherit pkgs kernel; }; - zfsStable = callPackage ../os-specific/linux/zfs/stable.nix { + zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { configFile = "kernel"; inherit pkgs kernel; }; @@ -573,7 +573,7 @@ in { configFile = "kernel"; inherit pkgs kernel; }; - zfs = zfsStable; + zfs = zfs_2_2; can-isotp = callPackage ../os-specific/linux/can-isotp { }; From 1c846675398059067b6ad147abc6a7877c4b8368 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 27 Jan 2024 12:17:29 -0500 Subject: [PATCH 042/186] nixos/tests/zfs: Get test name from pkg under test The previous names are already this. --- nixos/tests/zfs.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index a9bf66607574..4bc608ac75e5 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -7,14 +7,14 @@ with import ../lib/testing-python.nix { inherit system pkgs; }; let - makeZfsTest = name: + makeZfsTest = { kernelPackages , enableSystemdStage1 ? false , zfsPackage , extraTest ? "" }: makeTest { - name = "zfs-" + name; + name = zfsPackage.kernelModuleAttribute; meta = with pkgs.lib.maintainers; { maintainers = [ elvishjerricco ]; }; @@ -192,22 +192,22 @@ let in { # maintainer: @raitobezarius - series_2_1 = makeZfsTest "zfs_2_1" { + series_2_1 = makeZfsTest { zfsPackage = pkgs.zfs_2_1; kernelPackages = pkgs.linuxPackages; }; - series_2_2 = makeZfsTest "zfs_2_2" { + series_2_2 = makeZfsTest { zfsPackage = pkgs.zfs_2_2; kernelPackages = pkgs.linuxPackages; }; - unstable = makeZfsTest "zfsUnstable" rec { + unstable = makeZfsTest rec { zfsPackage = pkgs.zfsUnstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; }; - unstableWithSystemdStage1 = makeZfsTest "zfsUnstable" rec { + unstableWithSystemdStage1 = makeZfsTest rec { zfsPackage = pkgs.zfsUnstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; enableSystemdStage1 = true; From ce5b1e007e1eb96e5df296e33ed884b70dc19250 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 27 Feb 2024 18:26:54 -0500 Subject: [PATCH 043/186] nixos/zfs: Fix typo in option doc --- nixos/modules/tasks/filesystems/zfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index c6a153cfcb2d..6939a01d6589 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -220,7 +220,7 @@ in package = mkOption { type = types.package; default = if cfgZfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs; - defaultText = literalExpression "if zfsUnstable is enabled then pkgs.zfsUnstable else pkgs.zfs"; + defaultText = literalExpression "if enableUnstable is enabled then pkgs.zfsUnstable else pkgs.zfs"; description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfsUnstable` if you want to track the latest staging ZFS branch."; }; From 929fcf93358a833003435c0f74b9bd993f9546d0 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 27 Feb 2024 18:27:39 -0500 Subject: [PATCH 044/186] zfs_unstable: Rename from zfsUnstable This matches the naming of other zfs_* pkgs. --- nixos/modules/tasks/filesystems/zfs.nix | 6 +++--- nixos/tests/zfs.nix | 4 ++-- pkgs/os-specific/linux/zfs/generic.nix | 2 +- pkgs/os-specific/linux/zfs/unstable.nix | 2 +- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/linux-kernels.nix | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 6939a01d6589..b5caa4d29fa9 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -219,9 +219,9 @@ in boot.zfs = { package = mkOption { type = types.package; - default = if cfgZfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs; - defaultText = literalExpression "if enableUnstable is enabled then pkgs.zfsUnstable else pkgs.zfs"; - description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfsUnstable` if you want to track the latest staging ZFS branch."; + default = if cfgZfs.enableUnstable then pkgs.zfs_unstable else pkgs.zfs; + defaultText = literalExpression "if enableUnstable is enabled then pkgs.zfs_unstable else pkgs.zfs"; + description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfs_unstable` if you want to track the latest staging ZFS branch."; }; modulePackage = mkOption { diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 4bc608ac75e5..851fced2c5e1 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -203,12 +203,12 @@ in { }; unstable = makeZfsTest rec { - zfsPackage = pkgs.zfsUnstable; + zfsPackage = pkgs.zfs_unstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; }; unstableWithSystemdStage1 = makeZfsTest rec { - zfsPackage = pkgs.zfsUnstable; + zfsPackage = pkgs.zfs_unstable; kernelPackages = zfsPackage.latestCompatibleLinuxPackages; enableSystemdStage1 = true; }; diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index 566af6950d48..e5a3a79eba3a 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -234,7 +234,7 @@ let inherit maintainers; mainProgram = "zfs"; - # If your Linux kernel version is not yet supported by zfs, try zfsUnstable. + # If your Linux kernel version is not yet supported by zfs, try zfs_unstable. # On NixOS set the option boot.zfs.enableUnstable. broken = buildKernel && (kernelCompatible != null) && !kernelCompatible; }; diff --git a/pkgs/os-specific/linux/zfs/unstable.nix b/pkgs/os-specific/linux/zfs/unstable.nix index 2bd06e0d6b74..052dd0cd74c9 100644 --- a/pkgs/os-specific/linux/zfs/unstable.nix +++ b/pkgs/os-specific/linux/zfs/unstable.nix @@ -12,7 +12,7 @@ in callPackage ./generic.nix args { # You have to ensure that in `pkgs/top-level/linux-kernels.nix` # this attribute is the correct one for this package. - kernelModuleAttribute = "zfsUnstable"; + kernelModuleAttribute = "zfs_unstable"; # check the release notes for compatible kernels kernelCompatible = kernel.kernelOlder "6.9"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ddfed4a09550..fab717bc0d1d 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1212,6 +1212,7 @@ mapAliases ({ zabbix40 = throw "'zabbix40' has been removed as it has reached end of life"; # Added 2024-01-07 zfsStable = zfs; # Added 2024-02-26 + zfsUnstable = zfs_unstable; # Added 2024-02-26 zinc = zincsearch; # Added 2023-05-28 zkg = throw "'zkg' has been replaced by 'zeek'"; zq = zed.overrideAttrs (old: { meta = old.meta // { mainProgram = "zq"; }; }); # Added 2023-02-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d4f19c255e0..b292d5952e9d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28732,7 +28732,7 @@ with pkgs; zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { configFile = "user"; }; - zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix { + zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { configFile = "user"; }; zfs = zfs_2_2; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 7df1bb0c0081..f54280683b9c 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -569,7 +569,7 @@ in { configFile = "kernel"; inherit pkgs kernel; }; - zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix { + zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { configFile = "kernel"; inherit pkgs kernel; }; From 2e36c49949f90f14a2ffcc002c8f411b725022d2 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 27 Feb 2024 18:31:29 -0500 Subject: [PATCH 045/186] nixos/pam: Do not incorrectly use zfs.enableUnstable in assertion `zfs.enableUnstable` only has an effect if `zfs.enabled = true`, so only require `zfs.enabled` to be true here. --- nixos/modules/security/pam.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index ed03254cb5ee..cd10a9b500ee 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -1458,9 +1458,9 @@ in ''; } { - assertion = config.security.pam.zfs.enable -> (config.boot.zfs.enabled || config.boot.zfs.enableUnstable); + assertion = config.security.pam.zfs.enable -> config.boot.zfs.enabled; message = '' - `security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled` or `boot.zfs.enableUnstable`). + `security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled`). ''; } { From 1f32eb724ddc9e27573266756c390a6bdcca4439 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 27 Feb 2024 18:32:33 -0500 Subject: [PATCH 046/186] nixos/zfs: Remove enableUnstable in favor of setting package This just adds complexity and confusion. Once-upon-a-time, there was no `package` and only `enableUnstable`, but now it is just confusing to have both, as it would be possible to do e.g. `package = pkgs.zfs` and `enableUnstable = true`, but then `enableUnstable` does nothing. --- nixos/modules/tasks/filesystems/zfs.nix | 18 +++--------------- pkgs/os-specific/linux/zfs/generic.nix | 2 +- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index b5caa4d29fa9..7bb2d973647d 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -211,6 +211,7 @@ in imports = [ (mkRemovedOptionModule [ "boot" "zfs" "enableLegacyCrypto" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule [ "boot" "zfs" "enableUnstable" ] "Instead set `boot.zfs.package = pkgs.zfs_unstable;`") ]; ###### interface @@ -219,8 +220,8 @@ in boot.zfs = { package = mkOption { type = types.package; - default = if cfgZfs.enableUnstable then pkgs.zfs_unstable else pkgs.zfs; - defaultText = literalExpression "if enableUnstable is enabled then pkgs.zfs_unstable else pkgs.zfs"; + default = pkgs.zfs; + defaultText = literalExpression "pkgs.zfs"; description = lib.mdDoc "Configured ZFS userland tools package, use `pkgs.zfs_unstable` if you want to track the latest staging ZFS branch."; }; @@ -239,19 +240,6 @@ in description = lib.mdDoc "True if ZFS filesystem support is enabled"; }; - enableUnstable = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Use the unstable zfs package. This might be an option, if the latest - kernel is not yet supported by a published release of ZFS. Enabling - this option will install a development version of ZFS on Linux. The - version will have already passed an extensive test suite, but it is - more likely to hit an undiscovered bug compared to running a released - version of ZFS on Linux. - ''; - }; - allowHibernation = mkOption { type = types.bool; default = false; diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index e5a3a79eba3a..c0ff834cb34a 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -235,7 +235,7 @@ let inherit maintainers; mainProgram = "zfs"; # If your Linux kernel version is not yet supported by zfs, try zfs_unstable. - # On NixOS set the option boot.zfs.enableUnstable. + # On NixOS set the option `boot.zfs.package = pkgs.zfs_unstable`. broken = buildKernel && (kernelCompatible != null) && !kernelCompatible; }; }; From bd4c49f29b77e9d494bf013daf7e31c17ccc92bf Mon Sep 17 00:00:00 2001 From: nikstur Date: Wed, 28 Feb 2024 11:45:38 +0100 Subject: [PATCH 047/186] nixos/systemd: remove a superfluous override This is already the upstream default. --- nixos/modules/system/boot/systemd.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index e29fa49ea23b..1ef323ba14db 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -667,7 +667,6 @@ in # Don't bother with certain units in containers. systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container"; - systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container"; # Increase numeric PID range (set directly instead of copying a one-line file from systemd) # https://github.com/systemd/systemd/pull/12226 From 380f36f3500d6a869baeaf86e9e96ffee44a55e2 Mon Sep 17 00:00:00 2001 From: nikstur Date: Wed, 28 Feb 2024 12:14:04 +0100 Subject: [PATCH 048/186] nixos/systemd: include systemd-boot-random-seed.service This is necessary to properly refresh the boot loader random seed. See https://www.freedesktop.org/software/systemd/man/latest/systemd-boot-random-seed.service.html# --- nixos/modules/system/boot/systemd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 1ef323ba14db..49090423e078 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -97,6 +97,7 @@ let # Maintaining state across reboots. "systemd-random-seed.service" + "systemd-boot-random-seed.service" "systemd-backlight@.service" "systemd-rfkill.service" "systemd-rfkill.socket" From 7e18666f60c1753c5786693cb133b91598afa500 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 28 Feb 2024 12:49:48 -0500 Subject: [PATCH 049/186] python311Packages.remotezip: 0.12.2 -> 0.12.3 Diff: https://github.com/gtsystem/python-remotezip/compare/3723724d6d877d3166d52f4528ffa7bd5bf6627f...v0.12.3 --- .../python-modules/remotezip/default.nix | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/remotezip/default.nix b/pkgs/development/python-modules/remotezip/default.nix index 6581fc6189be..e7ed4b1c356d 100644 --- a/pkgs/development/python-modules/remotezip/default.nix +++ b/pkgs/development/python-modules/remotezip/default.nix @@ -1,36 +1,35 @@ { lib , buildPythonPackage , fetchFromGitHub +, setuptools , requests , tabulate , pytestCheckHook , requests-mock }: -buildPythonPackage { +buildPythonPackage rec { pname = "remotezip"; - version = "0.12.2"; - format = "setuptools"; + version = "0.12.3"; + pyproject = true; src = fetchFromGitHub { owner = "gtsystem"; repo = "python-remotezip"; - # upstream does not tag releases, determined with git blame - # pypi archive lacks files for tests - rev = "3723724d6d877d3166d52f4528ffa7bd5bf6627f"; - hash = "sha256-iYxHW8RdLFrpjkcEvpfF/NWBnw7Dd5cx2ghpof2XFn4="; + rev = "refs/tags/v${version}"; + hash = "sha256-TNEM7Dm4iH4Z/P/PAqjJppbn1CKmyi9Xpq/sU9O8uxg="; }; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ requests - tabulate ]; nativeCheckInputs = [ pytestCheckHook - ]; - - checkInputs = [ requests-mock ]; From 8115431e554c21cf63de3892fa534fc8ccc02420 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 03:32:04 +0000 Subject: [PATCH 050/186] python311Packages.openai: 1.13.2 -> 1.13.3 --- pkgs/development/python-modules/openai/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/openai/default.nix b/pkgs/development/python-modules/openai/default.nix index 78ace71a3575..fb05e0a18dd3 100644 --- a/pkgs/development/python-modules/openai/default.nix +++ b/pkgs/development/python-modules/openai/default.nix @@ -26,7 +26,7 @@ buildPythonPackage rec { pname = "openai"; - version = "1.13.2"; + version = "1.13.3"; pyproject = true; disabled = pythonOlder "3.7.1"; @@ -35,7 +35,7 @@ buildPythonPackage rec { owner = "openai"; repo = "openai-python"; rev = "refs/tags/v${version}"; - hash = "sha256-3otPmMVV/Wx7k/oec5c1r6GcZGzhMSKifJB8S5nBSZw="; + hash = "sha256-8SHXUrPLZ7lgvB0jqZlcvKq5Zv2d2UqXjJpgiBpR8P8="; }; nativeBuildInputs = [ From 8bfc662c08baf9357d31b44d9b24742e6b7e055e Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 19 Feb 2024 06:14:38 +0100 Subject: [PATCH 051/186] 7zz: add setup hook script to unpack DMG files --- pkgs/tools/archivers/7zz/default.nix | 2 ++ pkgs/tools/archivers/7zz/setup-hook.sh | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 pkgs/tools/archivers/7zz/setup-hook.sh diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix index 48b072b0cf4b..a10283dc59f8 100644 --- a/pkgs/tools/archivers/7zz/default.nix +++ b/pkgs/tools/archivers/7zz/default.nix @@ -99,6 +99,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = lib.optionals useUasm [ uasm ]; + setupHook = ./setup-hook.sh; + enableParallelBuilding = true; preBuild = "cd CPP/7zip/Bundles/Alone2"; diff --git a/pkgs/tools/archivers/7zz/setup-hook.sh b/pkgs/tools/archivers/7zz/setup-hook.sh new file mode 100644 index 000000000000..97f2cc8a7694 --- /dev/null +++ b/pkgs/tools/archivers/7zz/setup-hook.sh @@ -0,0 +1,5 @@ +unpackCmdHooks+=(_tryUnpackDmg) +_tryUnpackDmg() { + if ! [[ "$curSrc" =~ \.dmg$ ]]; then return 1; fi + 7zz x "$curSrc" +} From 2407ee68506a3ea0c7db55d5dd0a7670709eaa38 Mon Sep 17 00:00:00 2001 From: rewine Date: Wed, 28 Feb 2024 22:18:50 +0800 Subject: [PATCH 052/186] hyprland: 0.35.0 -> 0.36.0 --- .../window-managers/hyprwm/hyprland/default.nix | 16 +++++++++------- .../window-managers/hyprwm/hyprland/wlroots.nix | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland/default.nix index 92694db761a4..3db57a6b8dd2 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland/default.nix @@ -9,6 +9,7 @@ , cairo , git , hyprland-protocols +, hyprlang , jq , libGL , libdrm @@ -31,7 +32,7 @@ , debug ? false , enableXWayland ? true , legacyRenderer ? false -, withSystemd ? true +, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd , wrapRuntimeDeps ? true # deprecated flags , nvidiaPatches ? false @@ -43,13 +44,13 @@ assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` ha assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland"; stdenv.mkDerivation (finalAttrs: { pname = "hyprland" + lib.optionalString debug "-debug"; - version = "0.35.0"; + version = "0.36.0"; src = fetchFromGitHub { owner = "hyprwm"; repo = finalAttrs.pname; rev = "v${finalAttrs.version}"; - hash = "sha256-dU5m6Cd4+WQZal2ICDVf1kww/dNzo1YUWRxWeCctEig="; + hash = "sha256-oZe4k6jtO/0govmERGcbeyvE9EfTvXY5bnyIs6AsL9U="; }; patches = [ @@ -92,6 +93,7 @@ stdenv.mkDerivation (finalAttrs: { cairo git hyprland-protocols + hyprlang libGL libdrm libinput @@ -116,10 +118,10 @@ stdenv.mkDerivation (finalAttrs: { mesonAutoFeatures = "disabled"; - mesonFlags = builtins.concatLists [ - (lib.optional enableXWayland "-Dxwayland=enabled") - (lib.optional legacyRenderer "-Dlegacy_renderer=enabled") - (lib.optional withSystemd "-Dsystemd=enabled") + mesonFlags = [ + (lib.mesonEnable "xwayland" enableXWayland) + (lib.mesonEnable "legacy_renderer" legacyRenderer) + (lib.mesonEnable "systemd" withSystemd) ]; postInstall = '' diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/wlroots.nix b/pkgs/applications/window-managers/hyprwm/hyprland/wlroots.nix index a2b2f96769d7..5c42eff6fc8c 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/wlroots.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland/wlroots.nix @@ -9,8 +9,8 @@ wlroots.overrideAttrs domain = "gitlab.freedesktop.org"; owner = "wlroots"; repo = "wlroots"; - rev = "00b869c1a96f300a8f25da95d624524895e0ddf2"; - hash = "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM="; + rev = "0cb091f1a2d345f37d2ee445f4ffd04f7f4ec9e5"; + hash = "sha256-Mz6hCtommq7RQfcPnxLINigO4RYSNt23HeJHC6mVmWI="; }; patches = [ ]; # don't inherit old.patches From 9bb583a6ba8d48164a522af105e9806655cebd6f Mon Sep 17 00:00:00 2001 From: rewine Date: Thu, 29 Feb 2024 18:26:55 +0800 Subject: [PATCH 053/186] hyprlandPlugins.hy3: 0.35.0 -> unstable-2024-02-23 --- .../window-managers/hyprwm/hyprland/plugins.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix index 421d0d328539..3439a911a51c 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix @@ -24,13 +24,13 @@ let hy3 = { fetchFromGitHub, cmake, hyprland }: mkHyprlandPlugin rec { pluginName = "hy3"; - version = "0.35.0"; + version = "unstable-2024-02-23"; src = fetchFromGitHub { owner = "outfoxxed"; repo = "hy3"; - rev = "hl${version}"; - hash = "sha256-lFe7Lf0K5ePTh4gflnvBohOGH4ayGDtNkbg/XtoNqRo="; + rev = "029a2001361d2a4cbbe7447968dee5d1b1880298"; + hash = "sha256-8LKCXwNU6wA8o6O7s9T2sLWbYNHaI1tYU4YMjHkNLZQ="; }; nativeBuildInputs = [ cmake ]; From 918789b650044c7b49c2ce6d10ed2532ab638cdc Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 10:51:21 +0000 Subject: [PATCH 054/186] apt: 2.7.12 -> 2.7.13 --- pkgs/by-name/ap/apt/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ap/apt/package.nix b/pkgs/by-name/ap/apt/package.nix index 0078e2dcecd9..d58644b935d8 100644 --- a/pkgs/by-name/ap/apt/package.nix +++ b/pkgs/by-name/ap/apt/package.nix @@ -33,11 +33,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "apt"; - version = "2.7.12"; + version = "2.7.13"; src = fetchurl { url = "mirror://debian/pool/main/a/apt/apt_${finalAttrs.version}.tar.xz"; - hash = "sha256-5G0Wa1/Ih8LZvKet1+DM2lR7lit2LhJyoIwEJrqpnK8="; + hash = "sha256-xCq1XpHXvuX8v3/4w1hHFMusqgNl8JHn5gT3+Ek8fjU="; }; # cycle detection; lib can't be split From bd91833ef6d26c4445e03fd58bd945eed5004215 Mon Sep 17 00:00:00 2001 From: Bruce Collie Date: Thu, 29 Feb 2024 11:48:33 +0000 Subject: [PATCH 055/186] Add option to get maven sources --- .../tools/build-managers/apache-maven/build-package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/tools/build-managers/apache-maven/build-package.nix b/pkgs/development/tools/build-managers/apache-maven/build-package.nix index 49c217dbc91c..43fc8e123244 100644 --- a/pkgs/development/tools/build-managers/apache-maven/build-package.nix +++ b/pkgs/development/tools/build-managers/apache-maven/build-package.nix @@ -13,6 +13,7 @@ , mvnFetchExtraArgs ? { } , mvnDepsParameters ? "" , manualMvnArtifacts ? [ ] +, manualMvnSources ? [ ] , mvnParameters ? "" , ... } @args: @@ -39,6 +40,14 @@ let echo "downloading manual $artifactId" mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2 done + + for artifactId in ${builtins.toString manualMvnSources} + do + group=$(echo $artifactId | cut -d':' -f1) + artifact=$(echo $artifactId | cut -d':' -f2) + echo "downloading manual sources $artifactId" + mvn dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2 + done '' + lib.optionalString (!buildOffline) '' mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters} '' + '' From acf6041a4f8da0561c7406bcab85abc211d9c2d0 Mon Sep 17 00:00:00 2001 From: Marian Hammer Date: Thu, 29 Feb 2024 15:21:44 +0100 Subject: [PATCH 056/186] nextcloud28: 28.0.2 -> 28.0.3 Changelog: https://github.com/nextcloud/server/releases/tag/v28.0.3 --- pkgs/servers/nextcloud/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/nextcloud/default.nix b/pkgs/servers/nextcloud/default.nix index 63f7162fc5d6..7760a65cc9ef 100644 --- a/pkgs/servers/nextcloud/default.nix +++ b/pkgs/servers/nextcloud/default.nix @@ -55,8 +55,8 @@ in { }; nextcloud28 = generic { - version = "28.0.2"; - hash = "sha256-3jTWuvPszqz90TjoVSDNheHSzmeY2f+keKwX6x76HQg="; + version = "28.0.3"; + hash = "sha256-ntQTwN4W9bAzzu/8ypnA1h/GmNvrjbhRrJrfnu+VGQY="; packages = nextcloud28Packages; }; From e3597ddd55aebec64c85f8464bac8d574693251b Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 29 Feb 2024 15:37:28 +0100 Subject: [PATCH 057/186] mdsh: 0.7.0 -> 0.8.0 And also move it to pkgs/by-name --- .../mdsh/default.nix => by-name/md/mdsh/package.nix} | 6 +++--- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) rename pkgs/{development/tools/documentation/mdsh/default.nix => by-name/md/mdsh/package.nix} (73%) diff --git a/pkgs/development/tools/documentation/mdsh/default.nix b/pkgs/by-name/md/mdsh/package.nix similarity index 73% rename from pkgs/development/tools/documentation/mdsh/default.nix rename to pkgs/by-name/md/mdsh/package.nix index 654721c50ea9..e97b8eee51fe 100644 --- a/pkgs/development/tools/documentation/mdsh/default.nix +++ b/pkgs/by-name/md/mdsh/package.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "mdsh"; - version = "0.7.0"; + version = "0.8.0"; src = fetchFromGitHub { owner = "zimbatm"; repo = "mdsh"; rev = "v${version}"; - hash = "sha256-Y8ss/aw01zpgM6Z6fCGshP21kcdSOTVG/VqL8H3tlls="; + hash = "sha256-ammLbKEKXDSuZMr4DwPpcRSkKh7BzNC+4ZRCqTNNCQk="; }; - cargoSha256 = "sha256-8o4gN6mqUU+o80IqlAYAD5qpZBSQ/FY5HoNbpwzTm0A="; + cargoHash = "sha256-wLHMccxk3ceZyGK27t5Kyal48yj9dQNgmEHjH9hR9Pc="; meta = with lib; { description = "Markdown shell pre-processor"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c4f6fd0c3476..b27b4911dc1c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10749,8 +10749,6 @@ with pkgs; mbuffer = callPackage ../tools/misc/mbuffer { }; - mdsh = callPackage ../development/tools/documentation/mdsh { }; - mecab = let mecab-nodic = callPackage ../tools/text/mecab/nodic.nix { }; From c3f3caa6d1488b2e1787a36c96ada80006f0ca40 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Thu, 29 Feb 2024 10:26:23 -0500 Subject: [PATCH 058/186] sbcl: 2.4.1 -> 2.4.2 --- pkgs/development/compilers/sbcl/default.nix | 11 +++++------ pkgs/top-level/all-packages.nix | 12 ++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index fbd0970848d1..f92b657aad08 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -24,12 +24,12 @@ let sha256 = "189gjqzdz10xh3ybiy4ch1r98bsmkcb4hpnrmggd4y2g5kqnyx4y"; }; - "2.4.0" = { - sha256 = "sha256-g9i3TwjSJUxZuXkLwfZp4JCZRXuIRyDs7L9F9LRtF3Y="; - }; "2.4.1" = { sha256 = "sha256-2k+UhvrUE9OversbCSaTJf20v/fnuI8hld3udDJjz34="; }; + "2.4.2" = { + sha256 = "sha256-/APLUtEqr+h1nmMoRQogG73fibFwcaToPznoC0Pd7w8="; + }; }; # Collection of pre-built SBCL binaries for platforms that need them for # bootstrapping. Ideally these are to be avoided. If CLISP (or any other @@ -96,10 +96,9 @@ stdenv.mkDerivation (self: rec { ); buildInputs = lib.optionals coreCompression [ zstd ]; - patches = [ + patches = lib.optionals (lib.versionOlder self.version "2.4.2") [ + # Fixed in 2.4.2 ./search-for-binaries-in-PATH.patch - ] ++ lib.optionals (version == "2.4.0") [ - ./fix-2.4.0-aarch64-darwin.patch ]; # I don’t know why these are failing (on ofBorg), and I’d rather just disable diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3eb23f160f6d..8559eccf7dc9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25808,17 +25808,17 @@ with pkgs; }; # Steel Bank Common Lisp - sbcl_2_4_0 = wrapLisp { - pkg = callPackage ../development/compilers/sbcl { version = "2.4.0"; }; - faslExt = "fasl"; - flags = [ "--dynamic-space-size" "3000" ]; - }; sbcl_2_4_1 = wrapLisp { pkg = callPackage ../development/compilers/sbcl { version = "2.4.1"; }; faslExt = "fasl"; flags = [ "--dynamic-space-size" "3000" ]; }; - sbcl = sbcl_2_4_1; + sbcl_2_4_2 = wrapLisp { + pkg = callPackage ../development/compilers/sbcl { version = "2.4.2"; }; + faslExt = "fasl"; + flags = [ "--dynamic-space-size" "3000" ]; + }; + sbcl = sbcl_2_4_2; sbclPackages = recurseIntoAttrs sbcl.pkgs; From 57894bfb3d99d60021b9b3666f1d46d3f73311c7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 18:53:00 +0000 Subject: [PATCH 059/186] oh-my-posh: 19.11.4 -> 19.11.6 --- pkgs/development/tools/oh-my-posh/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/oh-my-posh/default.nix b/pkgs/development/tools/oh-my-posh/default.nix index 1458d173e3c6..e1797a606ca4 100644 --- a/pkgs/development/tools/oh-my-posh/default.nix +++ b/pkgs/development/tools/oh-my-posh/default.nix @@ -6,13 +6,13 @@ buildGoModule rec { pname = "oh-my-posh"; - version = "19.11.4"; + version = "19.11.6"; src = fetchFromGitHub { owner = "jandedobbeleer"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-xViCmfLhvRWi02hFIxKZ+5mrvoSaHRXFj4iLHtVS3uo="; + hash = "sha256-wo8ngZ/rWugYESc1/0WjOa8Zs6aEfXv7VJ7fqqbmSCE="; }; vendorHash = "sha256-OkcwcQfI1CeKIQaaS/Bd1Hct2yebp0TB98lsGAVRWqk="; From 89b7b7a115eff006664c57ff30f79c7dd5ea8377 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 19:38:35 +0000 Subject: [PATCH 060/186] devspace: 6.3.11 -> 6.3.12 --- pkgs/development/tools/misc/devspace/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/devspace/default.nix b/pkgs/development/tools/misc/devspace/default.nix index 93707f993cd5..4a1393f79d46 100644 --- a/pkgs/development/tools/misc/devspace/default.nix +++ b/pkgs/development/tools/misc/devspace/default.nix @@ -7,13 +7,13 @@ buildGoModule rec { pname = "devspace"; - version = "6.3.11"; + version = "6.3.12"; src = fetchFromGitHub { owner = "devspace-sh"; repo = "devspace"; rev = "v${version}"; - hash = "sha256-g+M34y7GTbQ8FyO4BieNYgo68ZE5x3hyXiMJrx6Nqug="; + hash = "sha256-tnkMXB0BWavSZF3HEdvtCE42zgcHNRGI5CdK3RDvv9c="; }; vendorHash = null; From 79dd7b22814ea02fc486ed8178fe3f211df398a5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 20:08:31 +0000 Subject: [PATCH 061/186] bfs: 3.1.1 -> 3.1.2 --- pkgs/tools/system/bfs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/bfs/default.nix b/pkgs/tools/system/bfs/default.nix index db663f46d70e..9ea63fafdeda 100644 --- a/pkgs/tools/system/bfs/default.nix +++ b/pkgs/tools/system/bfs/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "bfs"; - version = "3.1.1"; + version = "3.1.2"; src = fetchFromGitHub { repo = "bfs"; owner = "tavianator"; rev = version; - hash = "sha256-lsVfsNVjFX38YaYVBJWEst3c3RhUCbK2ycteqZZUM3M="; + hash = "sha256-xq29KzONDkq+KeABl8rpu0vr50KKFw/UKPFDXcAMNoo="; }; buildInputs = [ oniguruma ] ++ lib.optionals stdenv.isLinux [ libcap acl liburing ]; From bd4bd30e290733d732c3bc669debc2b0ce9e5db1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 20:36:16 +0000 Subject: [PATCH 062/186] fioctl: 0.40 -> 0.41 --- pkgs/tools/admin/fioctl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/fioctl/default.nix b/pkgs/tools/admin/fioctl/default.nix index 06c30bda2be0..e384f38f6499 100644 --- a/pkgs/tools/admin/fioctl/default.nix +++ b/pkgs/tools/admin/fioctl/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "fioctl"; - version = "0.40"; + version = "0.41"; src = fetchFromGitHub { owner = "foundriesio"; repo = "fioctl"; rev = "v${version}"; - sha256 = "sha256-G1CHm5z2D7l3NDmUMhubJsrXYUHb6FJ70EsYQShhsDE="; + sha256 = "sha256-N+bLW1Gf0lr5FKgd1lr84HVrhdjB+npaeS3nzYXoVl0="; }; - vendorHash = "sha256-j0tdFvOEp9VGx8OCfUruCzwVSB8thcenpvVNn7Rf0dA="; + vendorHash = "sha256-cu1TwCWdDQi2ZR96SvEeH/LIP7sZOVZoly3VczKZfRw="; ldflags = [ "-s" "-w" From 6a9f2aaa31f4cbfc4fe2cd69a4b749b97fb408a7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 20:41:15 +0000 Subject: [PATCH 063/186] gortr: 0.14.8 -> 0.15.0 --- pkgs/servers/gortr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/gortr/default.nix b/pkgs/servers/gortr/default.nix index fb365342bd68..ef569eef53a4 100644 --- a/pkgs/servers/gortr/default.nix +++ b/pkgs/servers/gortr/default.nix @@ -5,13 +5,13 @@ buildGoModule rec { pname = "gortr"; - version = "0.14.8"; + version = "0.15.0"; src = fetchFromGitHub { owner = "cloudflare"; repo = pname; rev = "v${version}"; - sha256 = "sha256-3aZf5HINoFIJrN+196kk1lt2S+fN9DlQakwGnkMU5U8="; + sha256 = "sha256-W6+zCLPcORGcRJF0F6/LRPap4SNVn/oKGs21T4nSNO0="; }; vendorHash = null; From a91b0e863c3571c5778afb75e973ccd28be65579 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 20:49:21 +0000 Subject: [PATCH 064/186] kube-bench: 0.7.1 -> 0.7.2 --- pkgs/tools/security/kube-bench/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/kube-bench/default.nix b/pkgs/tools/security/kube-bench/default.nix index 28b90f3d4bae..673dde4a58a1 100644 --- a/pkgs/tools/security/kube-bench/default.nix +++ b/pkgs/tools/security/kube-bench/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "kube-bench"; - version = "0.7.1"; + version = "0.7.2"; src = fetchFromGitHub { owner = "aquasecurity"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-EsUjGc7IIu5PK9KaODlQSfmm8jpjuBXvGZPNjSc1824="; + hash = "sha256-e8iB66fXc8lKwFEZlkk4qbsgExKUrf5WpEVCOiHiZUg="; }; - vendorHash = "sha256-i4k7eworPUvLUustr5U53qizHqUVw8yqGjdPQT6UIf4="; + vendorHash = "sha256-8DWjuweGCx2yxocm1GvcP+O3QYWYUdOFKmu6neQfWI4="; nativeBuildInputs = [ installShellFiles ]; From c3c42e1228b03a0b1a7e81fdada32cfd9e113235 Mon Sep 17 00:00:00 2001 From: Kiskae Date: Thu, 29 Feb 2024 22:04:30 +0100 Subject: [PATCH 065/186] linuxPackages.nvidiaPackages.vulkan_beta: 535.43.28 -> 550.40.53 --- pkgs/os-specific/linux/nvidia-x11/default.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 2b1e7066b602..1de00b4bae8a 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -68,16 +68,14 @@ rec { # Vulkan developer beta driver # See here for more information: https://developer.nvidia.com/vulkan-driver vulkan_beta = generic rec { - version = "535.43.28"; - persistencedVersion = "535.98"; - settingsVersion = "535.98"; - sha256_64bit = "sha256-ic7r3MPp65fdEwqDRyc0WiKonL5eF6KZUpfD/C3vYaU="; - openSha256 = "sha256-a5iccyISHheOfTwpsrz6puqrVhgzYWFvNlykVG3+PVc="; - settingsSha256 = "sha256-jCRfeB1w6/dA27gaz6t5/Qo7On0zbAPIi74LYLel34s="; - persistencedSha256 = "sha256-WviDU6B50YG8dO64CGvU3xK8WFUX8nvvVYm/fuGyroM="; + version = "550.40.53"; + persistencedVersion = "550.54.14"; + settingsVersion = "550.54.14"; + sha256_64bit = "sha256-ZA5pb1xjzDyEBrf3UYHta4T9laCOCW7LHJwhcdjw6MA="; + openSha256 = "sha256-p4FL0j9Ev4SJ3YcjfhFLxbMbc77dBblkrTYK50+OYqA="; + settingsSha256 = "sha256-m2rNASJp0i0Ez2OuqL+JpgEF0Yd8sYVCyrOoo/ln2a4="; + persistencedSha256 = "sha256-XaPN8jVTjdag9frLPgBtqvO/goB5zxeGzaTU0CdL6C4="; url = "https://developer.nvidia.com/downloads/vulkan-beta-${lib.concatStrings (lib.splitVersion version)}-linux"; - - patches = [ rcu_patch ]; }; # data center driver compatible with current default cudaPackages From ff5ae9b1774117c480775c676200b52401864e69 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 21:09:23 +0000 Subject: [PATCH 066/186] open-policy-agent: 0.61.0 -> 0.62.0 --- pkgs/development/tools/open-policy-agent/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/open-policy-agent/default.nix b/pkgs/development/tools/open-policy-agent/default.nix index ee249c2c7657..873d9b19da4a 100644 --- a/pkgs/development/tools/open-policy-agent/default.nix +++ b/pkgs/development/tools/open-policy-agent/default.nix @@ -11,13 +11,13 @@ assert enableWasmEval && stdenv.isDarwin -> builtins.throw "building with wasm o buildGoModule rec { pname = "open-policy-agent"; - version = "0.61.0"; + version = "0.62.0"; src = fetchFromGitHub { owner = "open-policy-agent"; repo = "opa"; rev = "v${version}"; - hash = "sha256-d0/S9XP/W6Mhs1b9IBzm7kerb6SJ7UzsYS0DnTDVfvY="; + hash = "sha256-Afaa6ykGyZQGjzSDYuJ954LF0IOzRDG8rV9hgXVT7YE="; }; vendorHash = null; From 78fb5540968b3ab943c1d62974fed82de61efa20 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 29 Feb 2024 23:27:03 +0200 Subject: [PATCH 067/186] hyprlandPlugins: expose mkHyprlandPlugin This change lets users use the function outside of Nixpkgs, as well as replacing the `hyprland` package that the plugins are built with. --- .../window-managers/hyprwm/hyprland/plugins.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix index 421d0d328539..bceee1153322 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix @@ -5,7 +5,7 @@ , hyprland }: let - mkHyprlandPlugin = + mkHyprlandPlugin = hyprland: args@{ pluginName, ... }: stdenv.mkDerivation (args // { pname = "${pluginName}"; @@ -14,15 +14,15 @@ let ++ hyprland.buildInputs ++ (args.buildInputs or [ ]); meta = args.meta // { - description = (args.meta.description or ""); - longDescription = (args.meta.lonqDescription or "") + + description = args.meta.description or ""; + longDescription = (args.meta.longDescription or "") + "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options."; }; }); plugins = { hy3 = { fetchFromGitHub, cmake, hyprland }: - mkHyprlandPlugin rec { + mkHyprlandPlugin hyprland rec { pluginName = "hy3"; version = "0.35.0"; @@ -47,5 +47,4 @@ let }; }; in -lib.mapAttrs (name: plugin: callPackage plugin { }) plugins - +(lib.mapAttrs (name: plugin: callPackage plugin { }) plugins) // { inherit mkHyprlandPlugin; } From a8a0f7e51d34cb548a65e4d950a308fb99214292 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 22:12:53 +0000 Subject: [PATCH 068/186] rain: 1.7.5 -> 1.8.0 --- pkgs/development/tools/rain/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rain/default.nix b/pkgs/development/tools/rain/default.nix index a07f09a060c7..f400bf192cd4 100644 --- a/pkgs/development/tools/rain/default.nix +++ b/pkgs/development/tools/rain/default.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "rain"; - version = "1.7.5"; + version = "1.8.0"; src = fetchFromGitHub { owner = "aws-cloudformation"; repo = pname; rev = "v${version}"; - sha256 = "sha256-UAh84LM7QbIdxuPGN+lsbjVLd+hk8NXqwDxcRv5FAdY="; + sha256 = "sha256-kU+eNw27jv+yhBIR09zVRedZM5WSIMU68jCkIDWvhgw="; }; - vendorHash = "sha256-kd820Qe/0gN34VnX9Ge4BLeI3yySunJNjOVJXBe/M58="; + vendorHash = "sha256-Ea83gPSq7lReS2KXejY9JlDDEncqS1ouVyIEKbn+VAw="; subPackages = [ "cmd/rain" ]; From 71daae4aa560f8bdca180ca2081770e8a45b426b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 22:57:57 +0000 Subject: [PATCH 069/186] scraper: 0.18.1 -> 0.19.0 --- pkgs/tools/text/scraper/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/text/scraper/default.nix b/pkgs/tools/text/scraper/default.nix index 05c4957f27dd..c148f1e57f3f 100644 --- a/pkgs/tools/text/scraper/default.nix +++ b/pkgs/tools/text/scraper/default.nix @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "scraper"; - version = "0.18.1"; + version = "0.19.0"; src = fetchCrate { inherit pname version; - hash = "sha256-fnX2v7VxVFgn9UT1+qWBvN+oDDI2DbK6UFKmby5aB5c="; + hash = "sha256-HfZ8zyjghTXIyIYS+MaGF5OdMLJv6NIjQswdn/tvQbU="; }; - cargoHash = "sha256-HeT3U4H/OM/91BdXTvZq+gpmOnt/P4wTlqc2dl4erlQ="; + cargoHash = "sha256-py8VVciNJ36/aSTlTH+Bx36yrh/8AuzB9XNNv/PrFak="; nativeBuildInputs = [ installShellFiles ]; From 11a19b61065a7165c763688be3d1f63859389ba5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 22:58:11 +0000 Subject: [PATCH 070/186] ruff-lsp: 0.0.52 -> 0.0.53 --- pkgs/development/tools/language-servers/ruff-lsp/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/language-servers/ruff-lsp/default.nix b/pkgs/development/tools/language-servers/ruff-lsp/default.nix index e446df7f70e2..4cfcb4c6e064 100644 --- a/pkgs/development/tools/language-servers/ruff-lsp/default.nix +++ b/pkgs/development/tools/language-servers/ruff-lsp/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "ruff-lsp"; - version = "0.0.52"; + version = "0.0.53"; pyproject = true; disabled = pythonOlder "3.7"; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "astral-sh"; repo = "ruff-lsp"; rev = "refs/tags/v${version}"; - hash = "sha256-T18c0vKy/RUWiDjX2oScVxgVIhlj7t3M/+IoKsQ0N4w="; + hash = "sha256-gtMqIsgGCzSBo5D4+Ne8tUloDV9+MufYkN96yr7XVd4="; }; postPatch = '' From 127e5b8dcc7a315f0942ac8bff9612d79bad42b2 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 23:19:16 +0000 Subject: [PATCH 071/186] upbound: 0.24.1 -> 0.24.2 --- pkgs/development/tools/upbound/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/upbound/default.nix b/pkgs/development/tools/upbound/default.nix index c1ac7b1a19b0..6d91ea46a969 100644 --- a/pkgs/development/tools/upbound/default.nix +++ b/pkgs/development/tools/upbound/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "upbound"; - version = "0.24.1"; + version = "0.24.2"; src = fetchFromGitHub { owner = pname; repo = "up"; rev = "v${version}"; - sha256 = "sha256-1WSkNL1XpgnkWeL4tDiOxoKX6N5LYepD3DU0109pWC4="; + sha256 = "sha256-MDpe5CM5pgbrdVozh1yXiALLd8BkhrtNjL/su2JubcE="; }; vendorHash = "sha256-jHVwI5fQbS/FhRptRXtNezG1djaZKHJgpPJfuEH/zO0="; From e68e4d9a21fe385b62bc9831679285d7e7d020b6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 23:19:32 +0000 Subject: [PATCH 072/186] sickgear: 3.30.10 -> 3.30.11 --- pkgs/servers/sickbeard/sickgear.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/sickbeard/sickgear.nix b/pkgs/servers/sickbeard/sickgear.nix index ffb5994269e9..881afa06f142 100644 --- a/pkgs/servers/sickbeard/sickgear.nix +++ b/pkgs/servers/sickbeard/sickgear.nix @@ -4,13 +4,13 @@ let pythonEnv = python3.withPackages(ps: with ps; [ cheetah3 lxml ]); in stdenv.mkDerivation rec { pname = "sickgear"; - version = "3.30.10"; + version = "3.30.11"; src = fetchFromGitHub { owner = "SickGear"; repo = "SickGear"; rev = "release_${version}"; - hash = "sha256-pTcetcZ62rHMcnplteTJQkuEIQrPUKdX+cSV5V4ZqA4="; + hash = "sha256-o5JEjKv/7TN+BCmjxVZeOcHm5FDPMg4zM6GUeO9uZUo="; }; patches = [ From 15bc659bfb7afe5aa26a7755022cfe8a2d46f852 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 23:19:43 +0000 Subject: [PATCH 073/186] werf: 1.2.294 -> 1.2.295 --- pkgs/applications/networking/cluster/werf/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/werf/default.nix b/pkgs/applications/networking/cluster/werf/default.nix index f61a760115a1..254d7bd08ebd 100644 --- a/pkgs/applications/networking/cluster/werf/default.nix +++ b/pkgs/applications/networking/cluster/werf/default.nix @@ -10,16 +10,16 @@ buildGoModule rec { pname = "werf"; - version = "1.2.294"; + version = "1.2.295"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; rev = "v${version}"; - hash = "sha256-A/Do2UepwV8lmT8qWir7CKR8/YeVKOEoJjvVfj9+wt0="; + hash = "sha256-oQDP2Tsxj4c5X2pfj4i+hfnsdjUBYcyF2p61OY04Ozg="; }; - vendorHash = "sha256-Fb9drtVITjka83Y8+YSa9fqSBv7O4muMGqV4w3K7+Dg="; + vendorHash = "sha256-6q13vMxu0iQgaXS+Z6V0jjSIhxMscw6sLANzK07gAlI="; proxyVendor = true; From 7d9ef9adc7d25f632fb01bcdf45ef29ca28b5667 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 23:19:47 +0000 Subject: [PATCH 074/186] monkeysAudio: 10.49 -> 10.52 --- pkgs/applications/audio/monkeys-audio/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/monkeys-audio/default.nix b/pkgs/applications/audio/monkeys-audio/default.nix index 3df94d5c4581..d4da27dd3639 100644 --- a/pkgs/applications/audio/monkeys-audio/default.nix +++ b/pkgs/applications/audio/monkeys-audio/default.nix @@ -5,13 +5,13 @@ }: stdenv.mkDerivation (finalAttrs: { - version = "10.49"; + version = "10.52"; pname = "monkeys-audio"; src = fetchzip { url = "https://monkeysaudio.com/files/MAC_${ builtins.concatStringsSep "" (lib.strings.splitString "." finalAttrs.version)}_SDK.zip"; - hash = "sha256-OhTqBFNwmReMT1U11CIB7XCTohiILdd2nDFp+9nfObs="; + hash = "sha256-n+bQzvuCTt7dnqkPO592KKZeShmMlbp/KAXK0F2dlTg="; stripRoot = false; }; nativeBuildInputs = [ From 37d8d19672061eac4abeeb20d39566779557818c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Feb 2024 23:19:49 +0000 Subject: [PATCH 075/186] gotestwaf: 0.4.12 -> 0.4.13 --- pkgs/tools/security/gotestwaf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/gotestwaf/default.nix b/pkgs/tools/security/gotestwaf/default.nix index 69afb96a47e2..41887131d9ec 100644 --- a/pkgs/tools/security/gotestwaf/default.nix +++ b/pkgs/tools/security/gotestwaf/default.nix @@ -7,13 +7,13 @@ buildGoModule rec { pname = "gotestwaf"; - version = "0.4.12"; + version = "0.4.13"; src = fetchFromGitHub { owner = "wallarm"; repo = "gotestwaf"; rev = "refs/tags/v${version}"; - hash = "sha256-av6N6RQ+9iW+xG1FpmFjBHL1leU4P0IPiqf7kvJxm6M="; + hash = "sha256-juqxturQzGOlRTw7EEuRoEmwLtBdJJpbBzCKFxmL5m8="; }; vendorHash = null; From 8e144ab3e6f36597d54c2348fc20acf78c87d036 Mon Sep 17 00:00:00 2001 From: Icy-Thought Date: Fri, 1 Mar 2024 00:59:53 +0100 Subject: [PATCH 076/186] upscayl: 2.9.9 -> 2.10.0 --- pkgs/applications/graphics/upscayl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/upscayl/default.nix b/pkgs/applications/graphics/upscayl/default.nix index 6541aefd7092..9675f4cf17dc 100644 --- a/pkgs/applications/graphics/upscayl/default.nix +++ b/pkgs/applications/graphics/upscayl/default.nix @@ -4,11 +4,11 @@ lib, }: let pname = "upscayl"; - version = "2.9.9"; + version = "2.10.0"; src = fetchurl { url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-linux.AppImage"; - hash = "sha256-EoTFvlLsXQYZldXfEHhP3/bHygm+NdeDsf+p138mM8w"; + hash = "sha256-nRYNYNHIkbvvQZd1zRDCCsCadgRgV/yn9WfaKjt44O8="; }; appimageContents = appimageTools.extractType2 { From 2e8d778994b4e2a285bb599808a1b168077e5a66 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 1 Mar 2024 01:12:11 +0100 Subject: [PATCH 077/186] tests.nixpkgs-check-by-name: Various minor improvements Co-Authored-By: Philip Taron --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 173 ++++++++++-------- pkgs/test/nixpkgs-check-by-name/src/main.rs | 13 +- .../nixpkgs-check-by-name/src/nix_file.rs | 39 ++-- .../src/nixpkgs_problem.rs | 126 +++++++------ .../test/nixpkgs-check-by-name/src/ratchet.rs | 20 +- .../tests/alt-callPackage/expected | 5 +- .../tests/base-fixed/expected | 2 +- .../tests/base-still-broken/expected | 2 +- .../tests/broken-autocall/expected | 2 +- .../tests/incorrect-shard/expected | 2 +- .../tests/internalCallPackage/expected | 2 +- .../tests/invalid-package-name/expected | 2 +- .../tests/invalid-shard-name/expected | 2 +- .../tests/manual-definition/expected | 8 +- .../tests/missing-package-nix/expected | 2 +- .../tests/move-to-non-by-name/expected | 6 +- .../tests/multiple-failures/expected | 2 +- .../tests/new-package-non-by-name/expected | 2 +- .../tests/non-attrs/expected | 2 +- .../tests/non-derivation/expected | 2 +- .../all-packages.nix | 1 + .../expected | 5 +- .../tests/override-different-file/expected | 5 +- .../tests/override-empty-arg/expected | 5 +- .../tests/override-no-call-package/expected | 5 +- .../tests/override-no-file/expected | 5 +- .../tests/override-non-path/expected | 5 +- .../tests/package-dir-is-file/expected | 2 +- .../tests/package-nix-dir/expected | 2 +- .../tests/ref-absolute/expected | 2 +- .../tests/ref-escape/expected | 2 +- .../tests/ref-nix-path/expected | 2 +- .../tests/ref-path-subexpr/expected | 2 +- .../tests/shard-file/expected | 2 +- .../tests/sorted-order/expected | 8 +- .../tests/symlink-escape/expected | 2 +- .../tests/symlink-invalid/expected | 2 +- .../tests/unknown-location/expected | 2 +- 38 files changed, 261 insertions(+), 212 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index a8427a27ee43..a43a0cd743a7 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -1,5 +1,8 @@ +use crate::nix_file::CallPackageArgumentInfo; use crate::nixpkgs_problem::NixpkgsProblem; use crate::ratchet; +use crate::ratchet::RatchetState::Loose; +use crate::ratchet::RatchetState::Tight; use crate::structure; use crate::utils; use crate::validation::ResultIteratorExt as _; @@ -296,84 +299,27 @@ fn by_name( let nix_file = nix_file_store.get(&location.file)?; // The relative path of the Nix file, for error messages - let relative_file = - location.relative_file(nixpkgs_path).with_context(|| { - format!( - "Failed to resolve location file of attribute {attribute_name}" - ) - })?; + let relative_location_file = location.relative_file(nixpkgs_path).with_context(|| { + format!("Failed to resolve the file where attribute {attribute_name} is defined") + })?; // Figure out whether it's an attribute definition of the form `= callPackage `, // returning the arguments if so. - let (optional_syntactic_call_package, definition) = nix_file.call_package_argument_info_at( - location.line, - location.column, - nixpkgs_path, - ).with_context(|| format!("Failed to get the definition info for attribute {attribute_name}"))?; + let (optional_syntactic_call_package, definition) = nix_file + .call_package_argument_info_at(location.line, location.column, nixpkgs_path) + .with_context(|| { + format!("Failed to get the definition info for attribute {attribute_name}") + })?; - // At this point, we completed two different checks for whether it's a - // `callPackage` - match (is_semantic_call_package, optional_syntactic_call_package) { - // Something like ` = foo` - (_, None) => NixpkgsProblem::NonSyntacticCallPackage { - package_name: attribute_name.to_owned(), - file: relative_file, - line: location.line, - column: location.column, - definition, - } - .into(), - // Something like ` = pythonPackages.callPackage ...` - (false, Some(_)) => NixpkgsProblem::NonToplevelCallPackage { - package_name: attribute_name.to_owned(), - file: relative_file, - line: location.line, - column: location.column, - definition, - } - .into(), - // Something like ` = pkgs.callPackage ...` - (true, Some(syntactic_call_package)) => { - if let Some(path) = syntactic_call_package.relative_path { - if path == relative_package_file { - // Manual definitions with empty arguments are not allowed - // anymore - Success(if syntactic_call_package.empty_arg { - Loose(NixpkgsProblem::EmptyArgument { - package_name: attribute_name.to_owned(), - file: relative_file, - line: location.line, - column: location.column, - definition, - }) - } else { - Tight - }) - } else { - // Wrong path - NixpkgsProblem::WrongCallPackagePath { - package_name: attribute_name.to_owned(), - file: relative_file, - line: location.line, - column: location.column, - actual_path: path, - expected_path: relative_package_file, - } - .into() - } - } else { - // No path - NixpkgsProblem::NonPath { - package_name: attribute_name.to_owned(), - file: relative_file, - line: location.line, - column: location.column, - definition, - } - .into() - } - } - } + by_name_override( + attribute_name, + relative_package_file, + is_semantic_call_package, + optional_syntactic_call_package, + definition, + location, + relative_location_file, + ) } else { // If manual definitions don't have a location, it's likely `mapAttrs`'d // over, e.g. if it's defined in aliases.nix. @@ -401,6 +347,85 @@ fn by_name( ) } +/// Handles the case for packages in `pkgs/by-name` that are manually overridden, e.g. in +/// all-packages.nix +fn by_name_override( + attribute_name: &str, + expected_package_file: PathBuf, + is_semantic_call_package: bool, + optional_syntactic_call_package: Option, + definition: String, + location: Location, + relative_location_file: PathBuf, +) -> validation::Validation> { + // At this point, we completed two different checks for whether it's a + // `callPackage` + match (is_semantic_call_package, optional_syntactic_call_package) { + // Something like ` = foo` + (_, None) => NixpkgsProblem::NonSyntacticCallPackage { + package_name: attribute_name.to_owned(), + file: relative_location_file, + line: location.line, + column: location.column, + definition, + } + .into(), + // Something like ` = pythonPackages.callPackage ...` + (false, Some(_)) => NixpkgsProblem::NonToplevelCallPackage { + package_name: attribute_name.to_owned(), + file: relative_location_file, + line: location.line, + column: location.column, + definition, + } + .into(), + // Something like ` = pkgs.callPackage ...` + (true, Some(syntactic_call_package)) => { + if let Some(actual_package_file) = syntactic_call_package.relative_path { + if actual_package_file != expected_package_file { + // Wrong path + NixpkgsProblem::WrongCallPackagePath { + package_name: attribute_name.to_owned(), + file: relative_location_file, + line: location.line, + actual_path: actual_package_file, + expected_path: expected_package_file, + } + .into() + } else { + // Manual definitions with empty arguments are not allowed + // anymore, but existing ones should continue to be allowed + let manual_definition_ratchet = if syntactic_call_package.empty_arg { + // This is the state to migrate away from + Loose(NixpkgsProblem::EmptyArgument { + package_name: attribute_name.to_owned(), + file: relative_location_file, + line: location.line, + column: location.column, + definition, + }) + } else { + // This is the state to migrate to + Tight + }; + + Success(manual_definition_ratchet) + } + } else { + // No path + NixpkgsProblem::NonPath { + package_name: attribute_name.to_owned(), + file: relative_location_file, + line: location.line, + column: location.column, + definition, + } + .into() + } + } + } +} + /// Handles the evaluation result for an attribute _not_ in `pkgs/by-name`, /// turning it into a validation result. fn handle_non_by_name_attribute( diff --git a/pkgs/test/nixpkgs-check-by-name/src/main.rs b/pkgs/test/nixpkgs-check-by-name/src/main.rs index c92d0af64969..dcc9cb9e716d 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/main.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/main.rs @@ -93,27 +93,25 @@ pub fn process( for error in errors { writeln!(error_writer, "{}", error.to_string().red())? } - writeln!(error_writer, "{}", "The base branch is broken and still has above problems with this PR, these need to be fixed first.\nConsider reverting the PR that introduced these problems in order to prevent more failures of unrelated PRs.".yellow())?; + writeln!(error_writer, "{}", "The base branch is broken and still has above problems with this PR, which need to be fixed first.\nConsider reverting the PR that introduced these problems in order to prevent more failures of unrelated PRs.".yellow())?; Ok(false) } (Failure(_), Success(_)) => { - // Base branch fails, but the PR fixes it writeln!( error_writer, "{}", - "The base branch was broken, but this PR fixes it, nice job!".green() + "The base branch is broken, but this PR fixes it. Nice job!".green() )?; Ok(true) } (Success(_), Failure(errors)) => { - // Base branch succeeds, the PR breaks it for error in errors { writeln!(error_writer, "{}", error.to_string().red())? } writeln!( error_writer, "{}", - "This PR introduces the above problems, merging would break the base branch" + "This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break." .yellow() )?; Ok(false) @@ -125,7 +123,8 @@ pub fn process( for error in errors { writeln!(error_writer, "{}", error.to_string().red())? } - writeln!(error_writer, "{}", "This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch".yellow())?; + writeln!(error_writer, "{}", "This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch.".yellow())?; + Ok(false) } Success(()) => { @@ -225,7 +224,7 @@ mod tests { test_nixpkgs( "case_sensitive", &path, - "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\nThis PR introduces the above problems, merging would break the base branch\n", + "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\nThis PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break.\n", )?; Ok(()) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index 0176164e2cea..1cb5d1c0d08d 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -2,6 +2,7 @@ use crate::utils::LineIndex; use anyhow::Context; +use itertools::Either::{self, Left, Right}; use rnix::ast; use rnix::ast::Expr; use rnix::ast::HasEntry; @@ -86,8 +87,8 @@ pub struct CallPackageArgumentInfo { impl NixFile { /// Returns information about callPackage arguments for an attribute at a specific line/column /// index. - /// If the location is not of the form ` = callPackage ;`, `Ok((None, String))` is - /// returned, with String being how the definition looks like. + /// If the definition at the given location is not of the form ` = callPackage ;`, + /// `Ok((None, String))` is returned, with `String` being the definition itself. /// /// This function only returns `Err` for problems that can't be caused by the Nix contents, /// but rather problems in this programs code itself. @@ -124,8 +125,8 @@ impl NixFile { relative_to: &Path, ) -> anyhow::Result<(Option, String)> { Ok(match self.attrpath_value_at(line, column)? { - Err(definition) => (None, definition), - Ok(attrpath_value) => { + Left(definition) => (None, definition), + Right(attrpath_value) => { let definition = attrpath_value.to_string(); let attrpath_value = self.attrpath_value_call_package_argument_info(attrpath_value, relative_to)?; @@ -139,7 +140,7 @@ impl NixFile { &self, line: usize, column: usize, - ) -> anyhow::Result> { + ) -> anyhow::Result> { let index = self.line_index.fromlinecolumn(line, column); let token_at_offset = self @@ -173,11 +174,11 @@ impl NixFile { // This is the only other way how `builtins.unsafeGetAttrPos` can return // attribute positions, but we only look for ones like ` = `, so // ignore this - return Ok(Err(node.to_string())); + return Ok(Left(node.to_string())); } else { // However, anything else is not expected and smells like a bug anyhow::bail!( - "Node in {} is neither an attribute node, nor an inherit node: {node:?}", + "Node in {} is neither an attribute node nor an inherit node: {node:?}", self.path.display() ) } @@ -217,7 +218,9 @@ impl NixFile { // unwrap is fine because we confirmed that we can cast with the above check. // We could avoid this `unwrap` for a `clone`, since `cast` consumes the argument, // but we still need it for the error message when the cast fails. - Ok(Ok(ast::AttrpathValue::cast(attrpath_value_node).unwrap())) + Ok(Right( + ast::AttrpathValue::cast(attrpath_value_node).unwrap(), + )) } // Internal function mainly to make attrpath_value_at independently testable @@ -446,24 +449,24 @@ mod tests { // These are builtins.unsafeGetAttrPos locations for the attributes let cases = [ - (2, 3, Ok("foo = 1;")), - (3, 3, Ok(r#""bar" = 2;"#)), - (4, 3, Ok(r#"${"baz"} = 3;"#)), - (5, 3, Ok(r#""${"qux"}" = 4;"#)), - (8, 3, Ok("quux\n # B\n =\n # C\n 5\n # D\n ;")), - (17, 7, Ok("quuux/**/=/**/5/**/;")), - (19, 10, Err("inherit toInherit;")), - (20, 22, Err("inherit (toInherit) toInherit;")), + (2, 3, Right("foo = 1;")), + (3, 3, Right(r#""bar" = 2;"#)), + (4, 3, Right(r#"${"baz"} = 3;"#)), + (5, 3, Right(r#""${"qux"}" = 4;"#)), + (8, 3, Right("quux\n # B\n =\n # C\n 5\n # D\n ;")), + (17, 7, Right("quuux/**/=/**/5/**/;")), + (19, 10, Left("inherit toInherit;")), + (20, 22, Left("inherit (toInherit) toInherit;")), ]; for (line, column, expected_result) in cases { let actual_result = nix_file .attrpath_value_at(line, column) .context(format!("line {line}, column {column}"))? - .map(|node| node.to_string()); + .map_right(|node| node.to_string()); let owned_expected_result = expected_result .map(|x| x.to_string()) - .map_err(|x| x.to_string()); + .map_left(|x| x.to_string()); assert_eq!( actual_result, owned_expected_result, "line {line}, column {column}" diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index fac789e3e03f..03203073fd4a 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -68,7 +68,6 @@ pub enum NixpkgsProblem { package_name: String, file: PathBuf, line: usize, - column: usize, actual_path: PathBuf, expected_path: PathBuf, }, @@ -117,16 +116,24 @@ pub enum NixpkgsProblem { text: String, io_error: String, }, - MovedOutOfByName { + MovedOutOfByNameEmptyArg { package_name: String, call_package_path: Option, - empty_arg: bool, file: PathBuf, }, - NewPackageNotUsingByName { + MovedOutOfByNameNonEmptyArg { + package_name: String, + call_package_path: Option, + file: PathBuf, + }, + NewPackageNotUsingByNameEmptyArg { + package_name: String, + call_package_path: Option, + file: PathBuf, + }, + NewPackageNotUsingByNameNonEmptyArg { package_name: String, call_package_path: Option, - empty_arg: bool, file: PathBuf, }, InternalCallPackageUsed { @@ -203,8 +210,7 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage ./{} {{ /* ... */ }}; - Notably the second argument must not be empty, which is not the case. - It is defined in {}:{} as + However, in this PR, the second argument is empty. See the definition in {}:{}: {} ", @@ -222,8 +228,7 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage ./{} {{ /* ... */ }}; - This is however not the case: A different `callPackage` is used. - It is defined in {}:{} as + However, in this PR, a different `callPackage` is used. See the definition in {}:{}: {} ", @@ -241,8 +246,7 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage ./{} {{ /* ... */ }}; - This is however not the case: The first callPackage argument is not right: - It is defined in {}:{} as + However, in this PR, the first `callPackage` argument is not a path. See the definition in {}:{}: {} ", @@ -252,7 +256,7 @@ impl fmt::Display for NixpkgsProblem { line, indent_definition(*column, definition.clone()), ), - NixpkgsProblem::WrongCallPackagePath { package_name, file, line, column, actual_path, expected_path } => + NixpkgsProblem::WrongCallPackagePath { package_name, file, line, actual_path, expected_path } => writedoc! { f, " @@ -260,14 +264,13 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage {} {{ /* ... */ }}; - This is however not the case: The first `callPackage` argument is the wrong path. - It is defined in {}:{}:{} as + However, in this PR, the first `callPackage` argument is the wrong path. See the definition in {}:{}: {package_name} = callPackage {} {{ /* ... */ }}; ", structure::relative_dir_for_package(package_name).display(), create_path_expr(file, expected_path), - file.display(), line, column, + file.display(), line, create_path_expr(file, actual_path), }, NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => { @@ -278,8 +281,7 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage ./{} {{ /* ... */ }}; - This is however not the case. - It is defined in {}:{} as + However, in this PR, it isn't defined that way. See the definition in {}:{} {} ", @@ -342,49 +344,48 @@ impl fmt::Display for NixpkgsProblem { subpath.display(), text, ), - NixpkgsProblem::MovedOutOfByName { package_name, call_package_path, empty_arg, file } => { + NixpkgsProblem::MovedOutOfByNameEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { format!("./{}", path.display()) } else { "...".into() }; - if *empty_arg { - writedoc!( - f, - " - - Attribute `pkgs.{package_name} was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {}. - Please move the package back and remove the manual `callPackage`. - ", - structure::relative_file_for_package(package_name).display(), - file.display(), - ) - } else { - // This can happen if users mistakenly assume that for custom arguments, - // pkgs/by-name can't be used. - writedoc!( - f, - " - - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {}. - While the manual `callPackage` is still needed, it's not necessary to move the package files. - ", - structure::relative_file_for_package(package_name).display(), - file.display(), - ) - } + writedoc!( + f, + " + - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {}. + Please move the package back and remove the manual `callPackage`. + ", + structure::relative_file_for_package(package_name).display(), + file.display(), + ) }, - NixpkgsProblem::NewPackageNotUsingByName { package_name, call_package_path, empty_arg, file } => { + NixpkgsProblem::MovedOutOfByNameNonEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { format!("./{}", path.display()) } else { "...".into() }; - let extra = - if *empty_arg { - format!("Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {} is needed anymore.", file.display()) + // This can happen if users mistakenly assume that for custom arguments, + // pkgs/by-name can't be used. + writedoc!( + f, + " + - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {}. + While the manual `callPackage` is still needed, it's not necessary to move the package files. + ", + structure::relative_file_for_package(package_name).display(), + file.display(), + ) + }, + NixpkgsProblem::NewPackageNotUsingByNameEmptyArg { package_name, call_package_path, file } => { + let call_package_arg = + if let Some(path) = &call_package_path { + format!("./{}", path.display()) } else { - format!("Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {} is still needed.", file.display()) + "...".into() }; writedoc!( f, @@ -392,9 +393,29 @@ impl fmt::Display for NixpkgsProblem { - Attribute `pkgs.{package_name}` is a new top-level package using `pkgs.callPackage {call_package_arg} {{ /* ... */ }}`. Please define it in {} instead. See `pkgs/by-name/README.md` for more details. - {extra} + Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {} is needed anymore. ", structure::relative_file_for_package(package_name).display(), + file.display(), + ) + }, + NixpkgsProblem::NewPackageNotUsingByNameNonEmptyArg { package_name, call_package_path, file } => { + let call_package_arg = + if let Some(path) = &call_package_path { + format!("./{}", path.display()) + } else { + "...".into() + }; + writedoc!( + f, + " + - Attribute `pkgs.{package_name}` is a new top-level package using `pkgs.callPackage {call_package_arg} {{ /* ... */ }}`. + Please define it in {} instead. + See `pkgs/by-name/README.md` for more details. + Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {} is still needed. + ", + structure::relative_file_for_package(package_name).display(), + file.display(), ) }, NixpkgsProblem::InternalCallPackageUsed { attr_name } => @@ -426,14 +447,13 @@ fn indent_definition(column: usize, definition: String) -> String { /// Creates a Nix path expression that when put into Nix file `from_file`, would point to the `to_file`. fn create_path_expr(from_file: impl AsRef, to_file: impl AsRef) -> String { - // FIXME: Clean these unwrap's up - // But these should never trigger because we only call this function with relative paths, and only - // with `from_file` being an actual file (so there's always a parent) + // These `expect` calls should never trigger because we only call this function with + // relative paths that have a parent. That's why we `expect` them! let from = RelativePath::from_path(&from_file) - .unwrap() + .expect("a relative path") .parent() - .unwrap(); - let to = RelativePath::from_path(&to_file).unwrap(); + .expect("a parent for this path"); + let to = RelativePath::from_path(&to_file).expect("a path"); let rel = from.relative(to); format!("./{rel}") } diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index 28036d3689f1..eed5071a5a2a 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -154,17 +154,29 @@ impl ToNixpkgsProblem for UsesByName { (to, file): &Self::ToContext, ) -> NixpkgsProblem { if let Some(()) = optional_from { - NixpkgsProblem::MovedOutOfByName { + if to.empty_arg { + NixpkgsProblem::MovedOutOfByNameEmptyArg { + package_name: name.to_owned(), + call_package_path: to.relative_path.clone(), + file: file.to_owned(), + } + } else { + NixpkgsProblem::MovedOutOfByNameNonEmptyArg { + package_name: name.to_owned(), + call_package_path: to.relative_path.clone(), + file: file.to_owned(), + } + } + } else if to.empty_arg { + NixpkgsProblem::NewPackageNotUsingByNameEmptyArg { package_name: name.to_owned(), call_package_path: to.relative_path.clone(), - empty_arg: to.empty_arg, file: file.to_owned(), } } else { - NixpkgsProblem::NewPackageNotUsingByName { + NixpkgsProblem::NewPackageNotUsingByNameNonEmptyArg { package_name: name.to_owned(), call_package_path: to.relative_path.clone(), - empty_arg: to.empty_arg, file: file.to_owned(), } } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected index 2d05db0d4699..1d92e652200e 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/alt-callPackage/expected @@ -2,9 +2,8 @@ foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; - This is however not the case: A different `callPackage` is used. - It is defined in all-packages.nix:5 as + However, in this PR, a different `callPackage` is used. See the definition in all-packages.nix:5: foo = self.alt.callPackage ({ }: self.someDrv) { }; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected index feb6cce2fd04..e209e1855314 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-fixed/expected @@ -1 +1 @@ -The base branch was broken, but this PR fixes it, nice job! +The base branch is broken, but this PR fixes it. Nice job! diff --git a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected index 4f0d08357d1f..c25f06b4150e 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/base-still-broken/expected @@ -1,3 +1,3 @@ pkgs/by-name/bar: This is a file, but it should be a directory. -The base branch is broken and still has above problems with this PR, these need to be fixed first. +The base branch is broken and still has above problems with this PR, which need to be fixed first. Consider reverting the PR that introduced these problems in order to prevent more failures of unrelated PRs. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected b/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected index 6b937106b806..15b3e3ff6ede 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/broken-autocall/expected @@ -1,2 +1,2 @@ pkgs.foo: This attribute is not defined but it should be defined automatically as pkgs/by-name/fo/foo/package.nix -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected b/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected index ec1918cace8c..3b0146cdc146 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/incorrect-shard/expected @@ -1,2 +1,2 @@ pkgs/by-name/aa/FOO: Incorrect directory location, should be pkgs/by-name/fo/FOO instead. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected index 9fef30d14f37..b3d0c6fc1a40 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/expected @@ -1,2 +1,2 @@ pkgs.foo: This attribute is defined using `_internalCallByNamePackageFile`, which is an internal function not intended for manual use. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected index aac1b186ca49..80f6e7dd5998 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/invalid-package-name/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/fo@: Invalid package directory name "fo@", must be ASCII characters consisting of a-z, A-Z, 0-9, "-" or "_". -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected index ce7c2695424c..7ca9ff8565bd 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/invalid-shard-name/expected @@ -1,2 +1,2 @@ pkgs/by-name/A: Invalid directory name "A", must be at most 2 ASCII characters consisting of a-z, 0-9, "-" or "_". -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index 71d78019604b..8822e0cc24d4 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -2,8 +2,7 @@ noEval = callPackage ./pkgs/by-name/no/noEval/package.nix { /* ... */ }; - Notably the second argument must not be empty, which is not the case. - It is defined in all-packages.nix:9 as + However, in this PR, the second argument is empty. See the definition in all-packages.nix:9: noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; @@ -11,9 +10,8 @@ onlyMove = callPackage ./pkgs/by-name/on/onlyMove/package.nix { /* ... */ }; - Notably the second argument must not be empty, which is not the case. - It is defined in all-packages.nix:7 as + However, in this PR, the second argument is empty. See the definition in all-packages.nix:7: onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; -This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch +This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected b/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected index 93c882b2bd3c..1b67704817cf 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/missing-package-nix/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/foo: Missing required "package.nix" file. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected index 3319cc271ac9..0e5c07cc04c6 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected @@ -1,7 +1,7 @@ -- Attribute `pkgs.foo1 was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo1` was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. Please move the package back and remove the manual `callPackage`. -- Attribute `pkgs.foo2 was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo2` was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. Please move the package back and remove the manual `callPackage`. - Attribute `pkgs.foo3` was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. @@ -10,4 +10,4 @@ - Attribute `pkgs.foo4` was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. While the manual `callPackage` is still needed, it's not necessary to move the package files. -This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch +This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected index 303884cb7944..0105b19078c7 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected @@ -11,4 +11,4 @@ pkgs/by-name/ba/foo: File package.nix at line 3 contains the path expression ".. pkgs/by-name/ba/foo: File package.nix at line 4 contains the nix search path expression "" which may point outside the directory of that package. pkgs/by-name/ba/foo: File package.nix at line 5 contains the path expression "./${"test"}", which is not yet supported and may point outside the directory of that package. pkgs/by-name/fo/foo: Missing required "package.nix" file. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected index a7db19e5fd90..9cfb996f381e 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected @@ -18,4 +18,4 @@ See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is still needed. -This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch +This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected index 48acbec1210d..1705d22be798 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-attrs/expected @@ -1,2 +1,2 @@ pkgs.nonDerivation: This attribute defined by pkgs/by-name/no/nonDerivation/package.nix is not a derivation -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected index 48acbec1210d..1705d22be798 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-derivation/expected @@ -1,2 +1,2 @@ pkgs.nonDerivation: This attribute defined by pkgs/by-name/no/nonDerivation/package.nix is not a derivation -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix index e31aa831b814..3e0ea20c2281 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/all-packages.nix @@ -2,4 +2,5 @@ self: super: { bar = (x: x) self.callPackage ./pkgs/by-name/fo/foo/package.nix { someFlag = true; }; foo = self.bar; + } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected index f56585ac4678..e09e931bb658 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/non-syntactical-callPackage-by-name/expected @@ -2,9 +2,8 @@ foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; - This is however not the case. - It is defined in all-packages.nix:4 as + However, in this PR, it isn't defined that way. See the definition in all-packages.nix:4 foo = self.bar; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected index 571ec8e09a5c..16292c0c0eb1 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-different-file/expected @@ -2,9 +2,8 @@ nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; - This is however not the case: The first `callPackage` argument is the wrong path. - It is defined in all-packages.nix:2:3 as + However, in this PR, the first `callPackage` argument is the wrong path. See the definition in all-packages.nix:2: nonDerivation = callPackage ./someDrv.nix { /* ... */ }; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index 257030e9a6c0..79f78e2437a0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -2,9 +2,8 @@ nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; - Notably the second argument must not be empty, which is not the case. - It is defined in all-packages.nix:2 as + However, in this PR, the second argument is empty. See the definition in all-packages.nix:2: nonDerivation = self.callPackage ./pkgs/by-name/no/nonDerivation/package.nix { }; -This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch +This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected index eb13c4df1e88..d91d58d629f2 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-call-package/expected @@ -2,9 +2,8 @@ nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; - This is however not the case. - It is defined in all-packages.nix:2 as + However, in this PR, it isn't defined that way. See the definition in all-packages.nix:2 nonDerivation = self.someDrv; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected index 31679e55b7d6..807c440dd3d2 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-no-file/expected @@ -2,9 +2,8 @@ nonDerivation = callPackage ./pkgs/by-name/no/nonDerivation/package.nix { /* ... */ }; - This is however not the case: The first callPackage argument is not right: - It is defined in all-packages.nix:2 as + However, in this PR, the first `callPackage` argument is not a path. See the definition in all-packages.nix:2: nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected index e7fd8242f5f4..4adbaf66edc0 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-non-path/expected @@ -2,9 +2,8 @@ foo = callPackage ./pkgs/by-name/fo/foo/package.nix { /* ... */ }; - This is however not the case: The first callPackage argument is not right: - It is defined in all-packages.nix:3 as + However, in this PR, the first `callPackage` argument is not a path. See the definition in all-packages.nix:3: foo = self.callPackage ({ someDrv, someFlag }: someDrv) { someFlag = true; }; -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected index 864978b9b731..adee1d0137fa 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/package-dir-is-file/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/foo: This path is a file, but it should be a directory. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected b/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected index 82ad2ce85bbf..d03e1eceea26 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/package-nix-dir/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/foo: "package.nix" must be a file. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected index 0e0e876d5561..0bdb00f20cb9 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-absolute/expected @@ -1,2 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "/foo" which cannot be resolved: No such file or directory (os error 2). -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected index f414e4145674..2e4338ccc7ae 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-escape/expected @@ -1,2 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "../." which may point outside the directory of that package. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected index 7b47a786a8be..30125570794a 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-nix-path/expected @@ -1,2 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the nix search path expression "" which may point outside the directory of that package. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected b/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected index 1905841a63df..6567439b77f8 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/ref-path-subexpr/expected @@ -1,2 +1,2 @@ pkgs/by-name/aa/aa: File package.nix at line 2 contains the path expression "./${"test"}", which is not yet supported and may point outside the directory of that package. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected b/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected index 4a02d99778a9..689cee41f1e3 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/shard-file/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo: This is a file, but it should be a directory. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index 2b3c2cdeee18..8f574d9dddc3 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -2,8 +2,7 @@ a = callPackage ./pkgs/by-name/a/a/package.nix { /* ... */ }; - Notably the second argument must not be empty, which is not the case. - It is defined in all-packages.nix:2 as + However, in this PR, the second argument is empty. See the definition in all-packages.nix:2: a = self.callPackage ./pkgs/by-name/a/a/package.nix { }; @@ -16,8 +15,7 @@ c = callPackage ./pkgs/by-name/c/c/package.nix { /* ... */ }; - Notably the second argument must not be empty, which is not the case. - It is defined in all-packages.nix:4 as + However, in this PR, the second argument is empty. See the definition in all-packages.nix:4: c = self.callPackage ./pkgs/by-name/c/c/package.nix { }; @@ -26,4 +24,4 @@ See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/all-packages.nix is needed anymore. -This PR introduces the above problems compared to the base branch, merging is discouraged, but would not break the base branch +This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected b/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected index e6c183207e57..cd555c658a09 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/symlink-escape/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/foo: Path package.nix is a symlink pointing to a path outside the directory of that package. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected b/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected index 01de2702f7d5..1b06bcf4972b 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/symlink-invalid/expected @@ -1,2 +1,2 @@ pkgs/by-name/fo/foo: Path foo is a symlink which cannot be resolved: No such file or directory (os error 2). -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected index d66a3185e701..608843d93903 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected @@ -1,2 +1,2 @@ pkgs.foo: Cannot determine the location of this attribute using `builtins.unsafeGetAttrPos`. -This PR introduces the above problems, merging would break the base branch +This PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break. From f056449c462ff6c5f933f3c297d605ff02147a99 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 1 Mar 2024 01:42:28 +0100 Subject: [PATCH 078/186] tests.nixpkgs-check-by-name: Fix absolute path in errors --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 23 ++++++++++++++----- .../tests/mock-nixpkgs.nix | 23 +++++++++++++------ .../tests/move-to-non-by-name/expected | 8 +++---- .../tests/new-package-non-by-name/expected | 8 +++---- .../tests/sorted-order/expected | 4 ++-- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index a43a0cd743a7..978fe9295336 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -183,6 +183,7 @@ pub fn check_values( Attribute::NonByName(non_by_name_attribute) => handle_non_by_name_attribute( nixpkgs_path, nix_file_store, + &attribute_name, non_by_name_attribute, )?, Attribute::ByName(by_name_attribute) => by_name( @@ -431,6 +432,7 @@ fn by_name_override( fn handle_non_by_name_attribute( nixpkgs_path: &Path, nix_file_store: &mut NixFileStore, + attribute_name: &str, non_by_name_attribute: NonByNameAttribute, ) -> validation::Result { use ratchet::RatchetState::*; @@ -481,11 +483,17 @@ fn handle_non_by_name_attribute( location: Some(location), }) = non_by_name_attribute { - // Parse the Nix file in the location and figure out whether it's an - // attribute definition of the form `= callPackage `, + // Parse the Nix file in the location + let nix_file = nix_file_store.get(&location.file)?; + + // The relative path of the Nix file, for error messages + let relative_location_file = location.relative_file(nixpkgs_path).with_context(|| { + format!("Failed to resolve the file where attribute {attribute_name} is defined") + })?; + + // Figure out whether it's an attribute definition of the form `= callPackage `, // returning the arguments if so. - let (optional_syntactic_call_package, _definition) = nix_file_store - .get(&location.file)? + let (optional_syntactic_call_package, _definition) = nix_file .call_package_argument_info_at( location.line, location.column, @@ -493,7 +501,10 @@ fn handle_non_by_name_attribute( // strips the absolute Nixpkgs path from it, such that // syntactic_call_package.relative_path is relative to Nixpkgs nixpkgs_path - )?; + ) + .with_context(|| { + format!("Failed to get the definition info for attribute {attribute_name}") + })?; // At this point, we completed two different checks for whether it's a // `callPackage` @@ -529,7 +540,7 @@ fn handle_non_by_name_attribute( _ => { // Otherwise, the path is outside `pkgs/by-name`, which means it can be // migrated - Loose((syntactic_call_package, location.file)) + Loose((syntactic_call_package, relative_location_file)) } } } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix b/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix index 81a9c916ac2d..fbd51f656138 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix @@ -28,13 +28,22 @@ let lib = import ; # The base fixed-point function to populate the resulting attribute set - pkgsFun = self: { - inherit lib; - newScope = extra: lib.callPackageWith (self // extra); - callPackage = self.newScope { }; - callPackages = lib.callPackagesWith self; - someDrv = { type = "derivation"; }; - }; + pkgsFun = + self: { + inherit lib; + newScope = extra: lib.callPackageWith (self // extra); + callPackage = self.newScope { }; + callPackages = lib.callPackagesWith self; + } + # This mapAttrs is a very hacky workaround necessary because for all attributes defined in Nixpkgs, + # the files that define them are verified to be within Nixpkgs. + # This is usually a very safe assumption, but it fails in these tests for someDrv, + # because it's technically defined outside the Nixpkgs directories of each test case. + # By using `mapAttrs`, `builtins.unsafeGetAttrPos` just returns `null`, + # which then doesn't trigger this check + // lib.mapAttrs (name: value: value) { + someDrv = { type = "derivation"; }; + }; baseDirectory = root + "/pkgs/by-name"; diff --git a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected index 0e5c07cc04c6..123e24daab8a 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/expected @@ -1,13 +1,13 @@ -- Attribute `pkgs.foo1` was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo1` was previously defined in pkgs/by-name/fo/foo1/package.nix, but is now manually defined as `callPackage ... { /* ... */ }` in all-packages.nix. Please move the package back and remove the manual `callPackage`. -- Attribute `pkgs.foo2` was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { /* ... */ }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo2` was previously defined in pkgs/by-name/fo/foo2/package.nix, but is now manually defined as `callPackage ./without-config.nix { /* ... */ }` in all-packages.nix. Please move the package back and remove the manual `callPackage`. -- Attribute `pkgs.foo3` was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo3` was previously defined in pkgs/by-name/fo/foo3/package.nix, but is now manually defined as `callPackage ... { ... }` in all-packages.nix. While the manual `callPackage` is still needed, it's not necessary to move the package files. -- Attribute `pkgs.foo4` was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/move-to-non-by-name/all-packages.nix. +- Attribute `pkgs.foo4` was previously defined in pkgs/by-name/fo/foo4/package.nix, but is now manually defined as `callPackage ./with-config.nix { ... }` in all-packages.nix. While the manual `callPackage` is still needed, it's not necessary to move the package files. This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected index 9cfb996f381e..92668a231b48 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/expected @@ -1,21 +1,21 @@ - Attribute `pkgs.new1` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/ne/new1/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is needed anymore. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in all-packages.nix is needed anymore. - Attribute `pkgs.new2` is a new top-level package using `pkgs.callPackage ./without-config.nix { /* ... */ }`. Please define it in pkgs/by-name/ne/new2/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is needed anymore. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in all-packages.nix is needed anymore. - Attribute `pkgs.new3` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/ne/new3/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is still needed. + Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in all-packages.nix is still needed. - Attribute `pkgs.new4` is a new top-level package using `pkgs.callPackage ./with-config.nix { /* ... */ }`. Please define it in pkgs/by-name/ne/new4/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/new-package-non-by-name/all-packages.nix is still needed. + Since the second `callPackage` argument is not `{ }`, the manual `callPackage` in all-packages.nix is still needed. This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index 8f574d9dddc3..9c7b0d22a610 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -9,7 +9,7 @@ - Attribute `pkgs.b` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/b/b/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/all-packages.nix is needed anymore. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in all-packages.nix is needed anymore. - Because pkgs/by-name/c/c exists, the attribute `pkgs.c` must be defined like @@ -22,6 +22,6 @@ - Attribute `pkgs.d` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/d/d/package.nix instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is `{ }`, no manual `callPackage` in /home/tweagysil/src/nixpkgs/by-name-improv/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/all-packages.nix is needed anymore. + Since the second `callPackage` argument is `{ }`, no manual `callPackage` in all-packages.nix is needed anymore. This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. From 7858f062884e2318dda212ab7cc1ceda871195b2 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 1 Mar 2024 01:50:05 +0100 Subject: [PATCH 079/186] tests.nixpkgs-check-by-name: Better empty argument error --- pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs | 2 ++ .../nixpkgs-check-by-name/tests/manual-definition/expected | 4 ++++ .../nixpkgs-check-by-name/tests/override-empty-arg/expected | 2 ++ pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 03203073fd4a..498284ac6f24 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -213,6 +213,8 @@ impl fmt::Display for NixpkgsProblem { However, in this PR, the second argument is empty. See the definition in {}:{}: {} + + Such a definition is provided automatically and therefore not necessary. Please remove it. ", structure::relative_dir_for_package(package_name).display(), structure::relative_file_for_package(package_name).display(), diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected index 8822e0cc24d4..4d906ec0d086 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -6,6 +6,8 @@ noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; + Such a definition is provided automatically and therefore not necessary. Please remove it. + - Because pkgs/by-name/on/onlyMove exists, the attribute `pkgs.onlyMove` must be defined like onlyMove = callPackage ./pkgs/by-name/on/onlyMove/package.nix { /* ... */ }; @@ -14,4 +16,6 @@ onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; + Such a definition is provided automatically and therefore not necessary. Please remove it. + This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected index 79f78e2437a0..f3306aadbbb7 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/expected @@ -6,4 +6,6 @@ nonDerivation = self.callPackage ./pkgs/by-name/no/nonDerivation/package.nix { }; + Such a definition is provided automatically and therefore not necessary. Please remove it. + This PR introduces additional instances of discouraged patterns as listed above. Merging is discouraged but would not break the base branch. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected index 9c7b0d22a610..8a8104b73720 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected +++ b/pkgs/test/nixpkgs-check-by-name/tests/sorted-order/expected @@ -6,6 +6,8 @@ a = self.callPackage ./pkgs/by-name/a/a/package.nix { }; + Such a definition is provided automatically and therefore not necessary. Please remove it. + - Attribute `pkgs.b` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/b/b/package.nix instead. See `pkgs/by-name/README.md` for more details. @@ -19,6 +21,8 @@ c = self.callPackage ./pkgs/by-name/c/c/package.nix { }; + Such a definition is provided automatically and therefore not necessary. Please remove it. + - Attribute `pkgs.d` is a new top-level package using `pkgs.callPackage ... { /* ... */ }`. Please define it in pkgs/by-name/d/d/package.nix instead. See `pkgs/by-name/README.md` for more details. From ad383118e36e49a2d916cbe32e5c7c11c836209f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Feb 2024 16:19:40 -0300 Subject: [PATCH 080/186] ltris: migrate to by-name --- .../lgames/ltris/default.nix => by-name/lt/ltris/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{games/lgames/ltris/default.nix => by-name/lt/ltris/package.nix} (100%) diff --git a/pkgs/games/lgames/ltris/default.nix b/pkgs/by-name/lt/ltris/package.nix similarity index 100% rename from pkgs/games/lgames/ltris/default.nix rename to pkgs/by-name/lt/ltris/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 37a6bfb96058..1a49351dccb9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37090,8 +37090,6 @@ with pkgs; lpairs2 = callPackage ../games/lgames/lpairs2 { }; - ltris = callPackage ../games/lgames/ltris { }; - maelstrom = callPackage ../games/maelstrom { }; mar1d = callPackage ../games/mar1d { } ; From 39ba389b87fd853a45e0807edc29b8ebc7638a3b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 24 Feb 2024 23:46:41 -0300 Subject: [PATCH 081/186] ltris: refactor - finalAttrs design pattern - get rid of nested with - set meta.mainProgram --- pkgs/by-name/lt/ltris/package.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/lt/ltris/package.nix b/pkgs/by-name/lt/ltris/package.nix index 8cf581b376bf..458c8d02f93b 100644 --- a/pkgs/by-name/lt/ltris/package.nix +++ b/pkgs/by-name/lt/ltris/package.nix @@ -1,17 +1,17 @@ { lib -, stdenv -, fetchurl , SDL , SDL_mixer , directoryListingUpdater +, fetchurl +, stdenv }: -stdenv.mkDerivation rec { - pname = "ltris"; +stdenv.mkDerivation (finalAttrs: { + pname = "lgames-ltris"; version = "1.2.7"; src = fetchurl { - url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz"; + url = "mirror://sourceforge/lgames/ltris-${finalAttrs.version}.tar.gz"; hash = "sha256-EpHGpkLQa57hU6wKLnhVosmD6DnGGPGilN8E2ClSXLA="; }; @@ -23,17 +23,18 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; passthru.updateScript = directoryListingUpdater { - inherit pname version; + inherit (finalAttrs) pname version; url = "https://lgames.sourceforge.io/LTris/"; extraRegex = "(?!.*-win(32|64)).*"; }; - meta = with lib; { + meta = { homepage = "https://lgames.sourceforge.io/LTris/"; description = "Tetris clone from the LGames series"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ AndersonTorres ciil ]; + license = with lib.licenses; [ gpl2Plus ]; + mainProgram = "ltris"; + maintainers = with lib.maintainers; [ AndersonTorres ]; inherit (SDL.meta) platforms; broken = stdenv.isDarwin; }; -} +}) From 79b7518a2ed76c624a2bf06b9452a451266571e7 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Feb 2024 00:30:59 -0300 Subject: [PATCH 082/186] ltris: 1.2.7 -> 1.2.8 --- pkgs/by-name/lt/ltris/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/lt/ltris/package.nix b/pkgs/by-name/lt/ltris/package.nix index 458c8d02f93b..82137b2fbec6 100644 --- a/pkgs/by-name/lt/ltris/package.nix +++ b/pkgs/by-name/lt/ltris/package.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "lgames-ltris"; - version = "1.2.7"; + version = "1.2.8"; src = fetchurl { url = "mirror://sourceforge/lgames/ltris-${finalAttrs.version}.tar.gz"; - hash = "sha256-EpHGpkLQa57hU6wKLnhVosmD6DnGGPGilN8E2ClSXLA="; + hash = "sha256-2e5haaU2pqkBk82qiF/3HQgSBVPHP09UwW+TQqpGUqA="; }; buildInputs = [ From 8032bb61739460d5d743c01bde194db1f839c866 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 29 Feb 2024 02:46:49 +0100 Subject: [PATCH 083/186] pkgs/by-name: recommendations for multi-versioned packages Over the past weeks, we've seen one oversight with the new enforcement of `pkgs/by-name` for new packages. This documents the problem and the recommendation for resolving it. --- pkgs/by-name/README.md | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/pkgs/by-name/README.md b/pkgs/by-name/README.md index 990882aec837..0296ccf2e1bc 100644 --- a/pkgs/by-name/README.md +++ b/pkgs/by-name/README.md @@ -118,3 +118,83 @@ $ ./pkgs/test/nixpkgs-check-by-name/scripts/run-local.sh master ``` See [here](../../.github/workflows/check-by-name.yml) for more info. + +## Recommendation for new packages with multiple versions + +These checks of the `pkgs/by-name` structure can cause problems in combination: +1. New top-level packages using `callPackage` must be defined via `pkgs/by-name`. +2. Packages in `pkgs/by-name` cannot refer to files outside their own directory. + +This means that outside `pkgs/by-name`, multiple already-present top-level packages can refer to some common file. +If you open a PR to another instance of such a package, CI will fail check 1, +but if you try to move the package to `pkgs/by-name`, it will fail check 2. + +This is often the case for packages with multiple versions, such as + +```nix + foo_1 = callPackage ../tools/foo/1.nix { }; + foo_2 = callPackage ../tools/foo/2.nix { }; +``` + +The best way to resolve this is to not use `callPackage` directly, such that check 1 doesn't trigger. +This can be done by using `inherit` on a local package set: +```nix + inherit + ({ + foo_1 = callPackage ../tools/foo/1.nix { }; + foo_2 = callPackage ../tools/foo/2.nix { }; + }) + foo_1 + foo_2 + ; +``` + +While this may seem pointless, this can in fact help with future package set refactorings, +because it establishes a clear connection between related attributes. + +### Further possible refactorings + +This is not required, but the above solution also allows refactoring the definitions into a separate file: + +```nix + inherit (import ../tools/foo pkgs) + foo_1 foo_2; +``` + +```nix +# pkgs/tools/foo/default.nix +pkgs: { + foo_1 = callPackage ./1.nix { }; + foo_2 = callPackage ./2.nix { }; +} +``` + +Alternatively using [`callPackages`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.customisation.callPackagesWith) +if `callPackage` isn't used underneath and you want the same `.override` arguments for all attributes: + +```nix + inherit (callPackages ../tools/foo { }) + foo_1 foo_2; +``` + +```nix +# pkgs/tools/foo/default.nix +{ + stdenv +}: { + foo_1 = stdenv.mkDerivation { /* ... */ }; + foo_2 = stdenv.mkDerivation { /* ... */ }; +} +``` + +### Exposing the package set + +This is not required, but the above solution also allows exposing the package set as an attribute: + +```nix + foo-versions = import ../tools/foo pkgs; + # Or using callPackages + # foo-versions = callPackages ../tools/foo { }; + + inherit (foo-versions) foo_1 foo_2; +``` From 45d2ea2eaae554e9918d92f569096af04febffc4 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 02:11:10 +0000 Subject: [PATCH 084/186] snyk: 1.1280.1 -> 1.1281.0 --- pkgs/development/tools/analysis/snyk/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/analysis/snyk/default.nix b/pkgs/development/tools/analysis/snyk/default.nix index b87bb1a11634..4eacb2b476f5 100644 --- a/pkgs/development/tools/analysis/snyk/default.nix +++ b/pkgs/development/tools/analysis/snyk/default.nix @@ -2,16 +2,16 @@ buildNpmPackage rec { pname = "snyk"; - version = "1.1280.1"; + version = "1.1281.0"; src = fetchFromGitHub { owner = "snyk"; repo = "cli"; rev = "v${version}"; - hash = "sha256-bwEekB/jifSRktblvq98C3t2xSTTPn4NOftQs/T090U="; + hash = "sha256-QxmYArH9HRq2vkGzfhWlCPLS++UiwdzAStUQxhGF85Q="; }; - npmDepsHash = "sha256-TtWc+Zy6yMHbDdsw5rVKK+RiCZ8ZuXyU+SfcPRgToiA="; + npmDepsHash = "sha256-JxX4r1I/F3PEzg9rLfFNEIa4Q8jwuUWC6krH1oSoc8s="; postPatch = '' substituteInPlace package.json --replace '"version": "1.0.0-monorepo"' '"version": "${version}"' From f555f78e2b8ca2c6ffdcd5b5bca9e2cd3aec89d7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 03:09:08 +0000 Subject: [PATCH 085/186] atmos: 1.64.1 -> 1.64.3 --- pkgs/applications/networking/cluster/atmos/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/atmos/default.nix b/pkgs/applications/networking/cluster/atmos/default.nix index 2b3ff6c11710..af4dad92e466 100644 --- a/pkgs/applications/networking/cluster/atmos/default.nix +++ b/pkgs/applications/networking/cluster/atmos/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "atmos"; - version = "1.64.1"; + version = "1.64.3"; src = fetchFromGitHub { owner = "cloudposse"; repo = pname; rev = "v${version}"; - sha256 = "sha256-QHXBvZThLi5Gnpc7fmitkvl3JU1i/g2jz8c6U4//6mU="; + sha256 = "sha256-Z27wFAWstsQliDiYl93yY9LDeVcGEWcrmggGJI60hxk="; }; vendorHash = "sha256-i7m9YXPlWqHtvC4Df7v5bLWt2tqeT933t2+Xit5RQxg="; From a956a175bb56c5403f1f205df8af220752a2c607 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 03:20:45 +0000 Subject: [PATCH 086/186] rqlite: 8.21.3 -> 8.22.1 --- pkgs/servers/sql/rqlite/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/sql/rqlite/default.nix b/pkgs/servers/sql/rqlite/default.nix index 66f2ce9ad74e..d8bcadbb9df9 100644 --- a/pkgs/servers/sql/rqlite/default.nix +++ b/pkgs/servers/sql/rqlite/default.nix @@ -5,13 +5,13 @@ buildGoModule rec { pname = "rqlite"; - version = "8.21.3"; + version = "8.22.1"; src = fetchFromGitHub { owner = "rqlite"; repo = pname; rev = "v${version}"; - sha256 = "sha256-YnCa0gv+loI+PeQHZWar7GpEhqvQo1AwIj5LGTol3k0="; + sha256 = "sha256-g5W+rHD4gUS82E+wFLQ3VTSwIWQUogwTutwPTtf+IdM="; }; vendorHash = "sha256-onR4n6ok6y9APRwGjBoMISbidGDVw19D48TkogRp1uM="; From 0e7b3250b5a80b6844c657c5f4002f7ef1987cf5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 03:51:30 +0000 Subject: [PATCH 087/186] hugo: 0.123.4 -> 0.123.6 --- pkgs/by-name/hu/hugo/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hu/hugo/package.nix b/pkgs/by-name/hu/hugo/package.nix index 7695aeca9ed3..be4ee9c4ffb8 100644 --- a/pkgs/by-name/hu/hugo/package.nix +++ b/pkgs/by-name/hu/hugo/package.nix @@ -10,16 +10,16 @@ buildGoModule rec { pname = "hugo"; - version = "0.123.4"; + version = "0.123.6"; src = fetchFromGitHub { owner = "gohugoio"; repo = "hugo"; rev = "refs/tags/v${version}"; - hash = "sha256-AJ/uK2eunQgsCcXR8FcQ9TVvMXs56J0gpfXRQCX78qY="; + hash = "sha256-gLow1AcUROid6skLDdaJ9E3mPi99KPoOO/ZFdLBineU="; }; - vendorHash = "sha256-6qNICaj+P0VRl/crbiucZ7CpBG1vwFURkvOdaH6WidU="; + vendorHash = "sha256-V7YRrC+6fOIjXOu7E0kIOZZt++4oFLPhmHeWmOVU3Xw="; doCheck = false; From cf942d376fc39edab8dcd6585603ff1869929632 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 04:30:43 +0000 Subject: [PATCH 088/186] cgal: 5.5.3 -> 5.6.1 --- pkgs/development/libraries/CGAL/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/CGAL/default.nix b/pkgs/development/libraries/CGAL/default.nix index 672facdc230c..e7d26606f271 100644 --- a/pkgs/development/libraries/CGAL/default.nix +++ b/pkgs/development/libraries/CGAL/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { pname = "cgal"; - version = "5.5.3"; + version = "5.6.1"; src = fetchurl { url = "https://github.com/CGAL/cgal/releases/download/v${version}/CGAL-${version}.tar.xz"; - hash = "sha256-CgT2YmkyVjKLBbq/q7XjpbfbL1pY1S48Ug350IKN3XM="; + hash = "sha256-zbFefuMeBmNYnTEHp5mIo3t7FxnfPSTyBYVF0bzdWDc="; }; # note: optional component libCGAL_ImageIO would need zlib and opengl; From f1c8e6d5edc1ae2f4f7455fbd6c5bd655707fd15 Mon Sep 17 00:00:00 2001 From: RoseHobgoblin Date: Fri, 1 Mar 2024 15:43:53 +1300 Subject: [PATCH 089/186] maintainers: add rosehobgoblin --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e25af81c96a8..61b3d02bf1fb 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -16582,6 +16582,11 @@ fingerprint = "1401 1B63 393D 16C1 AA9C C521 8526 B757 4A53 6236"; }]; }; + RoseHobgoblin = { + name = "J. L. Bowden"; + github = "rosehobgoblin"; + githubId = 84164410; + }; rossabaker = { name = "Ross A. Baker"; email = "ross@rossabaker.com"; From cce7bb25e1127ae0a3b0ab63abcc4685da9acf30 Mon Sep 17 00:00:00 2001 From: RoseHobgoblin <84164410+RoseHobgoblin@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:17:01 +1300 Subject: [PATCH 090/186] fcitx5-rose-pine: init at 0-unstable-2024-03-01 --- maintainers/maintainer-list.nix | 2 +- pkgs/by-name/fc/fcitx5-rose-pine/package.nix | 34 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/fc/fcitx5-rose-pine/package.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 61b3d02bf1fb..2157971291df 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -16582,7 +16582,7 @@ fingerprint = "1401 1B63 393D 16C1 AA9C C521 8526 B757 4A53 6236"; }]; }; - RoseHobgoblin = { + rosehobgoblin = { name = "J. L. Bowden"; github = "rosehobgoblin"; githubId = 84164410; diff --git a/pkgs/by-name/fc/fcitx5-rose-pine/package.nix b/pkgs/by-name/fc/fcitx5-rose-pine/package.nix new file mode 100644 index 000000000000..b1f11a1784a9 --- /dev/null +++ b/pkgs/by-name/fc/fcitx5-rose-pine/package.nix @@ -0,0 +1,34 @@ +{ stdenvNoCC +, fetchFromGitHub +, lib +}: + +stdenvNoCC.mkDerivation { + pname = "fcitx5-rose-pine"; + version = "0-unstable-2024-03-01"; + + src = fetchFromGitHub { + owner = "rose-pine"; + repo = "fcitx5"; + rev = "148de09929c2e2f948376bb23bc25d72006403bc"; + hash = "sha256-SpQ5ylHSDF5KCwKttAlXgrte3GA1cCCy/0OKNT1a3D8="; + }; + + installPhase = '' + runHook preInstall + + mkdir -pv $out/share/fcitx5/themes/ + cp -rv rose-pine* $out/share/fcitx5/themes/ + + runHook postInstall + ''; + + + meta = { + description = "Fcitx5 themes based on Rosé Pine"; + homepage = "https://github.com/rose-pine/fcitx5"; + maintainers = with lib.maintainers; [ rosehobgoblin ]; + platforms = lib.platforms.all; + license = lib.licenses.unfree; + }; +} From 3819a4a1fba76aa3ac6ec7a7c4e8e3ee093dbbc3 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 07:34:41 +0000 Subject: [PATCH 091/186] python311Packages.types-pyopenssl: 24.0.0.20240130 -> 24.0.0.20240228 --- pkgs/development/python-modules/types-pyopenssl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/types-pyopenssl/default.nix b/pkgs/development/python-modules/types-pyopenssl/default.nix index 7a0a60049296..32859f099955 100644 --- a/pkgs/development/python-modules/types-pyopenssl/default.nix +++ b/pkgs/development/python-modules/types-pyopenssl/default.nix @@ -6,13 +6,13 @@ buildPythonPackage rec { pname = "types-pyopenssl"; - version = "24.0.0.20240130"; + version = "24.0.0.20240228"; format = "setuptools"; src = fetchPypi { pname = "types-pyOpenSSL"; inherit version; - hash = "sha256-yBLlwcNSSfde9ZNXCLKpl9Yqv5dFviIuX5S5WVRyqyU="; + hash = "sha256-zZkHF9iqN0PvDnPg9GLmS1TZDDBCSSMtSP7OTw98PGo="; }; propagatedBuildInputs = [ From 5c4585c55f02d184018f91f3e545c775178fae55 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 1 Mar 2024 09:00:32 +0100 Subject: [PATCH 092/186] codeium: 1.6.39 -> 1.8.0 --- pkgs/by-name/co/codeium/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/co/codeium/package.nix b/pkgs/by-name/co/codeium/package.nix index a9a7f14e06b5..2c7a44c1048f 100644 --- a/pkgs/by-name/co/codeium/package.nix +++ b/pkgs/by-name/co/codeium/package.nix @@ -13,10 +13,10 @@ let }.${system} or throwSystem; hash = { - x86_64-linux = "sha256-3B1TEToovw4C8rLsJv0Y3OPg8ZjMZ3Y29IzIs9Wm6II="; - aarch64-linux = "sha256-kD0yMHoJejKpK1cX/OPQLjPB8cXBp/aXy66YDxXINRw="; - x86_64-darwin = "sha256-DxyxR1t4UrqTn/ORrDiOryWCQ1L0DWXmlh2Hnm7kMS4="; - aarch64-darwin = "sha256-Ckbg/bZxeMpt2xtrLhJXo9DJTLluuWPVdGRRwiO1ZY8="; + x86_64-linux = "sha256-+SdAippxuJ0LvT+w6xSvTpzCv5EPjxXJKH4mcmnxu9Y="; + aarch64-linux = "sha256-cX+P0WcT+0oYDAcUJJ0+SRWPQCdv4rhrBf5BdPrF1Hg="; + x86_64-darwin = "sha256-eQjwViY5OsFzFtKkjLbrQgGNVBBpNNJjlfu8t/F37hI="; + aarch64-darwin = "sha256-xfB81SLuVa1wKcIGJZFxjdCSPmPXg0vYXtkCftiXBtU="; }.${system} or throwSystem; bin = "$out/bin/codeium_language_server"; @@ -24,7 +24,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "codeium"; - version = "1.6.39"; + version = "1.8.0"; src = fetchurl { name = "${finalAttrs.pname}-${finalAttrs.version}.gz"; url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${finalAttrs.version}/language_server_${plat}.gz"; From cd92d032431b8e85a70b54bae0187d9b11e83f1f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 1 Mar 2024 09:49:08 +0100 Subject: [PATCH 093/186] python311Packages.huggingface-hub: 0.21.2 -> 0.21.3 Diff: https://github.com/huggingface/huggingface_hub/compare/refs/tags/v0.21.2...v0.21.3 Changelog: https://github.com/huggingface/huggingface_hub/releases/tag/v0.21.3 --- pkgs/development/python-modules/huggingface-hub/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/huggingface-hub/default.nix b/pkgs/development/python-modules/huggingface-hub/default.nix index f57aa1a4cbb9..544fc22078a6 100644 --- a/pkgs/development/python-modules/huggingface-hub/default.nix +++ b/pkgs/development/python-modules/huggingface-hub/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "huggingface-hub"; - version = "0.21.2"; + version = "0.21.3"; pyproject = true; disabled = pythonOlder "3.8"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "huggingface"; repo = "huggingface_hub"; rev = "refs/tags/v${version}"; - hash = "sha256-0Nr6qs9rzuBQo8SGuQ2Ai2Q+E+Gs4DT/AMrYf7dYM/E="; + hash = "sha256-DtKb/mR01vifclDalZiZV4/A4XpTKBcT9bCiLZkRCZY="; }; nativeBuildInputs = [ From 2468eba391c28d6f4d5f50d0b89703a87c8d6d4e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 1 Mar 2024 09:51:22 +0100 Subject: [PATCH 094/186] python311Packages.transformers: 4.38.1 -> 4.38.2 Diff: https://github.com/huggingface/transformers/compare/refs/tags/v4.38.1...v4.38.2 Changelog: https://github.com/huggingface/transformers/releases/tag/v4.38.2 --- pkgs/development/python-modules/transformers/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/transformers/default.nix b/pkgs/development/python-modules/transformers/default.nix index de3fabc2ba28..0a0af07b89ee 100644 --- a/pkgs/development/python-modules/transformers/default.nix +++ b/pkgs/development/python-modules/transformers/default.nix @@ -53,7 +53,7 @@ buildPythonPackage rec { pname = "transformers"; - version = "4.38.1"; + version = "4.38.2"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -62,7 +62,7 @@ buildPythonPackage rec { owner = "huggingface"; repo = "transformers"; rev = "refs/tags/v${version}"; - hash = "sha256-92WmvSFZYCCG4qJprPT7clYa7ePuvyaCvxni/spDhSw="; + hash = "sha256-/rt2XHN46NcFwlM9MOygVvpQkfPVu2eCNybYmSj711M="; }; propagatedBuildInputs = [ From 592d4ec4635ba4779fe24fda3168ae7c27671ff0 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 09:38:04 +0000 Subject: [PATCH 095/186] python311Packages.pyctr: 0.7.4 -> 0.7.5 --- pkgs/development/python-modules/pyctr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyctr/default.nix b/pkgs/development/python-modules/pyctr/default.nix index 0ce889fdb739..cf225369b395 100644 --- a/pkgs/development/python-modules/pyctr/default.nix +++ b/pkgs/development/python-modules/pyctr/default.nix @@ -7,14 +7,14 @@ buildPythonPackage rec { pname = "pyctr"; - version = "0.7.4"; + version = "0.7.5"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-1nPP+rz/8BiFHu3nGcHuqCPwyyR55LUhoBprHFTudWQ="; + hash = "sha256-fiDJWcypFabnUoS313f56ypDuDrLASHrkk0Em8bymmw="; }; propagatedBuildInputs = [ From ac5833418e8b0cd6c3f22ee3ec68e3d104203f8f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 09:56:22 +0000 Subject: [PATCH 096/186] python311Packages.spyder-kernels: 2.5.0 -> 2.5.1 --- pkgs/development/python-modules/spyder-kernels/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/spyder-kernels/default.nix b/pkgs/development/python-modules/spyder-kernels/default.nix index f62c4d7c9ede..30f76ffd6258 100644 --- a/pkgs/development/python-modules/spyder-kernels/default.nix +++ b/pkgs/development/python-modules/spyder-kernels/default.nix @@ -14,14 +14,14 @@ buildPythonPackage rec { pname = "spyder-kernels"; - version = "2.5.0"; + version = "2.5.1"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-M2hCbARFfgIRiE6SdPpH61ViUrpMBz3ydeg8Zd97oqE="; + hash = "sha256-BQQqP5eyXxfN+o11AR/Xmq8CdSM0ip3/8PWiC92wubA="; }; propagatedBuildInputs = [ From 2e2b5b10d5b6f2b3acf0b304648b2c3715b35664 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Fri, 1 Mar 2024 10:58:32 +0100 Subject: [PATCH 097/186] php81Packages.psalm: fix the build Re-generated the `composer.lock` with PHP 8.1 so it does not pick up dependencies not compatible with it. --- .../php-packages/psalm/composer.lock | 164 +++++++++++++----- .../php-packages/psalm/default.nix | 2 +- 2 files changed, 117 insertions(+), 49 deletions(-) diff --git a/pkgs/development/php-packages/psalm/composer.lock b/pkgs/development/php-packages/psalm/composer.lock index 32838e6eb725..782901f11bd0 100644 --- a/pkgs/development/php-packages/psalm/composer.lock +++ b/pkgs/development/php-packages/psalm/composer.lock @@ -1192,46 +1192,47 @@ }, { "name": "symfony/console", - "version": "v7.0.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456" + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c5010d50f1ee4b25cfa0201d9915cf1b14071456", - "reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456", + "url": "https://api.github.com/repos/symfony/console/zipball/0d9e4eb5ad413075624378f474c4167ea202de78", + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -1265,7 +1266,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.3" + "source": "https://github.com/symfony/console/tree/v6.4.4" }, "funding": [ { @@ -1281,24 +1282,91 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { - "name": "symfony/filesystem", - "version": "v7.0.3", + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "shasum": "" + }, + "require": { + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -1328,7 +1396,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.3" + "source": "https://github.com/symfony/filesystem/tree/v6.4.3" }, "funding": [ { @@ -1344,7 +1412,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1748,20 +1816,20 @@ }, { "name": "symfony/string", - "version": "v7.0.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "524aac4a280b90a4420d8d6a040718d0586505ac" + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/524aac4a280b90a4420d8d6a040718d0586505ac", - "reference": "524aac4a280b90a4420d8d6a040718d0586505ac", + "url": "https://api.github.com/repos/symfony/string/zipball/4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -1771,11 +1839,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -1814,7 +1882,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.3" + "source": "https://github.com/symfony/string/tree/v6.4.4" }, "funding": [ { @@ -1830,7 +1898,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:41:16+00:00" + "time": "2024-02-01T13:16:41+00:00" }, { "name": "webmozart/assert", @@ -4448,20 +4516,20 @@ }, { "name": "symfony/process", - "version": "v7.0.3", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "937a195147e0c27b2759ade834169ed006d0bc74" + "reference": "710e27879e9be3395de2b98da3f52a946039f297" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/937a195147e0c27b2759ade834169ed006d0bc74", - "reference": "937a195147e0c27b2759ade834169ed006d0bc74", + "url": "https://api.github.com/repos/symfony/process/zipball/710e27879e9be3395de2b98da3f52a946039f297", + "reference": "710e27879e9be3395de2b98da3f52a946039f297", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -4489,7 +4557,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.3" + "source": "https://github.com/symfony/process/tree/v6.4.4" }, "funding": [ { @@ -4505,7 +4573,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-02-20T12:31:00+00:00" }, { "name": "theseer/tokenizer", diff --git a/pkgs/development/php-packages/psalm/default.nix b/pkgs/development/php-packages/psalm/default.nix index f12357507eb1..b20bbbf301c6 100644 --- a/pkgs/development/php-packages/psalm/default.nix +++ b/pkgs/development/php-packages/psalm/default.nix @@ -17,7 +17,7 @@ php.buildComposerProject (finalAttrs: { # Missing `composer.lock` from the repository. # Issue open at https://github.com/vimeo/psalm/issues/10446 composerLock = ./composer.lock; - vendorHash = "sha256-URPyV1V/8BP8fbJqyYLf+XKG786hY2BbAzUphzPyPCs="; + vendorHash = "sha256-AgvAaHcCYosS3yRrp9EFdqTjg6NzQRCr8ELSza9DvZ8="; meta = { changelog = "https://github.com/vimeo/psalm/releases/tag/${finalAttrs.version}"; From 4ff6cc7596474f97127c81eb6983fd1411ec6234 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Fri, 1 Mar 2024 11:20:13 +0100 Subject: [PATCH 098/186] zlog: apply patch for CVE-2024-22857 --- pkgs/development/libraries/zlog/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/zlog/default.nix b/pkgs/development/libraries/zlog/default.nix index 4baa18b9d46f..df6c253075e6 100644 --- a/pkgs/development/libraries/zlog/default.nix +++ b/pkgs/development/libraries/zlog/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, fetchpatch }: stdenv.mkDerivation rec { version = "1.2.17"; @@ -11,6 +11,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-ckpDMRLxObpl8N539DC5u2bPpmD7jM+KugurUfta6tg="; }; + patches = [ + (fetchpatch { + name = "CVE-2024-22857.patch"; + url = "https://github.com/HardySimpson/zlog/commit/c47f781a9f1e9604f5201e27d046d925d0d48ac4.patch"; + hash = "sha256-3FAAHJ2R/OpNpErWXptjEh0x370/jzvK2VhuUuyaOjE="; + }) + ]; + makeFlags = [ "PREFIX=${placeholder "out"}" ]; meta = with lib; { From 9e6fcb4231afeb1351f6b79f6778fbe0e790d57d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 10:36:13 +0000 Subject: [PATCH 099/186] act: 0.2.59 -> 0.2.60 --- pkgs/development/tools/misc/act/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/act/default.nix b/pkgs/development/tools/misc/act/default.nix index c620ca1649f0..23b9c24fe95c 100644 --- a/pkgs/development/tools/misc/act/default.nix +++ b/pkgs/development/tools/misc/act/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "act"; - version = "0.2.59"; + version = "0.2.60"; src = fetchFromGitHub { owner = "nektos"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-Y8g+eVZ0c0YPVL8E/JAqD6EheQX6sBHpw1tT88BkbtI="; + hash = "sha256-FFSnxxqKAFYPuX4NJahiBS65Goj6se2U5WdPiKpNXDo="; }; - vendorHash = "sha256-0Sjj9+YJcIkigvJOXxtDVcUylZmVY/Xv/IYpEBN46Is="; + vendorHash = "sha256-FLomnHVhpvbM+O3OGwjXfrtTVbegnzry8Sl+4a3uw08="; doCheck = false; From 1176c409475fd4daa6c805244bdea3d182343621 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:02:35 +0100 Subject: [PATCH 100/186] cfripper: 1.15.4 -> 1.15.5 Diff: https://github.com/Skyscanner/cfripper/compare/refs/tags/v1.15.4...v1.15.5 Changelog: https://github.com/Skyscanner/cfripper/releases/tag/v1.15.5 --- pkgs/tools/security/cfripper/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/security/cfripper/default.nix b/pkgs/tools/security/cfripper/default.nix index aac55cf46b74..0145fcbb3a12 100644 --- a/pkgs/tools/security/cfripper/default.nix +++ b/pkgs/tools/security/cfripper/default.nix @@ -12,23 +12,24 @@ let }; in python.pkgs.buildPythonApplication rec { pname = "cfripper"; - version = "1.15.4"; + version = "1.15.5"; pyproject = true; src = fetchFromGitHub { owner = "Skyscanner"; repo = "cfripper"; rev = "refs/tags/v${version}"; - hash = "sha256-heVFum+Eaofd9L0dNHqD9GgHP+ckGwJi+NfeFci+ESc="; + hash = "sha256-kT6cWVeP2mKKef/fBfzZWnkJsWqJp2X9uIkndR+gwoY="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "pluggy~=0.13.1" "pluggy" \ - ''; + pythonRelaxDeps = [ + "pluggy" + ]; nativeBuildInputs = with python.pkgs; [ + pythonRelaxDepsHook setuptools + setuptools-scm ]; propagatedBuildInputs = with python.pkgs; [ From 2117918926b780c4e338843faa8011fffb58a199 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:04:23 +0100 Subject: [PATCH 101/186] exploitdb: 2024-02-27 -> 2024-03-01 Diff: https://gitlab.com/exploit-database/exploitdb/-/compare/refs/tags/2024-02-27...2024-03-01 --- pkgs/tools/security/exploitdb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/exploitdb/default.nix b/pkgs/tools/security/exploitdb/default.nix index 6e7a553cf167..96d6408f4a46 100644 --- a/pkgs/tools/security/exploitdb/default.nix +++ b/pkgs/tools/security/exploitdb/default.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "exploitdb"; - version = "2024-02-27"; + version = "2024-03-01"; src = fetchFromGitLab { owner = "exploit-database"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-bFCh1kNm7D71PoRoSHdm1qYGGNvYnEb9cLbZerVy5vw="; + hash = "sha256-6kBirGsaDfUgp/NiUa17SE+Cq8dmH9v3uuBooFMnMM0="; }; nativeBuildInputs = [ From 3d572bc1cf5a1a0a2a6991b71d3e4f84ddd9feb7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:05:34 +0100 Subject: [PATCH 102/186] ldeep: 1.0.52 -> 1.0.53 Diff: https://github.com/franc-pentest/ldeep/compare/refs/tags/1.0.52...1.0.53 Changelog: https://github.com/franc-pentest/ldeep/releases/tag/1.0.53 --- pkgs/tools/security/ldeep/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/ldeep/default.nix b/pkgs/tools/security/ldeep/default.nix index 6e44829f7ee9..ddbff2357271 100644 --- a/pkgs/tools/security/ldeep/default.nix +++ b/pkgs/tools/security/ldeep/default.nix @@ -5,14 +5,14 @@ python3.pkgs.buildPythonApplication rec { pname = "ldeep"; - version = "1.0.52"; + version = "1.0.53"; pyproject = true; src = fetchFromGitHub { owner = "franc-pentest"; repo = "ldeep"; rev = "refs/tags/${version}"; - hash = "sha256-I51vz3zF1J3223hcO3cdfsNBfpq/UolDxUEXyqx3dLI="; + hash = "sha256-67jVpzvdjEcjFmTRE2YjPr4AO1iN+PakwoKcjvimt8g="; }; pythonRelaxDeps = [ From 34a09a1444d24d3759f6d198162adba2f30b081a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:06:39 +0100 Subject: [PATCH 103/186] pip-audit: 2.7.1 -> 2.7.2 Diff: https://github.com/trailofbits/pip-audit/compare/refs/tags/v2.7.1...v2.7.2 Changelog: https://github.com/pypa/pip-audit/releases/tag/v2.7.2 --- pkgs/development/tools/pip-audit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/pip-audit/default.nix b/pkgs/development/tools/pip-audit/default.nix index 3b9ea3b2fd8b..9ff8f51b672d 100644 --- a/pkgs/development/tools/pip-audit/default.nix +++ b/pkgs/development/tools/pip-audit/default.nix @@ -5,14 +5,14 @@ python3.pkgs.buildPythonApplication rec { pname = "pip-audit"; - version = "2.7.1"; + version = "2.7.2"; format = "pyproject"; src = fetchFromGitHub { owner = "trailofbits"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-3OqF4xgRWzX4m4WW2B+cUuHJpNzf2L033ZXwGH0K4b0="; + hash = "sha256-IlIPLuHGmnmt6FgX+Psw+f6XpkuhP+BZ+e4k4DV8e/U="; }; nativeBuildInputs = with python3.pkgs; [ From e6462a706534963c3cfa089ddfffc460978e5334 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:11:45 +0100 Subject: [PATCH 104/186] knockpy: 6.1.0 -> 7.0.0 Diff: https://github.com/guelfoweb/knock/compare/refs/tags/6.1.0...7.0.0 Changelog: https://github.com/guelfoweb/knock/releases/tag/7.0.0 --- pkgs/tools/security/knockpy/default.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/security/knockpy/default.nix b/pkgs/tools/security/knockpy/default.nix index a3342e0b3809..5b68560c1fa3 100644 --- a/pkgs/tools/security/knockpy/default.nix +++ b/pkgs/tools/security/knockpy/default.nix @@ -5,30 +5,39 @@ python3.pkgs.buildPythonApplication rec { pname = "knockpy"; - version = "6.1.0"; - format = "setuptools"; + version = "7.0.0"; + pyproject = true; src = fetchFromGitHub { owner = "guelfoweb"; repo = "knock"; rev = "refs/tags/${version}"; - hash = "sha256-O4tXq4pDzuTBEGAls2I9bfBRdHssF4rFBec4OtfUx6A="; + hash = "sha256-Xtv7K19OBS2iHFFoSasNcy9VLL15eQ8AD79wAEhxCHk="; }; + pythonRelaxDeps = [ + "beautifulsoup4" + "tqdm" + ]; + + nativeBuildInputs = with python3.pkgs; [ + pythonRelaxDepsHook + setuptools + ]; + propagatedBuildInputs = with python3.pkgs; [ beautifulsoup4 - colorama - matplotlib - networkx - pyqt5 + dnspython + pyopenssl requests + tqdm ]; # Project has no tests doCheck = false; pythonImportsCheck = [ - "knockpy" + "knock" ]; meta = with lib; { From 99de4922b00599bdde58a5117518943c431e5563 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:13:03 +0100 Subject: [PATCH 105/186] python311Packages.cyclonedx-python-lib: 6.4.1 -> 6.4.2 Diff: https://github.com/CycloneDX/cyclonedx-python-lib/compare/refs/tags/v6.4.1...v6.4.2 Changelog: https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v6.4.2 --- .../python-modules/cyclonedx-python-lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix index 6d5aa4032c2d..c2e8eb3a48d5 100644 --- a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix +++ b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { pname = "cyclonedx-python-lib"; - version = "6.4.1"; + version = "6.4.2"; pyproject = true; disabled = pythonOlder "3.9"; @@ -32,7 +32,7 @@ buildPythonPackage rec { owner = "CycloneDX"; repo = "cyclonedx-python-lib"; rev = "refs/tags/v${version}"; - hash = "sha256-IhiH1Vk/Wf6cTxijxE1erkQozY+vOVd5pu6tAVUoDJM="; + hash = "sha256-uDppmYJiQt2Yix5vaWYqMDbPcHOEPz2pBK11lUZ54fI="; }; nativeBuildInputs = [ From 42224372f0d761a0eca94fb92f9332ffb0d11b73 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:14:20 +0100 Subject: [PATCH 106/186] python311Packages.py-serializable: 1.0.1 -> 1.0.2 Diff: https://github.com/madpah/serializable/compare/refs/tags/v1.0.1...v1.0.2 Changelog: https://github.com/madpah/serializable/blob/v1.0.2/CHANGELOG.md --- pkgs/development/python-modules/py-serializable/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/py-serializable/default.nix b/pkgs/development/python-modules/py-serializable/default.nix index 0954993ccd1f..2834aeaf53d9 100644 --- a/pkgs/development/python-modules/py-serializable/default.nix +++ b/pkgs/development/python-modules/py-serializable/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "py-serializable"; - version = "1.0.1"; + version = "1.0.2"; pyproject = true; disabled = pythonOlder "3.8"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "madpah"; repo = "serializable"; rev = "refs/tags/v${version}"; - hash = "sha256-OsgFzT5qGyszO4jFYWIAgGY41s0ZBEMwCbWZeY189h4="; + hash = "sha256-RhipoPTewPaYwspTnywLr5FvFVUaFixfRQk6aUMvB4w="; }; nativeBuildInputs = [ From 9001dd95213dc2dd527d81e68f76a0aaaadf2ce7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:14:50 +0100 Subject: [PATCH 107/186] python311Packages.pyoverkiz: 1.13.7 -> 1.13.8 Diff: https://github.com/iMicknl/python-overkiz-api/compare/refs/tags/v1.13.7...v1.13.8 Changelog: https://github.com/iMicknl/python-overkiz-api/releases/tag/v1.13.8 --- pkgs/development/python-modules/pyoverkiz/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyoverkiz/default.nix b/pkgs/development/python-modules/pyoverkiz/default.nix index 86bcf10bcf3d..bf1efac9de74 100644 --- a/pkgs/development/python-modules/pyoverkiz/default.nix +++ b/pkgs/development/python-modules/pyoverkiz/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "pyoverkiz"; - version = "1.13.7"; + version = "1.13.8"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -25,7 +25,7 @@ buildPythonPackage rec { owner = "iMicknl"; repo = "python-overkiz-api"; rev = "refs/tags/v${version}"; - hash = "sha256-wH4LCfjnxAwub/BCe27osyJVUZSOMDjjxItv0aEa8Ic="; + hash = "sha256-tvS7aPfBTs75Rq1WGslWDMv1pOTVt7MtwpXPRJtqbuk="; }; postPatch = '' From 6c278a718c4f17d95cdbe483a5daed11c2d1d03f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:15:43 +0100 Subject: [PATCH 108/186] python311Packages.types-awscrt: 0.20.4 -> 0.20.5 Changelog: https://github.com/youtype/types-awscrt/releases/tag/0.20.5 --- pkgs/development/python-modules/types-awscrt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/types-awscrt/default.nix b/pkgs/development/python-modules/types-awscrt/default.nix index ad5041ddea67..7b0e42df6d5a 100644 --- a/pkgs/development/python-modules/types-awscrt/default.nix +++ b/pkgs/development/python-modules/types-awscrt/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "types-awscrt"; - version = "0.20.4"; + version = "0.20.5"; pyproject = true; disabled = pythonOlder "3.7"; @@ -15,7 +15,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "types_awscrt"; inherit version; - hash = "sha256-ECRVcMcoXpSTYrSucQxUvyhdZKJ0U9QnYkd7zuXNd6M="; + hash = "sha256-YYEbv03pUkiTn5J2pDS+k9K5X2zP6KqU5WmZ6XeM/MI="; }; nativeBuildInputs = [ From 9547597b5437cb24675877f057c1c5c01890cfcf Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:16:29 +0100 Subject: [PATCH 109/186] python311Packages.weconnect: 0.60.1 -> 0.60.2 Diff: https://github.com/tillsteinbach/WeConnect-python/compare/refs/tags/v0.60.1...v0.60.2 Changelog: https://github.com/tillsteinbach/WeConnect-python/releases/tag/v0.60.2 --- pkgs/development/python-modules/weconnect/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/weconnect/default.nix b/pkgs/development/python-modules/weconnect/default.nix index df6a1529e929..096e41b89bcc 100644 --- a/pkgs/development/python-modules/weconnect/default.nix +++ b/pkgs/development/python-modules/weconnect/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "weconnect"; - version = "0.60.1"; + version = "0.60.2"; pyproject = true; disabled = pythonOlder "3.8"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "tillsteinbach"; repo = "WeConnect-python"; rev = "refs/tags/v${version}"; - hash = "sha256-hvV4pbCyzAbi3bKXClzpiyhp+4qnuIj5pViUe7pEq64="; + hash = "sha256-VM4qCe+VMnfKXioUHTjOeBSniwpq44fvbN1k1jG6puk="; }; postPatch = '' From 9e03d5d0310511dcbe7ea2a08947470a5c3362b9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:19:38 +0100 Subject: [PATCH 110/186] python311Packages.tencentcloud-sdk-python: 3.0.1094 -> 3.0.1098 Diff: https://github.com/TencentCloud/tencentcloud-sdk-python/compare/refs/tags/3.0.1094...3.0.1098 Changelog: https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3.0.1098/CHANGELOG.md --- .../python-modules/tencentcloud-sdk-python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix index c91dce1a4c59..2dc2ebbf9238 100644 --- a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix +++ b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { pname = "tencentcloud-sdk-python"; - version = "3.0.1094"; + version = "3.0.1098"; pyproject = true; disabled = pythonOlder "3.9"; @@ -18,7 +18,7 @@ buildPythonPackage rec { owner = "TencentCloud"; repo = "tencentcloud-sdk-python"; rev = "refs/tags/${version}"; - hash = "sha256-h2p9auD8bTDbagAmjsmV06Z75I93LB6h+/ZYyt17ow0="; + hash = "sha256-5BG5WizkBP/KYHS00v949uQgiCChR3DWW0MnMXRBDAs="; }; nativeBuildInputs = [ From a25dba4cbda455c79ac7412c9f78215609bef182 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:21:05 +0100 Subject: [PATCH 111/186] python311Packages.aioairzone-cloud: 0.3.8 -> 0.4.5 Diff: https://github.com/Noltari/aioairzone-cloud/compare/refs/tags/0.3.8...0.4.5 Changelog: https://github.com/Noltari/aioairzone-cloud/releases/tag/0.4.5 --- pkgs/development/python-modules/aioairzone-cloud/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aioairzone-cloud/default.nix b/pkgs/development/python-modules/aioairzone-cloud/default.nix index dab1e05180f9..694f1ca73335 100644 --- a/pkgs/development/python-modules/aioairzone-cloud/default.nix +++ b/pkgs/development/python-modules/aioairzone-cloud/default.nix @@ -8,7 +8,7 @@ buildPythonPackage rec { pname = "aioairzone-cloud"; - version = "0.3.8"; + version = "0.4.5"; pyproject = true; disabled = pythonOlder "3.7"; @@ -17,7 +17,7 @@ buildPythonPackage rec { owner = "Noltari"; repo = "aioairzone-cloud"; rev = "refs/tags/${version}"; - hash = "sha256-h9WUHehTXg73qqpw+sMxoQMzOV+io2GvjwXlr4gF2ns="; + hash = "sha256-G+tzA4VEdpRFVouj8Uv7BJLgSTOO5eKkNntVL1bIzXY="; }; nativeBuildInputs = [ From 6d1747e8e67b7124bf2b2bc021f53608d254972f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:22:06 +0100 Subject: [PATCH 112/186] python311Packages.aioautomower: 2024.2.9 -> 2024.2.10 Diff: https://github.com/Thomas55555/aioautomower/compare/refs/tags/2024.2.9...2024.2.10 Changelog: https://github.com/Thomas55555/aioautomower/releases/tag/2024.2.10 --- pkgs/development/python-modules/aioautomower/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aioautomower/default.nix b/pkgs/development/python-modules/aioautomower/default.nix index 43f8f833703a..486781c4c97d 100644 --- a/pkgs/development/python-modules/aioautomower/default.nix +++ b/pkgs/development/python-modules/aioautomower/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "aioautomower"; - version = "2024.2.9"; + version = "2024.2.10"; pyproject = true; disabled = pythonOlder "3.11"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "Thomas55555"; repo = "aioautomower"; rev = "refs/tags/${version}"; - hash = "sha256-vjg7y+9E4R1Q7h+ao/ttuRbvui4u5hESR8tImWSO04U="; + hash = "sha256-NRcLyuU5FFIKJALUrx5iVSihzgO6ljqaqlhbs+y2E4Q="; }; postPatch = '' From 42cc9e42cb33d1ed822299a5472d1fdc1608cac3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:22:45 +0100 Subject: [PATCH 113/186] python311Packages.aiomysensors: 0.3.12 -> 0.3.13 Diff: https://github.com/MartinHjelmare/aiomysensors/compare/refs/tags/v0.3.12...v0.3.13 Changelog: https://github.com/MartinHjelmare/aiomysensors/releases/tag/v0.3.13 --- pkgs/development/python-modules/aiomysensors/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiomysensors/default.nix b/pkgs/development/python-modules/aiomysensors/default.nix index 15c71c5cba68..404a9c2c3a77 100644 --- a/pkgs/development/python-modules/aiomysensors/default.nix +++ b/pkgs/development/python-modules/aiomysensors/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "aiomysensors"; - version = "0.3.12"; + version = "0.3.13"; pyproject = true; disabled = pythonOlder "3.9"; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "MartinHjelmare"; repo = "aiomysensors"; rev = "refs/tags/v${version}"; - hash = "sha256-9M5WuBoezbZr7OwJaM0m2CqibziJVwqANGOhiJrqfxA="; + hash = "sha256-2i2QodEWOZ/nih6ap5ovWuKxILB5arusnqOiOlb4xWM="; }; postPatch = '' From 02f0c7af80e39ae5e55a72be66fd47bca81059e3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:26:17 +0100 Subject: [PATCH 114/186] python311Packages.boto3-stubs: 1.34.52 -> 1.34.53 --- pkgs/development/python-modules/boto3-stubs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/boto3-stubs/default.nix b/pkgs/development/python-modules/boto3-stubs/default.nix index 371497c895fb..5a425a342b63 100644 --- a/pkgs/development/python-modules/boto3-stubs/default.nix +++ b/pkgs/development/python-modules/boto3-stubs/default.nix @@ -365,14 +365,14 @@ buildPythonPackage rec { pname = "boto3-stubs"; - version = "1.34.52"; + version = "1.34.53"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-gjxBBZ+DbWh32qocvSD4E8jxp4uf3ykLwLhTEn4Se6M="; + hash = "sha256-/zGbNI+nsNbkD2hTeClyZvk5A4wG0E4JGKpazy5TLCw="; }; nativeBuildInputs = [ From bc78ba4618e0356cbf29bc20a4cd1bd52f860947 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 12:26:37 +0100 Subject: [PATCH 115/186] python311Packages.botocore-stubs: 1.34.52 -> 1.34.53 --- pkgs/development/python-modules/botocore-stubs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/botocore-stubs/default.nix b/pkgs/development/python-modules/botocore-stubs/default.nix index 808deb064ad8..4f12ba1530fd 100644 --- a/pkgs/development/python-modules/botocore-stubs/default.nix +++ b/pkgs/development/python-modules/botocore-stubs/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { pname = "botocore-stubs"; - version = "1.34.52"; + version = "1.34.53"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -17,7 +17,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "botocore_stubs"; inherit version; - hash = "sha256-pRtsofyprNqp6AQS83FTaQ//rX7SJ3Q8xTCAmSDSoAk="; + hash = "sha256-41fme2SpxtfeEOdmzSxmWJJkJXRG26bl7hwt/Ltjvlw="; }; nativeBuildInputs = [ From e33e623d727d11abb1e2fad5e811db4fed01f4c9 Mon Sep 17 00:00:00 2001 From: kilianar Date: Fri, 1 Mar 2024 12:36:24 +0100 Subject: [PATCH 116/186] calibre: 7.5.1 -> 7.6.0 https://github.com/kovidgoyal/calibre/releases/tag/v7.6.0 --- pkgs/applications/misc/calibre/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index a0966e5555b3..6003212d16b5 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -32,11 +32,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "calibre"; - version = "7.5.1"; + version = "7.6.0"; src = fetchurl { url = "https://download.calibre-ebook.com/${finalAttrs.version}/calibre-${finalAttrs.version}.tar.xz"; - hash = "sha256-pGo9fWyeX5hpw5YOV05tWy/0YxHShStKN96LMPnqIiA="; + hash = "sha256-fD2kTwH692x6Nm93NrUQvmbcXiX9hHBpo4wvUvBqLAM="; }; patches = [ From dfe7aace8b820b9150fe1d7ac9fa57151f186a34 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 11:36:47 +0000 Subject: [PATCH 117/186] python311Packages.python-ironicclient: 5.4.0 -> 5.5.0 --- .../python-modules/python-ironicclient/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-ironicclient/default.nix b/pkgs/development/python-modules/python-ironicclient/default.nix index 10af09c06720..5839498bbe96 100644 --- a/pkgs/development/python-modules/python-ironicclient/default.nix +++ b/pkgs/development/python-modules/python-ironicclient/default.nix @@ -20,12 +20,12 @@ buildPythonPackage rec { pname = "python-ironicclient"; - version = "5.4.0"; + version = "5.5.0"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-Q9yGuYf9TS7RCo9aV1hnNSrHoll7AOUiSpzRYxi+JXU="; + hash = "sha256-JlO487QSPsBJZqPYRhsQYFA7noIN2q/stH4eZXAFLnY="; }; propagatedBuildInputs = [ From 3635ded162ea60708d5adb811e4cdd34fdb397d5 Mon Sep 17 00:00:00 2001 From: Sebastien Iooss Date: Fri, 1 Mar 2024 12:37:13 +0100 Subject: [PATCH 118/186] python312Packages.aiounittest: fix tests by moving to pynose --- pkgs/development/python-modules/aiounittest/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/aiounittest/default.nix b/pkgs/development/python-modules/aiounittest/default.nix index 045613837902..1c97a430503a 100644 --- a/pkgs/development/python-modules/aiounittest/default.nix +++ b/pkgs/development/python-modules/aiounittest/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , pythonAtLeast , setuptools -, nose +, pynose , coverage , wrapt }: @@ -13,9 +13,6 @@ buildPythonPackage rec { version = "1.4.2"; pyproject = true; - # requires the imp module - disabled = pythonAtLeast "3.12"; - src = fetchFromGitHub { owner = "kwarunek"; repo = pname; @@ -32,12 +29,12 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - nose + pynose coverage ]; checkPhase = '' - nosetests + nosetests -e test_specific_test ''; pythonImportsCheck = [ "aiounittest" ]; From ce373e1dadf2682fc944f974993c55ba3b0c49a9 Mon Sep 17 00:00:00 2001 From: Sebastien Iooss Date: Fri, 1 Mar 2024 12:04:21 +0100 Subject: [PATCH 119/186] python312Packages.uncertainties: fix test by moving from nose to pynose --- .../python-modules/uncertainties/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/uncertainties/default.nix b/pkgs/development/python-modules/uncertainties/default.nix index 8299effe6f5e..827a21c811b7 100644 --- a/pkgs/development/python-modules/uncertainties/default.nix +++ b/pkgs/development/python-modules/uncertainties/default.nix @@ -1,5 +1,9 @@ -{ lib, fetchPypi, buildPythonPackage -, nose, numpy, future +{ lib +, buildPythonPackage +, fetchPypi +, future +, numpy +, pynose }: buildPythonPackage rec { @@ -13,10 +17,10 @@ buildPythonPackage rec { }; propagatedBuildInputs = [ future ]; - nativeCheckInputs = [ nose numpy ]; + nativeCheckInputs = [ pynose numpy ]; checkPhase = '' - nosetests -sv + nosetests -sve test_1to2 ''; meta = with lib; { From 0e0e32e14df39515d27d3968b4092a2613a4b900 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 11:39:39 +0000 Subject: [PATCH 120/186] python311Packages.python-swiftclient: 4.4.0 -> 4.5.0 --- .../development/python-modules/python-swiftclient/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-swiftclient/default.nix b/pkgs/development/python-modules/python-swiftclient/default.nix index e34bad425b3c..8c0239e2bc50 100644 --- a/pkgs/development/python-modules/python-swiftclient/default.nix +++ b/pkgs/development/python-modules/python-swiftclient/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "python-swiftclient"; - version = "4.4.0"; + version = "4.5.0"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-p32Xqw5AEsZ4cy5XW9/u0oKzSJuRdegsRqR6yEke7oQ="; + hash = "sha256-8qCIflo5KXq8BDJRrj+QiRTOFEei+NLcpWcWGGCBQr0="; }; # remove duplicate script that will be created by setuptools from the From 034299c4a4a23cac2e5715f81863231ad615f5bb Mon Sep 17 00:00:00 2001 From: kilianar Date: Fri, 1 Mar 2024 12:45:57 +0100 Subject: [PATCH 121/186] logseq: 0.10.6 -> 0.10.7 https://github.com/logseq/logseq/releases/tag/0.10.7 --- pkgs/applications/misc/logseq/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/logseq/default.nix b/pkgs/applications/misc/logseq/default.nix index ed4a07ec97ae..27aeca89be60 100644 --- a/pkgs/applications/misc/logseq/default.nix +++ b/pkgs/applications/misc/logseq/default.nix @@ -14,11 +14,11 @@ stdenv.mkDerivation (finalAttrs: let in { pname = "logseq"; - version = "0.10.6"; + version = "0.10.7"; src = fetchurl { url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-linux-x64-${version}.AppImage"; - hash = "sha256-OUQh+6HRnzxw8Nn/OkU+DkjPKWKpMN0xchD1vPU3KV8="; + hash = "sha256-EC83D7tSpoDV6h363yIdX9IrTfoMd4b0hTVdW1T0pXg="; name = "${pname}-${version}.AppImage"; }; From 4217f7f66caebcd4fa3283f3d7a0b1604bb446e1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 11:46:10 +0000 Subject: [PATCH 122/186] asnmap: 1.0.6 -> 1.1.0 --- pkgs/tools/security/asnmap/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/asnmap/default.nix b/pkgs/tools/security/asnmap/default.nix index 44f2e09fc1a9..e1d4d5b6b0bd 100644 --- a/pkgs/tools/security/asnmap/default.nix +++ b/pkgs/tools/security/asnmap/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "asnmap"; - version = "1.0.6"; + version = "1.1.0"; src = fetchFromGitHub { owner = "projectdiscovery"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-uX7mf1y30JngRI4UJYzghk2F4DZh9OQAjgkkNRbAgwc="; + hash = "sha256-Of4IVra6kMHY9btWcF9grM/r3lTWFP/geeT309Seasw="; }; - vendorHash = "sha256-co18Q8nfRjJyDfpmJ1YSJ275DJRJHn2AR3jF8WionNY="; + vendorHash = "sha256-RDv8vkBI3miyeNAbhUsMpuZCYRUZ0ATfXYHxaTgTVfA="; # Tests require network access doCheck = false; From 72e569f1f2c1bc89bf37e36796d60db3eceb1096 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 11:51:30 +0000 Subject: [PATCH 123/186] python311Packages.python-heatclient: 3.4.0 -> 3.5.0 --- pkgs/development/python-modules/python-heatclient/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-heatclient/default.nix b/pkgs/development/python-modules/python-heatclient/default.nix index 2af9483dd264..2319ecda0bfe 100644 --- a/pkgs/development/python-modules/python-heatclient/default.nix +++ b/pkgs/development/python-modules/python-heatclient/default.nix @@ -21,14 +21,14 @@ buildPythonPackage rec { pname = "python-heatclient"; - version = "3.4.0"; + version = "3.5.0"; format = "setuptools"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-ggfhDJW2qn0o4Wi5cdPsEpoHb9miZbr4Ba8mgLkStvI="; + hash = "sha256-B1F40HYHFF91mkxwySR/kqCvlwLLtBgqwUvw2byOc9g="; }; propagatedBuildInputs = [ From b75a29cb6ca9b5d2e4823622be84d10a6b2e299f Mon Sep 17 00:00:00 2001 From: Arian van Putten Date: Fri, 1 Mar 2024 12:52:48 +0100 Subject: [PATCH 124/186] nixos/lib/make-disk-image.nix: fix systemd-boot-builder clobbering /homeless-shelter systemd-boot-builder.py calls nix-env --list-generations which creates $HOME/.nix-defexpr/channels/nixos if it doesn't exist. This would cause a folder /homeless-shelter to show up in the final image which in turn breaks nix builds in the target image if sandboxing is turned off (as /homeless-shelter is never allowed to exist). --- nixos/lib/make-disk-image.nix | 7 +++++++ nixos/tests/qemu-vm-external-disk-image.nix | 3 +++ 2 files changed, 10 insertions(+) diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index da94ef16654c..9bdbf4e0713d 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -609,6 +609,13 @@ let format' = format; in let ''} # Set up core system link, bootloader (sd-boot, GRUB, uboot, etc.), etc. + + # NOTE: systemd-boot-builder.py calls nix-env --list-generations which + # clobbers $HOME/.nix-defexpr/channels/nixos This would cause a folder + # /homeless-shelter to show up in the final image which in turn breaks + # nix builds in the target image if sandboxing is turned off (through + # __noChroot for example). + export HOME=$TMPDIR NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root $mountPoint -- /nix/var/nix/profiles/system/bin/switch-to-configuration boot # The above scripts will generate a random machine-id and we don't want to bake a single ID into all our images diff --git a/nixos/tests/qemu-vm-external-disk-image.nix b/nixos/tests/qemu-vm-external-disk-image.nix index a229fc5e3963..c481159511a0 100644 --- a/nixos/tests/qemu-vm-external-disk-image.nix +++ b/nixos/tests/qemu-vm-external-disk-image.nix @@ -69,5 +69,8 @@ in os.environ['NIX_DISK_IMAGE'] = tmp_disk_image.name machine.succeed("findmnt --kernel --source ${rootFsDevice} --target /") + + # Make sure systemd boot didn't clobber this + machine.succeed("[ ! -e /homeless-shelter ]") ''; } From e4387fdefaa9babc088128c07927f0097b0f835b Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 25 Feb 2024 22:42:57 +0000 Subject: [PATCH 125/186] diffoscope: 257 -> 259 Changes: - https://diffoscope.org/news/diffoscope-258-released/ - https://diffoscope.org/news/diffoscope-259-released/ --- pkgs/tools/misc/diffoscope/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 625f86c1da47..5bac5602c79f 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -79,11 +79,11 @@ # Note: when upgrading this package, please run the list-missing-tools.sh script as described below! python3.pkgs.buildPythonApplication rec { pname = "diffoscope"; - version = "257"; + version = "259"; src = fetchurl { url = "https://diffoscope.org/archive/diffoscope-${version}.tar.bz2"; - hash = "sha256-Fejp4i0uzsK9+9JBVPsE1AdDwshtRlxpxPfJdqRQQH4="; + hash = "sha256-WYgFWM6HKFt3xVcRNytQPWOf3ZpH1cG7Cghhu/AES80="; }; outputs = [ From d6804e012cea9abd6604166631d2d8cd0819a8f0 Mon Sep 17 00:00:00 2001 From: Rafael Mazzutti Date: Thu, 29 Feb 2024 15:35:10 -0300 Subject: [PATCH 126/186] kdePackages.oxygen: fix build --- pkgs/kde/plasma/oxygen/default.nix | 51 ++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/pkgs/kde/plasma/oxygen/default.nix b/pkgs/kde/plasma/oxygen/default.nix index 5b5de64af90f..718a9737a8e1 100644 --- a/pkgs/kde/plasma/oxygen/default.nix +++ b/pkgs/kde/plasma/oxygen/default.nix @@ -1,6 +1,51 @@ -{mkKdeDerivation}: +{ + mkKdeDerivation, + qtbase, + libsForQt5, +}: mkKdeDerivation { pname = "oxygen"; - # FIXME(qt5) - meta.broken = true; + + outputs = ["out" "dev" "qt5"]; + + # We can't add qt5 stuff to dependencies or the hooks blow up, + # so manually point everything to everything. Oof. + extraCmakeFlags = [ + "-DQt5_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5" + "-DQt5Core_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5Core" + "-DQt5DBus_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5DBus" + "-DQt5Gui_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5Gui" + "-DQt5Network_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5Network" + "-DQt5Qml_DIR=${libsForQt5.qtdeclarative.dev}/lib/cmake/Qt5Qml" + "-DQt5QmlModels_DIR=${libsForQt5.qtdeclarative.dev}/lib/cmake/Qt5QmlModels" + "-DQt5Quick_DIR=${libsForQt5.qtdeclarative.dev}/lib/cmake/Qt5Quick" + "-DQt5Widgets_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5Widgets" + "-DQt5X11Extras_DIR=${libsForQt5.qtx11extras.dev}/lib/cmake/Qt5X11Extras" + "-DQt5Xml_DIR=${libsForQt5.qtbase.dev}/lib/cmake/Qt5Xml" + + "-DKF5Auth_DIR=${libsForQt5.kauth.dev}/lib/cmake/KF5Auth" + "-DKF5Codecs_DIR=${libsForQt5.kcodecs.dev}/lib/cmake/KF5Codecs" + "-DKF5Config_DIR=${libsForQt5.kconfig.dev}/lib/cmake/KF5Config" + "-DKF5ConfigWidgets_DIR=${libsForQt5.kconfigwidgets.dev}/lib/cmake/KF5ConfigWidgets" + "-DKF5Completion_DIR=${libsForQt5.kcompletion.dev}/lib/cmake/KF5Completion" + "-DKF5CoreAddons_DIR=${libsForQt5.kcoreaddons.dev}/lib/cmake/KF5CoreAddons" + "-DKF5FrameworkIntegration_DIR=${libsForQt5.frameworkintegration.dev}/lib/cmake/KF5FrameworkIntegration" + "-DKF5GuiAddons_DIR=${libsForQt5.kguiaddons.dev}/lib/cmake/KF5GuiAddons" + "-DKF5IconThemes_DIR=${libsForQt5.kiconthemes.dev}/lib/cmake/KF5IconThemes" + "-DKF5I18n_DIR=${libsForQt5.ki18n.dev}/lib/cmake/KF5I18n" + "-DKF5Kirigami2_DIR=${libsForQt5.kirigami2.dev}/lib/cmake/KF5Kirigami2" + "-DKF5Service_DIR=${libsForQt5.kservice.dev}/lib/cmake/KF5Service" + "-DKF5WidgetsAddons_DIR=${libsForQt5.kwidgetsaddons.dev}/lib/cmake/KF5WidgetsAddons" + "-DKF5WindowSystem_DIR=${libsForQt5.kwindowsystem.dev}/lib/cmake/KF5WindowSystem" + ]; + + # Move Qt5 plugin to Qt5 plugin path + postInstall = '' + mkdir -p $qt5/${libsForQt5.qtbase.qtPluginPrefix}/styles + mv $out/${qtbase.qtPluginPrefix}/styles/oxygen5.so $qt5/${libsForQt5.qtbase.qtPluginPrefix}/styles + + moveToOutput bin/oxygen-demo5 $qt5 + moveToOutput 'lib/liboxygenstyle5*' $qt5 + moveToOutput 'lib/liboxygenstyleconfig5*' $qt5 + ''; } From b9a5d3fab6118c7a1e6598741706eb1e5cc7b9f5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 12:58:54 +0000 Subject: [PATCH 127/186] intel-cmt-cat: 23.11 -> 23.11.1 --- pkgs/os-specific/linux/intel-cmt-cat/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/intel-cmt-cat/default.nix b/pkgs/os-specific/linux/intel-cmt-cat/default.nix index 62e6149b6f13..71f7735996ad 100644 --- a/pkgs/os-specific/linux/intel-cmt-cat/default.nix +++ b/pkgs/os-specific/linux/intel-cmt-cat/default.nix @@ -1,14 +1,14 @@ { lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { - version = "23.11"; + version = "23.11.1"; pname = "intel-cmt-cat"; src = fetchFromGitHub { owner = "intel"; repo = "intel-cmt-cat"; rev = "v${version}"; - sha256 = "sha256-/OSU/7QR8NAjcAIo+unVQfORvCH5VpjfRn5sIrCxwbE="; + sha256 = "sha256-cBsbXua3uOqzElkLcLrOnNXXukGn5zRF8ytWa9VzGdE="; }; enableParallelBuilding = true; From 299251e8d4bf4469f99842049f7a952dc2425d48 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 12:10:56 +0300 Subject: [PATCH 128/186] kdePackages.akonadi: restore mysql backend I guess we're stuck with it for the time being. --- pkgs/kde/gear/akonadi/default.nix | 13 +++++++++++-- .../akonadi/ignore-mysql-config-timestamp.patch | 12 ++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 pkgs/kde/gear/akonadi/ignore-mysql-config-timestamp.patch diff --git a/pkgs/kde/gear/akonadi/default.nix b/pkgs/kde/gear/akonadi/default.nix index 20fd1f54b1ec..15d1436e9cb5 100644 --- a/pkgs/kde/gear/akonadi/default.nix +++ b/pkgs/kde/gear/akonadi/default.nix @@ -1,16 +1,25 @@ { + lib, mkKdeDerivation, qttools, accounts-qt, kaccounts-integration, shared-mime-info, xz, + mariadb, }: mkKdeDerivation { pname = "akonadi"; - # FIXME(later): investigate nixpkgs patches + patches = [ + # Always regenerate MySQL config, as the store paths don't have accurate timestamps + ./ignore-mysql-config-timestamp.patch + ]; + + extraCmakeFlags = [ + "-DMYSQLD_SCRIPTS_PATH=${lib.getBin mariadb}/bin" + ]; extraNativeBuildInputs = [qttools shared-mime-info]; - extraBuildInputs = [kaccounts-integration accounts-qt xz]; + extraBuildInputs = [kaccounts-integration accounts-qt xz mariadb]; } diff --git a/pkgs/kde/gear/akonadi/ignore-mysql-config-timestamp.patch b/pkgs/kde/gear/akonadi/ignore-mysql-config-timestamp.patch new file mode 100644 index 000000000000..62f1556bf687 --- /dev/null +++ b/pkgs/kde/gear/akonadi/ignore-mysql-config-timestamp.patch @@ -0,0 +1,12 @@ +--- a/src/server/storage/dbconfigmysql.cpp ++++ b/src/server/storage/dbconfigmysql.cpp +@@ -241,8 +241,7 @@ bool DbConfigMysql::startInternalServer() + bool confUpdate = false; + QFile actualFile(actualConfig); + // update conf only if either global (or local) is newer than actual +- if ((QFileInfo(globalConfig).lastModified() > QFileInfo(actualFile).lastModified()) +- || (QFileInfo(localConfig).lastModified() > QFileInfo(actualFile).lastModified())) { ++ if (true) { + QFile globalFile(globalConfig); + QFile localFile(localConfig); + if (globalFile.open(QFile::ReadOnly) && actualFile.open(QFile::WriteOnly)) { From a190a93d59548fcf8ffa66bb6f6a9a9ea572cd46 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:45 +0300 Subject: [PATCH 129/186] linux_6_7: 6.7.6 -> 6.7.7 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index febf7ff0ba98..a9af1e704254 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -28,7 +28,7 @@ "hash": "sha256:07cv97l5jiakmmv35n0ganvqfr0590b02f3qb617qkx1zg2xhhsf" }, "6.7": { - "version": "6.7.6", - "hash": "sha256:1lrp7pwnxnqyy8c2l4n4nz997039gbnssrfm8ss8kl3h2c7fr2g4" + "version": "6.7.7", + "hash": "sha256:1n8lgf814mfslca51pm3nh4icvv1lb5w5l1sxdkf5nqdax28nsr5" } } From e5adec46da5803ba373beb931923b591099df7c2 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:48 +0300 Subject: [PATCH 130/186] linux_6_6: 6.6.18 -> 6.6.19 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index a9af1e704254..4e92ff3a890c 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -24,8 +24,8 @@ "hash": "sha256:0lp3fc7sqy48vpcl2g0n1bz7i1hp9k0nlz3i1xfh9l056ihzzvl3" }, "6.6": { - "version": "6.6.18", - "hash": "sha256:07cv97l5jiakmmv35n0ganvqfr0590b02f3qb617qkx1zg2xhhsf" + "version": "6.6.19", + "hash": "sha256:16hk8y3pw40hahhpnpxjwhprq6hlblavr45pglpb3d62f9mpwqxm" }, "6.7": { "version": "6.7.7", From dc81b2ea9ec340b6147fad82b35c7a3b742cb75c Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:51 +0300 Subject: [PATCH 131/186] linux_6_1: 6.1.79 -> 6.1.80 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 4e92ff3a890c..6b0606c9f69b 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -4,8 +4,8 @@ "hash": "sha256:03ci53snbv917ccyjdm3xzl2fwijq5da7nkg05dpwb99wrzp8fkd" }, "6.1": { - "version": "6.1.79", - "hash": "sha256:16xkd0hcslqlcf55d4ivzhf1fkhfs5yy0m9arbax8pmm5yi9r97s" + "version": "6.1.80", + "hash": "sha256:0wdnyy7m9kfkl98id0gm6jzp4aa0hfy6gfkb4k4cg1wbpfpcm3jn" }, "5.15": { "version": "5.15.149", From 3a05b894f646905ac4932db2befd02daa29bab2e Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:53 +0300 Subject: [PATCH 132/186] linux_5_15: 5.15.149 -> 5.15.150 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 6b0606c9f69b..213baa4cd44b 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -8,8 +8,8 @@ "hash": "sha256:0wdnyy7m9kfkl98id0gm6jzp4aa0hfy6gfkb4k4cg1wbpfpcm3jn" }, "5.15": { - "version": "5.15.149", - "hash": "sha256:1c01fnaghj55mkgsgddznq1zq4mswsa05rz00kmh1d3y6sd8115x" + "version": "5.15.150", + "hash": "sha256:1m74cwsbjwlamxh8vdg2y9jjzk0h7a40adml2p2wszwf8lmmj1gf" }, "5.10": { "version": "5.10.210", From 26856a40a8c120246d64ac5b93471c142a355efe Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:56 +0300 Subject: [PATCH 133/186] linux_5_10: 5.10.210 -> 5.10.211 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 213baa4cd44b..3a97efe133f3 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -12,8 +12,8 @@ "hash": "sha256:1m74cwsbjwlamxh8vdg2y9jjzk0h7a40adml2p2wszwf8lmmj1gf" }, "5.10": { - "version": "5.10.210", - "hash": "sha256:0vggj3a71awc1w803cdzrnkn88rxr7l1xh9mmdcw9hzxj1d3r9jf" + "version": "5.10.211", + "hash": "sha256:1cir36s369fl6s46x16xnjg0wdlnkipsp2zhz11m9d3z205hly1s" }, "5.4": { "version": "5.4.269", From 01a3cfdf71e3565e78478fc9451850d8230affa3 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:04:59 +0300 Subject: [PATCH 134/186] linux_5_4: 5.4.269 -> 5.4.270 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 3a97efe133f3..327ed3aaf65e 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -16,8 +16,8 @@ "hash": "sha256:1cir36s369fl6s46x16xnjg0wdlnkipsp2zhz11m9d3z205hly1s" }, "5.4": { - "version": "5.4.269", - "hash": "sha256:1kqqm4hpif3jy2ycnb0dfjgzyn18vqhm1i5q7d7rkisks33bwm7z" + "version": "5.4.270", + "hash": "sha256:0svnkpivv5w9b2yyg0z607b84f591d401gxvr8s7kmzdxadhcjqs" }, "4.19": { "version": "4.19.307", From 72f4920f2f4e250c6fcc4d946467995f47f45d46 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:05:01 +0300 Subject: [PATCH 135/186] linux_4_19: 4.19.307 -> 4.19.308 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 327ed3aaf65e..cc31c41e6973 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -20,8 +20,8 @@ "hash": "sha256:0svnkpivv5w9b2yyg0z607b84f591d401gxvr8s7kmzdxadhcjqs" }, "4.19": { - "version": "4.19.307", - "hash": "sha256:0lp3fc7sqy48vpcl2g0n1bz7i1hp9k0nlz3i1xfh9l056ihzzvl3" + "version": "4.19.308", + "hash": "sha256:1j81zdx75m48rvqacw4xlcb13vkvlx0pfq4kdfxrsdfl7wfcwl9a" }, "6.6": { "version": "6.6.19", From 39f3ac14a4ac25ddb6a3778bea9b9b903ea0e097 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:06:02 +0300 Subject: [PATCH 136/186] linux-rt_6_1: 6.1.77-rt24 -> 6.1.79-rt25 --- pkgs/os-specific/linux/kernel/linux-rt-6.1.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix index 50d2115d9e1f..3d5fe5c1b6be 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "6.1.77-rt24"; # updated by ./update-rt.sh + version = "6.1.79-rt25"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -18,14 +18,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz"; - sha256 = "07grng6rrgpy6c3465hwqhn3gcdam1c8rwya30vgpk8nfxbfqm1v"; + sha256 = "16xkd0hcslqlcf55d4ivzhf1fkhfs5yy0m9arbax8pmm5yi9r97s"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "194fdr89020igfdcfwdrfrl3rn51aannadr5x4yhd7p4cma0iq0a"; + sha256 = "1q851lhbdcxipzxzqkyp6wv4g437kgf8yj24n2x4rkbny9vgz220"; }; }; in [ rt-patch ] ++ kernelPatches; From c60dafe6b735c3da2cbc6c438330d5d5ab0a9d0f Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 1 Mar 2024 16:06:42 +0300 Subject: [PATCH 137/186] linux-rt_6_6: 6.6.15-rt22 -> 6.6.18-rt23 --- pkgs/os-specific/linux/kernel/linux-rt-6.6.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix index b586dc392a6c..097533ea0b3b 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix @@ -6,7 +6,7 @@ , ... } @ args: let - version = "6.6.15-rt22"; # updated by ./update-rt.sh + version = "6.6.18-rt23"; # updated by ./update-rt.sh branch = lib.versions.majorMinor version; kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { @@ -18,14 +18,14 @@ in buildLinux (args // { src = fetchurl { url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz"; - sha256 = "1ajzby6isqji1xlp660m4qj2i2xs003vsjp1jspziwl7hrzhqadb"; + sha256 = "07cv97l5jiakmmv35n0ganvqfr0590b02f3qb617qkx1zg2xhhsf"; }; kernelPatches = let rt-patch = { name = "rt"; patch = fetchurl { url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz"; - sha256 = "0dr4lb6f95vj8vzhlvy353dk6k694f1s6qfxr10m48hzyyqyaxdy"; + sha256 = "03950miwqscgnxa5x8mdx5vyyfv8hjk0g8v24b65vl48sfh8nnv8"; }; }; in [ rt-patch ] ++ kernelPatches; From 64f29a96ad1d91d0d28aa63bb67b488ebfa225f1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Mar 2024 14:08:33 +0100 Subject: [PATCH 138/186] asnmap: refactor --- pkgs/tools/security/asnmap/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/asnmap/default.nix b/pkgs/tools/security/asnmap/default.nix index e1d4d5b6b0bd..984f5340eeeb 100644 --- a/pkgs/tools/security/asnmap/default.nix +++ b/pkgs/tools/security/asnmap/default.nix @@ -9,13 +9,18 @@ buildGoModule rec { src = fetchFromGitHub { owner = "projectdiscovery"; - repo = pname; + repo = "asnmap"; rev = "refs/tags/v${version}"; hash = "sha256-Of4IVra6kMHY9btWcF9grM/r3lTWFP/geeT309Seasw="; }; vendorHash = "sha256-RDv8vkBI3miyeNAbhUsMpuZCYRUZ0ATfXYHxaTgTVfA="; + ldflags = [ + "-w" + "-s" + ]; + # Tests require network access doCheck = false; From 29a1b11f916e5994f7ad23039ae21945df99247c Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 1 Mar 2024 08:20:58 -0500 Subject: [PATCH 139/186] zfs_*: Avoid failing pkgs/by-name migration check See also https://github.com/NixOS/nixpkgs/pull/292214 --- pkgs/top-level/all-packages.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b292d5952e9d..16ed76753c96 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28726,15 +28726,21 @@ with pkgs; zenmonitor = callPackage ../os-specific/linux/zenmonitor { }; - zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix { - configFile = "user"; - }; - zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { - configFile = "user"; - }; - zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { - configFile = "user"; - }; + inherit + ({ + zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix { + configFile = "user"; + }; + zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix { + configFile = "user"; + }; + zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { + configFile = "user"; + }; + }) + zfs_2_1 + zfs_2_2 + zfs_unstable; zfs = zfs_2_2; ### DATA From 131f84fbafa3e7802b2fa662cc675b5e82941674 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 13:39:54 +0000 Subject: [PATCH 140/186] waycheck: 1.1.0 -> 1.1.1 --- pkgs/by-name/wa/waycheck/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/wa/waycheck/package.nix b/pkgs/by-name/wa/waycheck/package.nix index 0dc22a3d50af..cb78db2d6e38 100644 --- a/pkgs/by-name/wa/waycheck/package.nix +++ b/pkgs/by-name/wa/waycheck/package.nix @@ -12,14 +12,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "waycheck"; - version = "1.1.0"; + version = "1.1.1"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "serebit"; repo = "waycheck"; rev = "v${finalAttrs.version}"; - hash = "sha256-y8fuy2ed2yPRiqusMZBD7mzFBDavmdByBzEaI6P5byk="; + hash = "sha256-kwkdTMA15oJHz9AXEkBGeuzYdEUpNuv/xnhzoKOHCE4="; }; nativeBuildInputs = [ From fbef14399697dd5459485671336f169dc658870c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 13:39:57 +0000 Subject: [PATCH 141/186] ttdl: 4.2.0 -> 4.2.1 --- pkgs/applications/misc/ttdl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/ttdl/default.nix b/pkgs/applications/misc/ttdl/default.nix index cc8cb96f91cd..d4a74e6bdbc1 100644 --- a/pkgs/applications/misc/ttdl/default.nix +++ b/pkgs/applications/misc/ttdl/default.nix @@ -5,16 +5,16 @@ rustPlatform.buildRustPackage rec { pname = "ttdl"; - version = "4.2.0"; + version = "4.2.1"; src = fetchFromGitHub { owner = "VladimirMarkelov"; repo = "ttdl"; rev = "v${version}"; - sha256 = "sha256-5OYOF8SvjPn/gZf/utcpv1zVvVbB1HeB1mkMiJtBjOQ="; + sha256 = "sha256-fspqUzF3QqFpd16J1dbcNMdqjcR3PIiRu/s+VB4KgwQ="; }; - cargoHash = "sha256-MLypY7Dbr1/4hJ2UYmNOVp0nNWrq3DDTEidgkL0X0AU="; + cargoHash = "sha256-dvzm9lbVGGM4t6KZcHSlqwo55jssxi8HyFREMaj5I0Q="; meta = with lib; { description = "A CLI tool to manage todo lists in todo.txt format"; From 2b7b9cd91652ddbd96a86258f0d3457c53321706 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 16 Oct 2023 17:23:59 -0400 Subject: [PATCH 142/186] spotifywm: ensure all files are propagated --- pkgs/by-name/sp/spotifywm/package.nix | 46 +++++++++++++++++---------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/sp/spotifywm/package.nix b/pkgs/by-name/sp/spotifywm/package.nix index c2248056834e..b8a7db9a3d39 100644 --- a/pkgs/by-name/sp/spotifywm/package.nix +++ b/pkgs/by-name/sp/spotifywm/package.nix @@ -1,39 +1,51 @@ -{ lib, stdenv, fetchFromGitHub, spotify, xorg, makeWrapper }: +{ + lib, + stdenv, + fetchFromGitHub, + libX11, + lndir, + makeBinaryWrapper, + spotify, +}: stdenv.mkDerivation { - pname = "spotifywm-unstable"; - version = "2022-10-26"; + pname = "spotifywm"; + version = "0-unstable-2022-10-25"; src = fetchFromGitHub { owner = "dasJ"; repo = "spotifywm"; rev = "8624f539549973c124ed18753881045968881745"; - sha256 = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0="; + hash = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0="; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeBinaryWrapper + lndir + ]; - buildInputs = [ xorg.libX11 ]; + buildInputs = [ libX11 ]; installPhase = '' runHook preInstall - mkdir -p $out/{bin,lib} - install -Dm644 spotifywm.so $out/lib/ - ln -sf ${spotify}/bin/spotify $out/bin/spotify + mkdir -p $out - # wrap spotify to use spotifywm.so - wrapProgram $out/bin/spotify --set LD_PRELOAD "$out/lib/spotifywm.so" - # backwards compatibility for people who are using the "spotifywm" binary - ln -sf $out/bin/spotify $out/bin/spotifywm + lndir -silent ${spotify} $out + + install -Dm644 spotifywm.so $out/lib/spotifywm.so + + wrapProgram $out/bin/spotify \ + --suffix LD_PRELOAD : "$out/lib/spotifywm.so" runHook postInstall ''; - meta = with lib; { + meta = { homepage = "https://github.com/dasJ/spotifywm"; description = "Wrapper around Spotify that correctly sets class name before opening the window"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = with maintainers; [ jqueiroz the-argus ]; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ jqueiroz the-argus ]; + mainProgram = "spotify"; }; } From c617c307daee372feca181e44dde5370dcb2a205 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 13:51:28 +0000 Subject: [PATCH 143/186] fishPlugins.forgit: 24.02.0 -> 24.03.0 --- pkgs/shells/fish/plugins/forgit.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/shells/fish/plugins/forgit.nix b/pkgs/shells/fish/plugins/forgit.nix index 253208d47981..d0792d084ea8 100644 --- a/pkgs/shells/fish/plugins/forgit.nix +++ b/pkgs/shells/fish/plugins/forgit.nix @@ -2,13 +2,13 @@ buildFishPlugin rec { pname = "forgit"; - version = "24.02.0"; + version = "24.03.0"; src = fetchFromGitHub { owner = "wfxr"; repo = "forgit"; rev = version; - hash = "sha256-DoOtrnEJwSxkCZtsVek+3w9RZH7j7LTvdleBC88xyfI="; + hash = "sha256-E8zL5HPUHhb3V03yTIF6IQ83bmqrrRt0KHxYbmtzCQ4="; }; postInstall = '' From 2170ed0090d36aa16bfe870f280afac60307c1cb Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 13:51:46 +0000 Subject: [PATCH 144/186] kool: 3.1.0 -> 3.2.0 --- pkgs/development/tools/misc/kool/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/kool/default.nix b/pkgs/development/tools/misc/kool/default.nix index b5a3c5e77035..fc747a476bdc 100644 --- a/pkgs/development/tools/misc/kool/default.nix +++ b/pkgs/development/tools/misc/kool/default.nix @@ -7,13 +7,13 @@ buildGoModule rec { pname = "kool"; - version = "3.1.0"; + version = "3.2.0"; src = fetchFromGitHub { owner = "kool-dev"; repo = "kool"; rev = version; - hash = "sha256-apecHILrtvzD1bAOuyhSokDqBB2UgCavQXOw4dQSPwc="; + hash = "sha256-oMPzDU5MNIgxg7E2lgvgXEfO4W+VrFlLThOC9OEqhWo="; }; vendorHash = "sha256-PmS96KVhe9TDmtYBx2hROLCbGMQ0OY3MN405dUmxPzk="; From 1048982ea126aadd3aee8730813c4e6873360b19 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 13:52:55 +0000 Subject: [PATCH 145/186] eksctl: 0.172.0 -> 0.173.0 --- pkgs/by-name/ek/eksctl/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ek/eksctl/package.nix b/pkgs/by-name/ek/eksctl/package.nix index cce848b16de7..5d01ac999406 100644 --- a/pkgs/by-name/ek/eksctl/package.nix +++ b/pkgs/by-name/ek/eksctl/package.nix @@ -6,16 +6,16 @@ buildGoModule rec { pname = "eksctl"; - version = "0.172.0"; + version = "0.173.0"; src = fetchFromGitHub { owner = "weaveworks"; repo = pname; rev = version; - hash = "sha256-DzbCtTXeoERV9ceUsZ+srATIyviJp+oNyB7EE/iHe6g="; + hash = "sha256-PVBt+AoYd8fMYHzBpgQ261TGlkmyooN7UKX9ooXaRYA="; }; - vendorHash = "sha256-P+T+ynSkG3KEmJsrzJusCPBD1ClaVK/VIHD+2xkGswQ="; + vendorHash = "sha256-5bHZt+Oze7JiaY0dKjoMNDdU6wzMphgZ3W3NveRKGy0="; doCheck = false; From 5870d6ea116ed130013c742f47c3bcb981dc5f70 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 21:59:39 +0800 Subject: [PATCH 146/186] libime: 1.1.5 -> 1.1.6 Diff: https://github.com/fcitx/libime/compare/1.1.5...1.1.6 --- pkgs/development/libraries/libime/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libime/default.nix b/pkgs/development/libraries/libime/default.nix index 5f914485993a..ff9301eb9caf 100644 --- a/pkgs/development/libraries/libime/default.nix +++ b/pkgs/development/libraries/libime/default.nix @@ -29,13 +29,13 @@ let in stdenv.mkDerivation rec { pname = "libime"; - version = "1.1.5"; + version = "1.1.6"; src = fetchFromGitHub { owner = "fcitx"; repo = "libime"; rev = version; - hash = "sha256-AvlQOpjrHSifUtWSTft2bywlWhwka26VcqqReqAlcv8="; + hash = "sha256-PhzJtAGmSkMeXMSe2uR/JKHKlZtL0e3tPDZVoRCvAis="; fetchSubmodules = true; }; From f9ff5e8db1d4c0ff64c3dc786b81bddc80245d14 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 21:59:46 +0800 Subject: [PATCH 147/186] xcb-imdkit: 1.0.6 -> 1.0.7 Diff: https://github.com/fcitx/xcb-imdkit/compare/1.0.6...1.0.7 --- pkgs/development/libraries/xcb-imdkit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/xcb-imdkit/default.nix b/pkgs/development/libraries/xcb-imdkit/default.nix index a0fd70e10d3b..0483d2718541 100644 --- a/pkgs/development/libraries/xcb-imdkit/default.nix +++ b/pkgs/development/libraries/xcb-imdkit/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "xcb-imdkit"; - version = "1.0.6"; + version = "1.0.7"; src = fetchFromGitHub { owner = "fcitx"; repo = "xcb-imdkit"; rev = version; - sha256 = "sha256-1+x4KE2xh6KWbdCBlPxDvHvcKUEj4hiW4fEPCeYfTwc="; + sha256 = "sha256-trfKWCMIuYV0XyCcIsNP8LCTc0MYotXvslRvp76YnKU="; }; nativeBuildInputs = [ From 2527e875cc87f6eab9c10701026f8d65f69d36f4 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 21:59:53 +0800 Subject: [PATCH 148/186] fcitx5: 5.1.7 -> 5.1.8 Diff: https://github.com/fcitx/fcitx5/compare/5.1.7...5.1.8 --- pkgs/tools/inputmethods/fcitx5/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/default.nix b/pkgs/tools/inputmethods/fcitx5/default.nix index a3b5e180bcfb..865134947be5 100644 --- a/pkgs/tools/inputmethods/fcitx5/default.nix +++ b/pkgs/tools/inputmethods/fcitx5/default.nix @@ -44,13 +44,13 @@ let in stdenv.mkDerivation rec { pname = "fcitx5"; - version = "5.1.7"; + version = "5.1.8"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - hash = "sha256-XI4E+fWDIYDiYBv6HezytaZmhzv4NUaNam1T5Fyx+LI="; + hash = "sha256-MeknggrpOzpkT1EXZCftIrlevuMEEHM5d8vszKRp+DI="; }; prePatch = '' From 78497390bb5931dbc0de8f563c2914c869085be1 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:02 +0800 Subject: [PATCH 149/186] fcitx5-chinese-addons: 5.1.3 -> 5.1.4 Diff: https://github.com/fcitx/fcitx5-chinese-addons/compare/5.1.3...5.1.4 --- pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix index 385043ef9a29..dda524ce2ac9 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix @@ -31,13 +31,13 @@ in mkDerivation rec { pname = "fcitx5-chinese-addons"; - version = "5.1.3"; + version = "5.1.4"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-z+udRjvAZbnu6EcvvdaFVCr0OKLxFBJbgoYpH9QjrDI="; + sha256 = "sha256-OqVoXZ8SIO8KRs3ehxul9Ug4sV47cxVCbLCBh6/8EoE="; }; nativeBuildInputs = [ From 5a7d6c36987a8c6e4d12b5d02bdee80d8a25f47f Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:07 +0800 Subject: [PATCH 150/186] fcitx5-configtool: 5.1.3 -> 5.1.4 Diff: https://github.com/fcitx/fcitx5-configtool/compare/5.1.3...5.1.4 --- pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix index b726a3515508..738d55d6cdaf 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix @@ -21,13 +21,13 @@ mkDerivation rec { pname = "fcitx5-configtool"; - version = "5.1.3"; + version = "5.1.4"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-IwGlhIeON0SenW738p07LWZAzVDMtxOSMuUIAgfmTEg="; + sha256 = "sha256-jYO1jdiuDjt6e98qhwMpTQTnGxoIYWMKkORGJbmk3mk="; }; cmakeFlags = [ From 0237047987756ff594cfddd1b48d4a26e594ac88 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:12 +0800 Subject: [PATCH 151/186] fcitx5-gtk: 5.1.1 -> 5.1.2 Diff: https://github.com/fcitx/fcitx5-gtk/compare/5.1.1...5.1.2 --- pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix index 1036b28685c3..6be9e49886f8 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix @@ -26,13 +26,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-gtk"; - version = "5.1.1"; + version = "5.1.2"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-Ex24cHTsYsZjP8o+vrCdgGogk1UotWpd8xaLZAqzgaQ="; + sha256 = "sha256-iNqY/VORDEPR4rc0LjVgcojZlMcT+LBdrdOwBkC5Vkk="; }; outputs = [ "out" "dev" ]; From ace8f134eaa387f5c11c50ed51af354c3443a5f6 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:17 +0800 Subject: [PATCH 152/186] fcitx5-hangul: 5.1.1 -> 5.1.2 Diff: https://github.com/fcitx/fcitx5-hangul/compare/5.1.1...5.1.2 --- pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix index 9a1a2c8eca24..23aabde1e653 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-hangul"; - version = "5.1.1"; + version = "5.1.2"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-3gkZh+ZzgTdpTbQe92gxJlG0x6Yhl7LfMiFEq5mb92o="; + sha256 = "sha256-S5TGjb5vD0rk7V88b4yRziszLrwO1pgVFWuEGMp48oY="; }; nativeBuildInputs = [ From 0be796b5bf0e9727b297688231cda14ea87d733c Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:34 +0800 Subject: [PATCH 153/186] fcitx5-rime: 5.1.4 -> 5.1.5 --- pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix index 3698abeed8aa..4fecf46e5e3b 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix @@ -14,11 +14,11 @@ stdenv.mkDerivation rec { pname = "fcitx5-rime"; - version = "5.1.4"; + version = "5.1.5"; src = fetchurl { url = "https://download.fcitx-im.org/fcitx5/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-tbCIWenH5brJUVIsmOiw/E/uIXAWwK1yangIVlkeOAs="; + hash = "sha256-/eVgF5kgf1gmbkOInoGbmH/eH0vO2xj3X6k+wzeEssM="; }; cmakeFlags = [ From 7603c6794e6c296419be24601d1df53e3ff900ba Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:40 +0800 Subject: [PATCH 154/186] fcitx5-skk: 5.1.1 -> 5.1.2 Diff: https://github.com/fcitx/fcitx5-skk/compare/5.1.1...5.1.2 --- pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix index 31ecbed35bc9..3bb5f66a5148 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix @@ -16,13 +16,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-skk"; - version = "5.1.1"; + version = "5.1.2"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-a+ZsuFEan61U0oOuhrTFoK5J4Vd0jj463jQ8Mk7TdbA="; + sha256 = "sha256-vg79zJ/ZoUjCKU11krDUjO0rAyZxDMsBnHqJ/I6NTTA="; }; nativeBuildInputs = [ From b85b81d21567ea839bdd48f96756b40e74790cf9 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:47 +0800 Subject: [PATCH 155/186] fcitx5-table-extra: 5.1.3 -> 5.1.4 Diff: https://github.com/fcitx/fcitx5-table-extra/compare/5.1.3...5.1.4 --- pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix index 0320fa5c4f01..dea3e2d03802 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-table-extra"; - version = "5.1.3"; + version = "5.1.4"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - hash = "sha256-w4JFZvYFL3fHrDgZqYND2bl3lT9/O1GXgfOwR7WyzWY="; + hash = "sha256-Lb8CYFQl48arJEn9gemZ7imD/gdKjN+7Wnm21/0/Sko="; }; nativeBuildInputs = [ From b90a2326edbc6016ee88c06751c4e6670315ce03 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:00:53 +0800 Subject: [PATCH 156/186] fcitx5-table-other: 5.1.0 -> 5.1.1 Diff: https://github.com/fcitx/fcitx5-table-other/compare/5.1.0...5.1.1 --- pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix index b0129a923438..410413bf30d8 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-table-other"; - version = "5.1.0"; + version = "5.1.1"; src = fetchFromGitHub { owner = "fcitx"; repo = pname; rev = version; - sha256 = "sha256-ymHAKaPmQckxM/XHoDOVSzEWpyQGb7zVG21CDwNfyjg="; + sha256 = "sha256-G34hPEdcdi5agWiFEgUHWD18ozOgBCaoS6HMAklUcO4="; }; nativeBuildInputs = [ From 49e70199883b5878c5da26f72a60989bf6687d9f Mon Sep 17 00:00:00 2001 From: Vonfry Date: Fri, 1 Mar 2024 22:01:00 +0800 Subject: [PATCH 157/186] fcitx5-unikey: 5.1.2 -> 5.1.3 Diff: https://github.com/fcitx/fcitx5-unikey/compare/5.1.2...5.1.3 --- pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix index aa87d725f104..d2d02843c93e 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation rec { pname = "fcitx5-unikey"; - version = "5.1.2"; + version = "5.1.3"; src = fetchFromGitHub { owner = "fcitx"; repo = "fcitx5-unikey"; rev = version; - sha256 = "sha256-tLooADS8HojS9i178i5FJVqZtKrTXlzOBPlE9K49Tjc="; + sha256 = "sha256-wrsA0gSexOZgsJunozt49GyP9R3Xe2Aci7Q8p3zAM9Q="; }; nativeBuildInputs = [ cmake extra-cmake-modules wrapQtAppsHook ]; From 75a1ff3f94d7d214f039eb3ec1a400a46836ea19 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 14:05:57 +0000 Subject: [PATCH 158/186] mergerfs: 2.40.1 -> 2.40.2 --- pkgs/tools/filesystems/mergerfs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/mergerfs/default.nix b/pkgs/tools/filesystems/mergerfs/default.nix index 1ff360bc3399..c5dca0278ecb 100644 --- a/pkgs/tools/filesystems/mergerfs/default.nix +++ b/pkgs/tools/filesystems/mergerfs/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "mergerfs"; - version = "2.40.1"; + version = "2.40.2"; src = fetchFromGitHub { owner = "trapexit"; repo = pname; rev = version; - sha256 = "sha256-EeAgDkm8WyD9OCM8/tHydp/slDGPwCAljeOrUCIWAqQ="; + sha256 = "sha256-3DfSGuTtM+h0IdtsIhLVXQxX5/Tj9G5Qcha3DWmyyq4="; }; nativeBuildInputs = [ From bd3290c7dabebc8645d478c847d6fa94e865d389 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 14:28:55 +0000 Subject: [PATCH 159/186] oculante: 0.8.11 -> 0.8.13 --- pkgs/applications/graphics/oculante/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/oculante/default.nix b/pkgs/applications/graphics/oculante/default.nix index 76ac8abc8b21..d6f8c1d641cb 100644 --- a/pkgs/applications/graphics/oculante/default.nix +++ b/pkgs/applications/graphics/oculante/default.nix @@ -22,16 +22,16 @@ rustPlatform.buildRustPackage rec { pname = "oculante"; - version = "0.8.11"; + version = "0.8.13"; src = fetchFromGitHub { owner = "woelper"; repo = "oculante"; rev = version; - hash = "sha256-5nOXt2c7byO+JdVXADu2TyO4vtLyg8UBWerPFMGHcso="; + hash = "sha256-RbRvV3OkRZXc0n7qGzqbBtbU81wFc+/Ohg9pbVqdsw4="; }; - cargoHash = "sha256-l1JYZxwvNnaff1PYPXniHmfNMG2Um5aPKTYuh/LCHoE="; + cargoHash = "sha256-qt4bHCHpiP6yOce9hquVVlLFF906ADwhss4xAP9E0fA="; nativeBuildInputs = [ cmake From 8147f49e28c9dd5219944095396212a59b8d530c Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 1 Mar 2024 06:43:32 -0800 Subject: [PATCH 160/186] direnv: 2.33.0 -> 2.34.0 (#292564) --- pkgs/tools/misc/direnv/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/direnv/default.nix b/pkgs/tools/misc/direnv/default.nix index 9395cade650b..4bb9d9bacaff 100644 --- a/pkgs/tools/misc/direnv/default.nix +++ b/pkgs/tools/misc/direnv/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "direnv"; - version = "2.33.0"; + version = "2.34.0"; src = fetchFromGitHub { owner = "direnv"; repo = "direnv"; rev = "v${version}"; - sha256 = "sha256-/xOqJ3dr+3S502rXHVBcHhgBCctoMYnWpfLqgrxIoN8="; + sha256 = "sha256-EvzqLS/FiWrbIXDkp0L/T8QNKnRGuQkbMWajI3X3BDw="; }; - vendorHash = "sha256-QGPcNgA/iiGt0CdFs2kR3zLL5/SWulSyyf/pW212JpU="; + vendorHash = "sha256-FfKvLPv+jUT5s2qQ7QlzBMArI+acj7nhpE8FGMPpp5E="; # we have no bash at the moment for windows BASH_PATH = From 34ad69f5a469c034b6e8f22399692b576fffd50a Mon Sep 17 00:00:00 2001 From: Pavel Sobolev Date: Fri, 1 Mar 2024 14:48:11 +0000 Subject: [PATCH 161/186] mold: 2.4.0 -> 2.4.1 --- pkgs/development/tools/mold/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/mold/default.nix b/pkgs/development/tools/mold/default.nix index 9f9599e047dc..a44c28c18bca 100644 --- a/pkgs/development/tools/mold/default.nix +++ b/pkgs/development/tools/mold/default.nix @@ -23,13 +23,13 @@ stdenv.mkDerivation rec { pname = "mold"; - version = "2.4.0"; + version = "2.4.1"; src = fetchFromGitHub { owner = "rui314"; repo = "mold"; rev = "v${version}"; - hash = "sha256-ufqTbY59AI1MrY/vrsDg5a4WEVz9IFTdgl1GHMw9HGc="; + hash = "sha256-wwlpYAWP8sAsEkTq0w3s2jAWGayW3v9QcaVRKWHTlGE="; }; nativeBuildInputs = [ From 8e8f6a57f4b79ef6152cd9b84ce80f3071fb301d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 15:03:09 +0000 Subject: [PATCH 162/186] cargo-chef: 0.1.64 -> 0.1.65 --- pkgs/development/tools/rust/cargo-chef/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-chef/default.nix b/pkgs/development/tools/rust/cargo-chef/default.nix index 69788f43c2ce..19591518b445 100644 --- a/pkgs/development/tools/rust/cargo-chef/default.nix +++ b/pkgs/development/tools/rust/cargo-chef/default.nix @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "cargo-chef"; - version = "0.1.64"; + version = "0.1.65"; src = fetchCrate { inherit pname version; - sha256 = "sha256-TjmtL/0rr/rJPdWSjL6zD3H49Qhg6YE7irS1xjyc3OA="; + sha256 = "sha256-3G2mgQDSj+IL6gqdhr3Sov9FHwLA6B+MRazLNF+zKZk="; }; - cargoHash = "sha256-1SZZva0b7/0FGqZO4RL5gMnpG+xZwKqLU1Fgv54ewNM="; + cargoHash = "sha256-hWkUvUFYAOqRkoU52bKzEmvNaqASfWLlnWtIuFLMDc8="; meta = with lib; { description = "A cargo-subcommand to speed up Rust Docker builds using Docker layer caching"; From 9336fcc5ae4fa579b6f3fb7f0e68277d875ec435 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 7 Jan 2024 00:46:54 -0500 Subject: [PATCH 163/186] fcitx5: drop superfluous use of libsForQt5.callPackage --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f80f4ef1290..eb3c504e945b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8042,7 +8042,7 @@ with pkgs; chewing-editor = libsForQt5.callPackage ../applications/misc/chewing-editor { }; - fcitx5 = libsForQt5.callPackage ../tools/inputmethods/fcitx5 { }; + fcitx5 = callPackage ../tools/inputmethods/fcitx5 { }; fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { }; From 0b5b74bbeb4b881b2d4e9c4fb87fcca72fe99301 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 8 Jan 2024 16:11:12 -0500 Subject: [PATCH 164/186] fcitx5-skk: build for both qt versions --- pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix | 8 +++++--- pkgs/top-level/aliases.nix | 2 ++ pkgs/top-level/all-packages.nix | 6 +----- pkgs/top-level/qt5-packages.nix | 2 ++ pkgs/top-level/qt6-packages.nix | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix index 3bb5f66a5148..6cfced6a632e 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix @@ -10,7 +10,6 @@ , libskk , qtbase , skk-dicts -, wrapQtAppsHook , enableQt ? false }: @@ -30,7 +29,7 @@ stdenv.mkDerivation rec { extra-cmake-modules gettext pkg-config - ] ++ lib.optional enableQt wrapQtAppsHook; + ]; buildInputs = [ fcitx5 @@ -41,10 +40,13 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DENABLE_QT=${toString enableQt}" + (lib.cmakeBool "ENABLE_QT" enableQt) + (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) "-DSKK_DEFAULT_PATH=${skk-dicts}/share/SKK-JISYO.L" ]; + dontWrapQtApps = true; + meta = with lib; { description = "Input method engine for Fcitx5, which uses libskk as its backend"; homepage = "https://github.com/fcitx/fcitx5-skk"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b8c60841bb76..a5296a47bd51 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -321,6 +321,8 @@ mapAliases ({ fcitx-engines = throw "fcitx-engines is deprecated, please use fcitx5 instead."; # Added 2023-03-13 fcitx-configtool = throw "fcitx-configtool is deprecated, please use fcitx5 instead."; # Added 2023-03-13 + fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 + ### G ### g4py = python3Packages.geant4; # Added 2020-06-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eb3c504e945b..c661f92d8570 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8056,11 +8056,7 @@ with pkgs; }; }; - fcitx5-skk = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; - - fcitx5-skk-qt = fcitx5-skk.override { - enableQt = true; - }; + fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; fcitx5-unikey = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index e6d5aab36956..f00d65d22488 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -100,6 +100,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; + fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; + futuresql = callPackage ../development/libraries/futuresql { }; qgpgme = callPackage ../development/libraries/gpgme { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 68f73dad7634..d99ad26aa2fc 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -34,6 +34,8 @@ makeScopeWithSplicing' { fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; + fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; + kdsoap = callPackage ../development/libraries/kdsoap { }; kcolorpicker = callPackage ../development/libraries/kcolorpicker { }; From 51f1291ea5091d226228255beb2adf6a9ea04fb6 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 8 Jan 2024 16:08:12 -0500 Subject: [PATCH 165/186] fcitx5-unikey: build for both qt versions --- .../inputmethods/fcitx5/fcitx5-unikey.nix | 20 ++++++++++++++++--- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/qt5-packages.nix | 2 ++ pkgs/top-level/qt6-packages.nix | 2 ++ 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix index d2d02843c93e..a1a077264b3a 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix @@ -6,7 +6,7 @@ , fcitx5 , fcitx5-qt , gettext -, wrapQtAppsHook +, qtbase }: stdenv.mkDerivation rec { @@ -20,9 +20,23 @@ stdenv.mkDerivation rec { sha256 = "sha256-wrsA0gSexOZgsJunozt49GyP9R3Xe2Aci7Q8p3zAM9Q="; }; - nativeBuildInputs = [ cmake extra-cmake-modules wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake + extra-cmake-modules + ]; - buildInputs = [ fcitx5 fcitx5-qt gettext ]; + buildInputs = [ + qtbase + fcitx5 + fcitx5-qt + gettext + ]; + + cmakeFlags = [ + (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) + ]; + + dontWrapQtApps = true; meta = with lib; { description = "Unikey engine support for Fcitx5"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a5296a47bd51..a66e3da5a316 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -322,6 +322,7 @@ mapAliases ({ fcitx-configtool = throw "fcitx-configtool is deprecated, please use fcitx5 instead."; # Added 2023-03-13 fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 + fcitx5-unikey = libsForQt5.fcitx5-unikey; # Added 2024-03-01 ### G ### diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c661f92d8570..191e8b385428 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8058,8 +8058,6 @@ with pkgs; fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; - fcitx5-unikey = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; - fcitx5-configtool = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; fcitx5-anthy = callPackage ../tools/inputmethods/fcitx5/fcitx5-anthy.nix { }; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index f00d65d22488..bfde2a2c79ef 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -102,6 +102,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; + fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; + futuresql = callPackage ../development/libraries/futuresql { }; qgpgme = callPackage ../development/libraries/gpgme { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index d99ad26aa2fc..992b8be11825 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -36,6 +36,8 @@ makeScopeWithSplicing' { fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; + fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; + kdsoap = callPackage ../development/libraries/kdsoap { }; kcolorpicker = callPackage ../development/libraries/kcolorpicker { }; From 45e4e8f97356dcf7429657f553ac7514b218f01a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 7 Jan 2024 01:00:43 -0500 Subject: [PATCH 166/186] fcitx5-chinese-addons: build for both qt versions --- .../inputmethods/fcitx5/fcitx5-chinese-addons.nix | 11 +++++++++-- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/qt5-packages.nix | 2 ++ pkgs/top-level/qt6-packages.nix | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix index dda524ce2ac9..0699f23e3aab 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix @@ -1,5 +1,5 @@ { lib -, mkDerivation +, stdenv , fetchurl , fetchFromGitHub , cmake @@ -13,6 +13,7 @@ , opencc , curl , fmt +, qtbase , luaSupport ? true }: @@ -29,7 +30,7 @@ let }; in -mkDerivation rec { +stdenv.mkDerivation rec { pname = "fcitx5-chinese-addons"; version = "5.1.4"; @@ -62,6 +63,12 @@ mkDerivation rec { fmt ] ++ lib.optional luaSupport fcitx5-lua; + cmakeFlags = [ + (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) + ]; + + dontWrapQtApps = true; + meta = with lib; { description = "Addons related to Chinese, including IME previous bundled inside fcitx4"; homepage = "https://github.com/fcitx/fcitx5-chinese-addons"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a66e3da5a316..58ed761dc803 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -321,6 +321,7 @@ mapAliases ({ fcitx-engines = throw "fcitx-engines is deprecated, please use fcitx5 instead."; # Added 2023-03-13 fcitx-configtool = throw "fcitx-configtool is deprecated, please use fcitx5 instead."; # Added 2023-03-13 + fcitx5-chinese-addons = libsForQt5.fcitx5-chinese-addons; # Added 2024-03-01 fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 fcitx5-unikey = libsForQt5.fcitx5-unikey; # Added 2024-03-01 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 191e8b385428..76371e6f81fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8048,8 +8048,6 @@ with pkgs; fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { }; - fcitx5-chinese-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; - fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { abseil-cpp = abseil-cpp.override { cxxStandard = "17"; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index bfde2a2c79ef..e5c707fc56e8 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -100,6 +100,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; + fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 992b8be11825..62ed9c4bb007 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -32,6 +32,8 @@ makeScopeWithSplicing' { accounts-qt = callPackage ../development/libraries/accounts-qt { }; appstream-qt = callPackage ../development/libraries/appstream/qt.nix { }; + fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; From 6f8d73e50210306ba9acd02324d62bfd18e223c9 Mon Sep 17 00:00:00 2001 From: nviets Date: Fri, 1 Mar 2024 09:49:36 -0600 Subject: [PATCH 167/186] nng: 1.7.2 -> 1.7.3 --- pkgs/development/libraries/nng/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/nng/default.nix b/pkgs/development/libraries/nng/default.nix index e6b851817eff..34f0aee7d707 100644 --- a/pkgs/development/libraries/nng/default.nix +++ b/pkgs/development/libraries/nng/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "nng"; - version = "1.7.2"; + version = "1.7.3"; src = fetchFromGitHub { owner = "nanomsg"; repo = "nng"; rev = "v${version}"; - hash = "sha256-CG6Gw/Qrbi96koF2VxKMYPMPT2Zj9U97vNk2JdrfRro="; + hash = "sha256-oP7hO3wCXNPW7877wK+HpGsw7j+U0q4i8aTRVi1v0r0="; }; nativeBuildInputs = [ cmake ninja ] From 6fb9849e686cdf986e8cf734b3f466ee5d16e6cf Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Mar 2024 11:10:27 -0500 Subject: [PATCH 168/186] fcitx5-configtool: build for both qt versions --- .../inputmethods/fcitx5/fcitx5-configtool.nix | 55 +++++++++++++------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 +- pkgs/top-level/qt5-packages.nix | 2 + pkgs/top-level/qt6-packages.nix | 3 + 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix index 738d55d6cdaf..f0553a5d52f7 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix @@ -1,25 +1,33 @@ { lib -, mkDerivation +, stdenv , fetchFromGitHub , cmake , extra-cmake-modules +, pkg-config , fcitx5 , fcitx5-qt -, qtx11extras -, qtquickcontrols2 +, qtbase +, qtsvg +, qtwayland +, qtdeclarative +, qtx11extras ? null +, kitemviews , kwidgetsaddons +, qtquickcontrols2 ? null +, kcoreaddons , kdeclarative -, kirigami2 +, kirigami ? null +, kirigami2 ? null , isocodes , xkeyboardconfig , libxkbfile -, libXdmcp -, plasma5Packages -, plasma-framework +, libplasma ? null +, plasma-framework ? null +, wrapQtAppsHook , kcmSupport ? true }: -mkDerivation rec { +stdenv.mkDerivation rec { pname = "fcitx5-configtool"; version = "5.1.4"; @@ -31,30 +39,43 @@ mkDerivation rec { }; cmakeFlags = [ - "-DKDE_INSTALL_USE_QT_SYS_PATHS=ON" + (lib.cmakeBool "KDE_INSTALL_USE_QT_SYS_PATHS" true) + (lib.cmakeBool "ENABLE_KCM" kcmSupport) + (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) ]; nativeBuildInputs = [ cmake extra-cmake-modules + pkg-config + wrapQtAppsHook ]; buildInputs = [ fcitx5 fcitx5-qt - qtx11extras - qtquickcontrols2 - kirigami2 + qtbase + qtsvg + qtwayland + kitemviews + kwidgetsaddons isocodes xkeyboardconfig libxkbfile - libXdmcp - ] ++ lib.optionals kcmSupport [ + ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [ + qtx11extras + ] ++ lib.optionals kcmSupport ([ + qtdeclarative + kcoreaddons kdeclarative - kwidgetsaddons - plasma5Packages.kiconthemes + ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [ + qtquickcontrols2 plasma-framework - ]; + kirigami2 + ] ++ lib.optionals (lib.versions.major qtbase.version == "6") [ + libplasma + kirigami + ]); meta = with lib; { description = "Configuration Tool for Fcitx5"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 58ed761dc803..fc231ee10ebd 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -322,6 +322,7 @@ mapAliases ({ fcitx-configtool = throw "fcitx-configtool is deprecated, please use fcitx5 instead."; # Added 2023-03-13 fcitx5-chinese-addons = libsForQt5.fcitx5-chinese-addons; # Added 2024-03-01 + fcitx5-configtool = libsForQt5.fcitx5-configtool; # Added 2024-03-01 fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 fcitx5-unikey = libsForQt5.fcitx5-unikey; # Added 2024-03-01 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 76371e6f81fa..6e61d7581a39 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8056,8 +8056,6 @@ with pkgs; fcitx5-skk = qt6Packages.callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { }; - fcitx5-configtool = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; - fcitx5-anthy = callPackage ../tools/inputmethods/fcitx5/fcitx5-anthy.nix { }; fcitx5-chewing = callPackage ../tools/inputmethods/fcitx5/fcitx5-chewing.nix { }; @@ -24402,7 +24400,7 @@ with pkgs; qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { }); qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix { - inherit lib __splicedPackages makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget; + inherit lib __splicedPackages makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget kdePackages; stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; }); diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index e5c707fc56e8..e9b416ad35b8 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -102,6 +102,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-configtool = callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; + fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 62ed9c4bb007..0e667a348ed4 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -10,6 +10,7 @@ , generateSplicesForMkScope , stdenv , pkgsHostTarget +, kdePackages }: let @@ -34,6 +35,8 @@ makeScopeWithSplicing' { fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-configtool = kdePackages.callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; + fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; From 81ed07d28a62242872c2ff32eaa4a766758d5c38 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Mar 2024 11:10:54 -0500 Subject: [PATCH 169/186] fcitx5-with-addons: build for both qt versions --- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/qt5-packages.nix | 2 ++ pkgs/top-level/qt6-packages.nix | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index fc231ee10ebd..7cf15fc5a928 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -325,6 +325,7 @@ mapAliases ({ fcitx5-configtool = libsForQt5.fcitx5-configtool; # Added 2024-03-01 fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 fcitx5-unikey = libsForQt5.fcitx5-unikey; # Added 2024-03-01 + fcitx5-with-addons = libsForQt5.fcitx5-with-addons; # Added 2024-03-01 ### G ### diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6e61d7581a39..9a5e69c07568 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8044,8 +8044,6 @@ with pkgs; fcitx5 = callPackage ../tools/inputmethods/fcitx5 { }; - fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { }; - fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { }; fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index e9b416ad35b8..0cf6ab88c323 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -108,6 +108,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; + fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { }; + futuresql = callPackage ../development/libraries/futuresql { }; qgpgme = callPackage ../development/libraries/gpgme { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 0e667a348ed4..07bff4a9c327 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -43,6 +43,8 @@ makeScopeWithSplicing' { fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; + fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { }; + kdsoap = callPackage ../development/libraries/kdsoap { }; kcolorpicker = callPackage ../development/libraries/kcolorpicker { }; From 6e2d4054aefe6d0065786c944db88951c4064e21 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Mar 2024 11:34:09 -0500 Subject: [PATCH 170/186] nixos/fcitx5: add plasma6 support option --- nixos/modules/i18n/input-method/fcitx5.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/i18n/input-method/fcitx5.nix b/nixos/modules/i18n/input-method/fcitx5.nix index 530727f3f292..2e87705c6dc2 100644 --- a/nixos/modules/i18n/input-method/fcitx5.nix +++ b/nixos/modules/i18n/input-method/fcitx5.nix @@ -5,7 +5,10 @@ with lib; let im = config.i18n.inputMethod; cfg = im.fcitx5; - fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; }; + fcitx5Package = + if cfg.plasma6Support + then pkgs.qt6Packages.fcitx5-with-addons.override { inherit (cfg) addons; } + else pkgs.libsForQt5.fcitx5-with-addons.override { inherit (cfg) addons; }; settingsFormat = pkgs.formats.ini { }; in { @@ -27,6 +30,14 @@ in See [Using Fcitx 5 on Wayland](https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland). ''; }; + plasma6Support = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Use qt6 versions of fcitx5 packages. + Required for configuring fcitx5 in KDE System Settings. + ''; + }; quickPhrase = mkOption { type = with types; attrsOf str; default = { }; From f9cf9ecda4cf926144207ca26db6bebcc04f445d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 16:36:32 +0000 Subject: [PATCH 171/186] python311Packages.python-novaclient: 18.4.0 -> 18.5.0 --- pkgs/development/python-modules/python-novaclient/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-novaclient/default.nix b/pkgs/development/python-modules/python-novaclient/default.nix index 1bad0f4e6930..866e4cb097ec 100644 --- a/pkgs/development/python-modules/python-novaclient/default.nix +++ b/pkgs/development/python-modules/python-novaclient/default.nix @@ -17,14 +17,14 @@ buildPythonPackage rec { pname = "python-novaclient"; - version = "18.4.0"; + version = "18.5.0"; format = "setuptools"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-a2tq4sEescEI469V6qchGw/JGZk1oimmuj4N5RTBK1A="; + hash = "sha256-4j7kQMDI6uK1OvqIHTCsrsBof8660kY5HsKblsVDA40="; }; propagatedBuildInputs = [ From cd6e28ab9d310bdedd16e73292c3139e6ec5c53f Mon Sep 17 00:00:00 2001 From: sarahec Date: Tue, 27 Feb 2024 13:56:53 -0800 Subject: [PATCH 172/186] python311Packages.textnets: 0.9.3 -> 0.9.4 --- .../python-modules/textnets/default.nix | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/textnets/default.nix b/pkgs/development/python-modules/textnets/default.nix index f0dd9ab9a650..2ba5ff701919 100644 --- a/pkgs/development/python-modules/textnets/default.nix +++ b/pkgs/development/python-modules/textnets/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , cairocffi -, cython +, cython_3 , fetchPypi , igraph , leidenalg @@ -9,6 +9,7 @@ , poetry-core , pytestCheckHook , pythonOlder +, pythonRelaxDepsHook , scipy , setuptools , spacy @@ -21,22 +22,25 @@ buildPythonPackage rec { pname = "textnets"; - version = "0.9.3"; + version = "0.9.4"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-fx2S43IqpSMsfJow26jB/D27dyUFQ1PlXP1rbUIZPPQ="; + hash = "sha256-4154ytzo1QpwhKA1BkVMss9fNIkysnClW/yfSVlX33M="; }; nativeBuildInputs = [ - cython + pythonRelaxDepsHook + cython_3 poetry-core setuptools ]; + pythonRelaxDeps = [ "igraph" "leidenalg" ]; + propagatedBuildInputs = [ cairocffi igraph @@ -59,10 +63,14 @@ buildPythonPackage rec { "textnets" ]; + # Enables the package to find the cythonized .so files during testing. See #255262 + preCheck = '' + rm -r textnets + ''; + disabledTests = [ - # Test fails: A warning is triggered because of a deprecation notice by pandas. - # TODO: Try to re-enable it when pandas is updated to 2.1.1 - "test_corpus_czech" + # Test fails: Throws a UserWarning asking the user to install `textnets[fca]`. + "test_context" ]; meta = with lib; { From 19bfc60e9f564194ad00508c578c7e1a329056f5 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Fri, 1 Mar 2024 18:02:23 +0100 Subject: [PATCH 173/186] garage_0_8: 0.8.5 -> 0.8.6 https://git.deuxfleurs.fr/Deuxfleurs/garage/releases/tag/v0.8.6 Signed-off-by: Raito Bezarius --- pkgs/tools/filesystems/garage/default.nix | 10 +++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/filesystems/garage/default.nix b/pkgs/tools/filesystems/garage/default.nix index e34822845b40..ade94f1d1ed6 100644 --- a/pkgs/tools/filesystems/garage/default.nix +++ b/pkgs/tools/filesystems/garage/default.nix @@ -89,14 +89,14 @@ rec { # we have to keep all the numbers in the version to handle major/minor/patch level. # for <1.0. - garage_0_8_5 = generic { - version = "0.8.5"; - sha256 = "sha256-YRxkjETSmI1dcHP9qTPLcOMqXx9B2uplVR3bBjJWn3I="; - cargoSha256 = "sha256-VOcymlvqqQRdT1MFzRcMuD+Xo3fc3XTuRA12tW7ZjdI="; + garage_0_8_6 = generic { + version = "0.8.6"; + sha256 = "sha256-N0AOcwpuBHwTZtHcz6a2d9GOimHevhohEOzVkIt0RDE="; + cargoSha256 = "sha256-e72FQKL77CZOi/pa+hE7PCyc1+HSJgEsKGgWlfVw51k="; broken = stdenv.isDarwin; }; - garage_0_8 = garage_0_8_5; + garage_0_8 = garage_0_8_6; garage_0_9_1 = generic { version = "0.9.1"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9a5e69c07568..e669441041ab 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8405,7 +8405,7 @@ with pkgs; }) garage garage_0_8 garage_0_9 - garage_0_8_5 garage_0_9_1; + garage_0_8_6 garage_0_9_1; garmintools = callPackage ../development/libraries/garmintools { }; From 3794246066409d7baac72e3fdfb0e4f66ef4a013 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Thu, 29 Feb 2024 19:22:33 -0800 Subject: [PATCH 174/186] nixos/nixpkgs: fix determination for cross-compiled nixos system Since the output of `lib.systems.elaborate` contains functions, an equality check with `==` does not suffice, `lib.systems.equals` should be used instead. --- nixos/modules/misc/nixpkgs.nix | 6 +++++- nixos/modules/misc/nixpkgs/test.nix | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index da321a923449..10f800cd741a 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -208,7 +208,11 @@ in example = { system = "x86_64-linux"; }; # Make sure that the final value has all fields for sake of other modules # referring to this. - apply = lib.systems.elaborate; + apply = inputBuildPlatform: + let elaborated = lib.systems.elaborate inputBuildPlatform; + in if lib.systems.equals elaborated cfg.hostPlatform + then cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001 + else elaborated; defaultText = literalExpression ''config.nixpkgs.hostPlatform''; description = lib.mdDoc '' diff --git a/nixos/modules/misc/nixpkgs/test.nix b/nixos/modules/misc/nixpkgs/test.nix index 0536cfc9624a..be9a88a07788 100644 --- a/nixos/modules/misc/nixpkgs/test.nix +++ b/nixos/modules/misc/nixpkgs/test.nix @@ -12,6 +12,10 @@ let nixpkgs.hostPlatform = "aarch64-linux"; nixpkgs.buildPlatform = "aarch64-darwin"; }; + withSameHostAndBuild = eval { + nixpkgs.hostPlatform = "aarch64-linux"; + nixpkgs.buildPlatform = "aarch64-linux"; + }; ambiguous = { _file = "ambiguous.nix"; nixpkgs.hostPlatform = "aarch64-linux"; @@ -81,6 +85,8 @@ lib.recurseIntoAttrs { assert withHost._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-linux"; assert withHostAndBuild._module.args.pkgs.stdenv.hostPlatform.system == "aarch64-linux"; assert withHostAndBuild._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-darwin"; + assert withSameHostAndBuild.config.nixpkgs.buildPlatform == withSameHostAndBuild.config.nixpkgs.hostPlatform; + assert withSameHostAndBuild._module.args.pkgs.stdenv.buildPlatform == withSameHostAndBuild._module.args.pkgs.stdenv.hostPlatform; assert builtins.trace (lib.head (getErrors ambiguous)) getErrors ambiguous == ['' From b041481ef31d70e2728fa4c97a80ec6ae131ca19 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Fri, 1 Mar 2024 18:02:38 +0100 Subject: [PATCH 175/186] garage: 0.9.1 -> 0.9.2 https://git.deuxfleurs.fr/Deuxfleurs/garage/releases/tag/v0.9.2 Signed-off-by: Raito Bezarius --- pkgs/tools/filesystems/garage/default.nix | 15 ++++++++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/filesystems/garage/default.nix b/pkgs/tools/filesystems/garage/default.nix index ade94f1d1ed6..c24194f40e32 100644 --- a/pkgs/tools/filesystems/garage/default.nix +++ b/pkgs/tools/filesystems/garage/default.nix @@ -70,6 +70,11 @@ let "sqlite" ]; + disabledTests = [ + # Upstream told us this test is flakey. + "k2v::poll::test_poll_item" + ]; + passthru.tests = nixosTests.garage; meta = { @@ -98,13 +103,13 @@ rec { garage_0_8 = garage_0_8_6; - garage_0_9_1 = generic { - version = "0.9.1"; - sha256 = "sha256-AXLaifVmZU4j5D/wKn/0TzhjHZBzZW1+tMyhsAo2eBU="; - cargoSha256 = "sha256-4/+OsM73TroBB1TGqare2xASO5KhqVyNkkss0Y0JZXg="; + garage_0_9_2 = generic { + version = "0.9.2"; + sha256 = "sha256-6a400/wOZunVH+LAByd6BEA0gs56Rxyh+gvM4hUO4Y8="; + cargoSha256 = "sha256-1p6bB2gMOCHDdILEwgoJ1EqvgGhLPcThNkwaz6NMZhQ="; }; - garage_0_9 = garage_0_9_1; + garage_0_9 = garage_0_9_2; garage = garage_0_9; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e669441041ab..b60f2f4c6a26 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8405,7 +8405,7 @@ with pkgs; }) garage garage_0_8 garage_0_9 - garage_0_8_6 garage_0_9_1; + garage_0_8_6 garage_0_9_2; garmintools = callPackage ../development/libraries/garmintools { }; From 5920196c69843bed60cdc5362ec58102f590b5f5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 17:15:31 +0000 Subject: [PATCH 176/186] tippecanoe: 2.46.0 -> 2.47.0 --- pkgs/by-name/ti/tippecanoe/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ti/tippecanoe/package.nix b/pkgs/by-name/ti/tippecanoe/package.nix index 3a949234c65a..7e1234d5ddb0 100644 --- a/pkgs/by-name/ti/tippecanoe/package.nix +++ b/pkgs/by-name/ti/tippecanoe/package.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "tippecanoe"; - version = "2.46.0"; + version = "2.47.0"; src = fetchFromGitHub { owner = "felt"; repo = "tippecanoe"; rev = finalAttrs.version; - hash = "sha256-UsQb90DKK05JByF3rh6kcvSaugEemU2Gg4c/owImNVs="; + hash = "sha256-tkecrbrkwYJU0eZMzU+7rJGAn+S/vnh/rw5co0x1m5M="; }; buildInputs = [ sqlite zlib ]; From 3f388279f7ed3a8b0b8cfc45d3f4305ecb2eb1c5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Mar 2024 12:59:20 +0000 Subject: [PATCH 177/186] nnpdf: 4.0.8 -> 4.0.9 --- pkgs/applications/science/physics/nnpdf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/physics/nnpdf/default.nix b/pkgs/applications/science/physics/nnpdf/default.nix index a53940d38d74..26e8247f85e3 100644 --- a/pkgs/applications/science/physics/nnpdf/default.nix +++ b/pkgs/applications/science/physics/nnpdf/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "nnpdf"; - version = "4.0.8"; + version = "4.0.9"; src = fetchFromGitHub { owner = "NNPDF"; repo = pname; rev = version; - hash = "sha256-hGCA2K/fD6UZa9WD42IDmZV1oxNgjFaXkjOZKGgGSBg="; + hash = "sha256-PyhkHlOlzKfDxUX91NkeZWjdEzFR4PW0Yh5Yz6ZA27g="; }; postPatch = '' From fb6fa7b3d9e7ef87056654030668ff4d74f24f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Fri, 1 Mar 2024 17:59:38 +0100 Subject: [PATCH 178/186] nixfmt-rfc-style: 2024-01-31 -> 2024-03-01 --- pkgs/by-name/ni/nixfmt-rfc-style/date.txt | 2 +- pkgs/by-name/ni/nixfmt-rfc-style/generated-package.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ni/nixfmt-rfc-style/date.txt b/pkgs/by-name/ni/nixfmt-rfc-style/date.txt index b3c1f63a9286..f4f1f2ef867e 100644 --- a/pkgs/by-name/ni/nixfmt-rfc-style/date.txt +++ b/pkgs/by-name/ni/nixfmt-rfc-style/date.txt @@ -1 +1 @@ -2024-01-31 +2024-03-01 diff --git a/pkgs/by-name/ni/nixfmt-rfc-style/generated-package.nix b/pkgs/by-name/ni/nixfmt-rfc-style/generated-package.nix index ac96818227ce..738b3e53c872 100644 --- a/pkgs/by-name/ni/nixfmt-rfc-style/generated-package.nix +++ b/pkgs/by-name/ni/nixfmt-rfc-style/generated-package.nix @@ -8,8 +8,8 @@ mkDerivation { pname = "nixfmt"; version = "0.5.0"; src = fetchzip { - url = "https://github.com/piegamesde/nixfmt/archive/d6930fd0c62c4d7ec9e4a814adc3d2f590d96271.tar.gz"; - sha256 = "1ijrdzdwricv4asmy296j7gzvhambv96nlxi3qrxb4lj1by6a34m"; + url = "https://github.com/piegamesde/nixfmt/archive/2b5ee820690bae64cb4003e46917ae43541e3e0b.tar.gz"; + sha256 = "1i1jbc1q4gd7fpilwy6s3a583yl5l8d8rlmipygj61mpclg9ihqg"; }; isLibrary = true; isExecutable = true; From 98325e4ba7700850df97825f3bf37bf46d1a9a41 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Fri, 1 Mar 2024 22:20:50 +0400 Subject: [PATCH 179/186] tippecanoe: add mainProgram --- pkgs/by-name/ti/tippecanoe/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/ti/tippecanoe/package.nix b/pkgs/by-name/ti/tippecanoe/package.nix index 7e1234d5ddb0..80fb8c195cff 100644 --- a/pkgs/by-name/ti/tippecanoe/package.nix +++ b/pkgs/by-name/ti/tippecanoe/package.nix @@ -32,5 +32,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.bsd2; maintainers = with maintainers; [ sikmir ]; platforms = platforms.unix; + mainProgram = "tippecanoe"; }; }) From 4ffb9ba70757d3ba610129ed4d5ba449883bdc4c Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Fri, 1 Mar 2024 19:35:03 +0100 Subject: [PATCH 180/186] garage: mark broken on Darwin It broke again because of some linker error. ``` garage-aarch64-darwin> warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible. garage-aarch64-darwin> --> src/model/garage.rs:134:31 garage-aarch64-darwin> | garage-aarch64-darwin> 134 | db::sled_adapter::SledDb::init(db) garage-aarch64-darwin> | ^^^^ garage-aarch64-darwin> | garage-aarch64-darwin> = note: `#[warn(deprecated)]` on by default garage-aarch64-darwin> garage-aarch64-darwin> Compiling garage_api v0.9.2 (/private/tmp/nix-build-garage-0.9.2.drv-0/source/src/api) garage-aarch64-darwin> Compiling garage_web v0.9.2 (/private/tmp/nix-build-garage-0.9.2.drv-0/source/src/web) garage-aarch64-darwin> warning: `garage_model` (lib) generated 1 warning garage-aarch64-darwin> Compiling garage v0.9.2 (/private/tmp/nix-build-garage-0.9.2.drv-0/source/src/garage) garage-aarch64-darwin> warning: use of deprecated associated function `garage_db::sled_adapter::SledDb::init`: The Sled database is now deprecated and will be removed in Garage v1.0. Please migrate to LMDB or Sqlite as soon as possible. garage-aarch64-darwin> --> src/garage/cli/convert_db.rs:65:29 garage-aarch64-darwin> | garage-aarch64-darwin> 65 | Ok(sled_adapter::SledDb::init(db)) garage-aarch64-darwin> | ^^^^ garage-aarch64-darwin> | garage-aarch64-darwin> = note: `#[warn(deprecated)]` on by default garage-aarch64-darwin> garage-aarch64-darwin> error: linker `/nix/store/6kpjydf9x7zqa1xq2qipnwr32ki3fs2n-clang-wrapper-16.0.6/bin/cc` not found garage-aarch64-darwin> | garage-aarch64-darwin> = note: No such file or directory (os error 2) ``` Signed-off-by: Raito Bezarius --- pkgs/tools/filesystems/garage/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/filesystems/garage/default.nix b/pkgs/tools/filesystems/garage/default.nix index c24194f40e32..b374618037bd 100644 --- a/pkgs/tools/filesystems/garage/default.nix +++ b/pkgs/tools/filesystems/garage/default.nix @@ -107,6 +107,7 @@ rec { version = "0.9.2"; sha256 = "sha256-6a400/wOZunVH+LAByd6BEA0gs56Rxyh+gvM4hUO4Y8="; cargoSha256 = "sha256-1p6bB2gMOCHDdILEwgoJ1EqvgGhLPcThNkwaz6NMZhQ="; + broken = stdenv.isDarwin; }; garage_0_9 = garage_0_9_2; From a9bebf8eb55f3fdd7d5fdb661ed0140fd12f111d Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Tue, 27 Feb 2024 22:55:53 -0800 Subject: [PATCH 181/186] opengist: init at 1.6.1 This is a clone of github gist, with 100% more open source and 100% more self hosted. --- pkgs/by-name/op/opengist/package.nix | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 pkgs/by-name/op/opengist/package.nix diff --git a/pkgs/by-name/op/opengist/package.nix b/pkgs/by-name/op/opengist/package.nix new file mode 100644 index 000000000000..fb9efcd7b076 --- /dev/null +++ b/pkgs/by-name/op/opengist/package.nix @@ -0,0 +1,70 @@ +{ lib, buildGoModule, buildNpmPackage, fetchFromGitHub, moreutils, jq, git }: +let + # finalAttrs when 🥺 (buildGoModule does not support them) + # https://github.com/NixOS/nixpkgs/issues/273815 + version = "1.6.1"; + src = fetchFromGitHub { + owner = "thomiceli"; + repo = "opengist"; + rev = "v${version}"; + hash = "sha256-rJ8oiH08kSSFNgPHKGo68Oi1i3L1SEJyHuzoxKMOZME="; + }; + + frontend = buildNpmPackage { + pname = "opengist-frontend"; + inherit version src; + + nativeBuildInputs = [ moreutils jq ]; + + # npm complains of "invalid package". shrug. we can give it a version. + preBuild = '' + jq '.version = "${version}"' package.json | sponge package.json + ''; + + # copy pasta from the Makefile upstream, seems to be a workaround of sass + # issues, unsure why it is not done in vite: + # https://github.com/thomiceli/opengist/blob/05eccfa8e728335514a40476cd8116cfd1ca61dd/Makefile#L16-L19 + postBuild = '' + EMBED=1 npx postcss 'public/assets/embed-*.css' -c public/postcss.config.js --replace + ''; + + installPhase = '' + mkdir -p $out + cp -R public $out + ''; + + npmDepsHash = "sha256-Sy321tIQOOrypk+EOGGixEzrPdhA9U8Hak+DOS+d00A="; + }; +in +buildGoModule { + pname = "opengist"; + inherit version src; + vendorHash = "sha256-IorqXJKzUTUL5zfKRipZaJtRlwVOmTwolJXFG/34Ais="; + tags = [ + "fs_embed" + ]; + + # required for tests + nativeCheckInputs = [ + git + ]; + + # required for tests to not try to write into $HOME and fail + preCheck = '' + export OG_OPENGIST_HOME=$(mktemp -d) + ''; + + postPatch = '' + cp -R ${frontend}/public/{manifest.json,assets} public/ + ''; + + passthru.frontend = frontend; + + meta = { + description = "Self-hosted pastebin powered by Git"; + homepage = "https://github.com/thomiceli/opengist"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ lf- ]; + platforms = lib.platforms.unix; + }; +} From 5981aff2125baba1430e5a96338a71e2e1fad18d Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 1 Mar 2024 02:29:24 +0100 Subject: [PATCH 182/186] tests.nixpkgs-check-by-name: Use RelativePath for relative paths Makes the code easier to understand and less error-prone --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 26 ++- .../nixpkgs-check-by-name/src/nix_file.rs | 17 +- .../src/nixpkgs_problem.rs | 196 +++++++++--------- .../test/nixpkgs-check-by-name/src/ratchet.rs | 4 +- .../nixpkgs-check-by-name/src/references.rs | 52 ++--- .../nixpkgs-check-by-name/src/structure.rs | 16 +- 6 files changed, 158 insertions(+), 153 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index 978fe9295336..094508f595d8 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -8,6 +8,7 @@ use crate::utils; use crate::validation::ResultIteratorExt as _; use crate::validation::{self, Validation::Success}; use crate::NixFileStore; +use relative_path::RelativePathBuf; use std::path::Path; use anyhow::Context; @@ -56,18 +57,15 @@ struct Location { impl Location { // Returns the [file] field, but relative to Nixpkgs - fn relative_file(&self, nixpkgs_path: &Path) -> anyhow::Result { - Ok(self - .file - .strip_prefix(nixpkgs_path) - .with_context(|| { - format!( - "The file ({}) is outside Nixpkgs ({})", - self.file.display(), - nixpkgs_path.display() - ) - })? - .to_path_buf()) + fn relative_file(&self, nixpkgs_path: &Path) -> anyhow::Result { + let path = self.file.strip_prefix(nixpkgs_path).with_context(|| { + format!( + "The file ({}) is outside Nixpkgs ({})", + self.file.display(), + nixpkgs_path.display() + ) + })?; + Ok(RelativePathBuf::from_path(path).expect("relative path")) } } @@ -352,12 +350,12 @@ fn by_name( /// all-packages.nix fn by_name_override( attribute_name: &str, - expected_package_file: PathBuf, + expected_package_file: RelativePathBuf, is_semantic_call_package: bool, optional_syntactic_call_package: Option, definition: String, location: Location, - relative_location_file: PathBuf, + relative_location_file: RelativePathBuf, ) -> validation::Validation> { // At this point, we completed two different checks for whether it's a // `callPackage` diff --git a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs index 1cb5d1c0d08d..e2dc1e196141 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nix_file.rs @@ -3,6 +3,7 @@ use crate::utils::LineIndex; use anyhow::Context; use itertools::Either::{self, Left, Right}; +use relative_path::RelativePathBuf; use rnix::ast; use rnix::ast::Expr; use rnix::ast::HasEntry; @@ -79,7 +80,7 @@ impl NixFile { #[derive(Debug, PartialEq)] pub struct CallPackageArgumentInfo { /// The relative path of the first argument, or `None` if it's not a path. - pub relative_path: Option, + pub relative_path: Option, /// Whether the second argument is an empty attribute set pub empty_arg: bool, } @@ -369,8 +370,8 @@ pub enum ResolvedPath { /// The path is outside the given absolute path Outside, /// The path is within the given absolute path. - /// The `PathBuf` is the relative path under the given absolute path. - Within(PathBuf), + /// The `RelativePathBuf` is the relative path under the given absolute path. + Within(RelativePathBuf), } impl NixFile { @@ -402,7 +403,9 @@ impl NixFile { // Check if it's within relative_to match resolved.strip_prefix(relative_to) { Err(_prefix_error) => ResolvedPath::Outside, - Ok(suffix) => ResolvedPath::Within(suffix.to_path_buf()), + Ok(suffix) => ResolvedPath::Within( + RelativePathBuf::from_path(suffix).expect("a relative path"), + ), } } } @@ -506,14 +509,14 @@ mod tests { ( 6, Some(CallPackageArgumentInfo { - relative_path: Some(PathBuf::from("file.nix")), + relative_path: Some(RelativePathBuf::from("file.nix")), empty_arg: true, }), ), ( 7, Some(CallPackageArgumentInfo { - relative_path: Some(PathBuf::from("file.nix")), + relative_path: Some(RelativePathBuf::from("file.nix")), empty_arg: true, }), ), @@ -527,7 +530,7 @@ mod tests { ( 9, Some(CallPackageArgumentInfo { - relative_path: Some(PathBuf::from("file.nix")), + relative_path: Some(RelativePathBuf::from("file.nix")), empty_arg: false, }), ), diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index 498284ac6f24..f9e232b93933 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -2,139 +2,140 @@ use crate::structure; use crate::utils::PACKAGE_NIX_FILENAME; use indoc::writedoc; use relative_path::RelativePath; +use relative_path::RelativePathBuf; use std::ffi::OsString; use std::fmt; -use std::path::Path; -use std::path::PathBuf; /// Any problem that can occur when checking Nixpkgs +/// All paths are relative to Nixpkgs such that the error messages can't be influenced by Nixpkgs absolute +/// location #[derive(Clone)] pub enum NixpkgsProblem { ShardNonDir { - relative_shard_path: PathBuf, + relative_shard_path: RelativePathBuf, }, InvalidShardName { - relative_shard_path: PathBuf, + relative_shard_path: RelativePathBuf, shard_name: String, }, PackageNonDir { - relative_package_dir: PathBuf, + relative_package_dir: RelativePathBuf, }, CaseSensitiveDuplicate { - relative_shard_path: PathBuf, + relative_shard_path: RelativePathBuf, first: OsString, second: OsString, }, InvalidPackageName { - relative_package_dir: PathBuf, + relative_package_dir: RelativePathBuf, package_name: String, }, IncorrectShard { - relative_package_dir: PathBuf, - correct_relative_package_dir: PathBuf, + relative_package_dir: RelativePathBuf, + correct_relative_package_dir: RelativePathBuf, }, PackageNixNonExistent { - relative_package_dir: PathBuf, + relative_package_dir: RelativePathBuf, }, PackageNixDir { - relative_package_dir: PathBuf, + relative_package_dir: RelativePathBuf, }, UndefinedAttr { - relative_package_file: PathBuf, + relative_package_file: RelativePathBuf, package_name: String, }, EmptyArgument { package_name: String, - file: PathBuf, + file: RelativePathBuf, line: usize, column: usize, definition: String, }, NonToplevelCallPackage { package_name: String, - file: PathBuf, + file: RelativePathBuf, line: usize, column: usize, definition: String, }, NonPath { package_name: String, - file: PathBuf, + file: RelativePathBuf, line: usize, column: usize, definition: String, }, WrongCallPackagePath { package_name: String, - file: PathBuf, + file: RelativePathBuf, line: usize, - actual_path: PathBuf, - expected_path: PathBuf, + actual_path: RelativePathBuf, + expected_path: RelativePathBuf, }, NonSyntacticCallPackage { package_name: String, - file: PathBuf, + file: RelativePathBuf, line: usize, column: usize, definition: String, }, NonDerivation { - relative_package_file: PathBuf, + relative_package_file: RelativePathBuf, package_name: String, }, OutsideSymlink { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, }, UnresolvableSymlink { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, io_error: String, }, PathInterpolation { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, line: usize, text: String, }, SearchPath { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, line: usize, text: String, }, OutsidePathReference { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, line: usize, text: String, }, UnresolvablePathReference { - relative_package_dir: PathBuf, - subpath: PathBuf, + relative_package_dir: RelativePathBuf, + subpath: RelativePathBuf, line: usize, text: String, io_error: String, }, MovedOutOfByNameEmptyArg { package_name: String, - call_package_path: Option, - file: PathBuf, + call_package_path: Option, + file: RelativePathBuf, }, MovedOutOfByNameNonEmptyArg { package_name: String, - call_package_path: Option, - file: PathBuf, + call_package_path: Option, + file: RelativePathBuf, }, NewPackageNotUsingByNameEmptyArg { package_name: String, - call_package_path: Option, - file: PathBuf, + call_package_path: Option, + file: RelativePathBuf, }, NewPackageNotUsingByNameNonEmptyArg { package_name: String, - call_package_path: Option, - file: PathBuf, + call_package_path: Option, + file: RelativePathBuf, }, InternalCallPackageUsed { attr_name: String, @@ -151,56 +152,56 @@ impl fmt::Display for NixpkgsProblem { write!( f, "{}: This is a file, but it should be a directory.", - relative_shard_path.display(), + relative_shard_path, ), NixpkgsProblem::InvalidShardName { relative_shard_path, shard_name } => write!( f, "{}: Invalid directory name \"{shard_name}\", must be at most 2 ASCII characters consisting of a-z, 0-9, \"-\" or \"_\".", - relative_shard_path.display() + relative_shard_path, ), NixpkgsProblem::PackageNonDir { relative_package_dir } => write!( f, "{}: This path is a file, but it should be a directory.", - relative_package_dir.display(), + relative_package_dir, ), NixpkgsProblem::CaseSensitiveDuplicate { relative_shard_path, first, second } => write!( f, "{}: Duplicate case-sensitive package directories {first:?} and {second:?}.", - relative_shard_path.display(), + relative_shard_path, ), NixpkgsProblem::InvalidPackageName { relative_package_dir, package_name } => write!( f, "{}: Invalid package directory name \"{package_name}\", must be ASCII characters consisting of a-z, A-Z, 0-9, \"-\" or \"_\".", - relative_package_dir.display(), + relative_package_dir, ), NixpkgsProblem::IncorrectShard { relative_package_dir, correct_relative_package_dir } => write!( f, "{}: Incorrect directory location, should be {} instead.", - relative_package_dir.display(), - correct_relative_package_dir.display(), + relative_package_dir, + correct_relative_package_dir, ), NixpkgsProblem::PackageNixNonExistent { relative_package_dir } => write!( f, "{}: Missing required \"{PACKAGE_NIX_FILENAME}\" file.", - relative_package_dir.display(), + relative_package_dir, ), NixpkgsProblem::PackageNixDir { relative_package_dir } => write!( f, "{}: \"{PACKAGE_NIX_FILENAME}\" must be a file.", - relative_package_dir.display(), + relative_package_dir, ), NixpkgsProblem::UndefinedAttr { relative_package_file, package_name } => write!( f, "pkgs.{package_name}: This attribute is not defined but it should be defined automatically as {}", - relative_package_file.display() + relative_package_file, ), NixpkgsProblem::EmptyArgument { package_name, file, line, column, definition } => writedoc!( @@ -216,9 +217,9 @@ impl fmt::Display for NixpkgsProblem { Such a definition is provided automatically and therefore not necessary. Please remove it. ", - structure::relative_dir_for_package(package_name).display(), - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_dir_for_package(package_name), + structure::relative_file_for_package(package_name), + file, line, indent_definition(*column, definition.clone()), ), @@ -234,9 +235,9 @@ impl fmt::Display for NixpkgsProblem { {} ", - structure::relative_dir_for_package(package_name).display(), - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_dir_for_package(package_name), + structure::relative_file_for_package(package_name), + file, line, indent_definition(*column, definition.clone()), ), @@ -252,9 +253,9 @@ impl fmt::Display for NixpkgsProblem { {} ", - structure::relative_dir_for_package(package_name).display(), - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_dir_for_package(package_name), + structure::relative_file_for_package(package_name), + file, line, indent_definition(*column, definition.clone()), ), @@ -270,9 +271,9 @@ impl fmt::Display for NixpkgsProblem { {package_name} = callPackage {} {{ /* ... */ }}; ", - structure::relative_dir_for_package(package_name).display(), + structure::relative_dir_for_package(package_name), create_path_expr(file, expected_path), - file.display(), line, + file, line, create_path_expr(file, actual_path), }, NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => { @@ -287,9 +288,9 @@ impl fmt::Display for NixpkgsProblem { {} ", - structure::relative_dir_for_package(package_name).display(), - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_dir_for_package(package_name), + structure::relative_file_for_package(package_name), + file, line, indent_definition(*column, definition.clone()), ) @@ -298,58 +299,58 @@ impl fmt::Display for NixpkgsProblem { write!( f, "pkgs.{package_name}: This attribute defined by {} is not a derivation", - relative_package_file.display() + relative_package_file, ), NixpkgsProblem::OutsideSymlink { relative_package_dir, subpath } => write!( f, "{}: Path {} is a symlink pointing to a path outside the directory of that package.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, ), NixpkgsProblem::UnresolvableSymlink { relative_package_dir, subpath, io_error } => write!( f, "{}: Path {} is a symlink which cannot be resolved: {io_error}.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, ), NixpkgsProblem::PathInterpolation { relative_package_dir, subpath, line, text } => write!( f, "{}: File {} at line {line} contains the path expression \"{}\", which is not yet supported and may point outside the directory of that package.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, text ), NixpkgsProblem::SearchPath { relative_package_dir, subpath, line, text } => write!( f, "{}: File {} at line {line} contains the nix search path expression \"{}\" which may point outside the directory of that package.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, text ), NixpkgsProblem::OutsidePathReference { relative_package_dir, subpath, line, text } => write!( f, "{}: File {} at line {line} contains the path expression \"{}\" which may point outside the directory of that package.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, text, ), NixpkgsProblem::UnresolvablePathReference { relative_package_dir, subpath, line, text, io_error } => write!( f, "{}: File {} at line {line} contains the path expression \"{}\" which cannot be resolved: {io_error}.", - relative_package_dir.display(), - subpath.display(), + relative_package_dir, + subpath, text, ), NixpkgsProblem::MovedOutOfByNameEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { - format!("./{}", path.display()) + format!("./{}", path) } else { "...".into() }; @@ -359,14 +360,14 @@ impl fmt::Display for NixpkgsProblem { - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {}. Please move the package back and remove the manual `callPackage`. ", - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_file_for_package(package_name), + file, ) }, NixpkgsProblem::MovedOutOfByNameNonEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { - format!("./{}", path.display()) + format!("./{}", path) } else { "...".into() }; @@ -378,14 +379,14 @@ impl fmt::Display for NixpkgsProblem { - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {}. While the manual `callPackage` is still needed, it's not necessary to move the package files. ", - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_file_for_package(package_name), + file, ) }, NixpkgsProblem::NewPackageNotUsingByNameEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { - format!("./{}", path.display()) + format!("./{}", path) } else { "...".into() }; @@ -397,14 +398,14 @@ impl fmt::Display for NixpkgsProblem { See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {} is needed anymore. ", - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_file_for_package(package_name), + file, ) }, NixpkgsProblem::NewPackageNotUsingByNameNonEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { - format!("./{}", path.display()) + format!("./{}", path) } else { "...".into() }; @@ -416,8 +417,8 @@ impl fmt::Display for NixpkgsProblem { See `pkgs/by-name/README.md` for more details. Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {} is still needed. ", - structure::relative_file_for_package(package_name).display(), - file.display(), + structure::relative_file_for_package(package_name), + file, ) }, NixpkgsProblem::InternalCallPackageUsed { attr_name } => @@ -448,14 +449,13 @@ fn indent_definition(column: usize, definition: String) -> String { } /// Creates a Nix path expression that when put into Nix file `from_file`, would point to the `to_file`. -fn create_path_expr(from_file: impl AsRef, to_file: impl AsRef) -> String { - // These `expect` calls should never trigger because we only call this function with - // relative paths that have a parent. That's why we `expect` them! - let from = RelativePath::from_path(&from_file) - .expect("a relative path") - .parent() - .expect("a parent for this path"); - let to = RelativePath::from_path(&to_file).expect("a path"); - let rel = from.relative(to); +fn create_path_expr( + from_file: impl AsRef, + to_file: impl AsRef, +) -> String { + // This `expect` calls should never trigger because we only call this function with files. + // That's why we `expect` them! + let from = from_file.as_ref().parent().expect("a parent for this path"); + let rel = from.relative(to_file); format!("./{rel}") } diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index eed5071a5a2a..8136d641c351 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -5,8 +5,8 @@ use crate::nix_file::CallPackageArgumentInfo; use crate::nixpkgs_problem::NixpkgsProblem; use crate::validation::{self, Validation, Validation::Success}; +use relative_path::RelativePathBuf; use std::collections::HashMap; -use std::path::PathBuf; /// The ratchet value for the entirety of Nixpkgs. #[derive(Default)] @@ -146,7 +146,7 @@ impl ToNixpkgsProblem for ManualDefinition { pub enum UsesByName {} impl ToNixpkgsProblem for UsesByName { - type ToContext = (CallPackageArgumentInfo, PathBuf); + type ToContext = (CallPackageArgumentInfo, RelativePathBuf); fn to_nixpkgs_problem( name: &str, diff --git a/pkgs/test/nixpkgs-check-by-name/src/references.rs b/pkgs/test/nixpkgs-check-by-name/src/references.rs index b716b99099c4..e2319163ccc6 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/references.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/references.rs @@ -2,6 +2,7 @@ use crate::nixpkgs_problem::NixpkgsProblem; use crate::utils; use crate::validation::{self, ResultIteratorExt, Validation::Success}; use crate::NixFileStore; +use relative_path::RelativePath; use anyhow::Context; use rowan::ast::AstNode; @@ -12,14 +13,14 @@ use std::path::Path; /// Both symlinks and Nix path expressions are checked. pub fn check_references( nix_file_store: &mut NixFileStore, - relative_package_dir: &Path, + relative_package_dir: &RelativePath, absolute_package_dir: &Path, ) -> validation::Result<()> { // The first subpath to check is the package directory itself, which we can represent as an // empty path, since the absolute package directory gets prepended to this. // We don't use `./.` to keep the error messages cleaner // (there's no canonicalisation going on underneath) - let subpath = Path::new(""); + let subpath = RelativePath::new(""); check_path( nix_file_store, relative_package_dir, @@ -29,7 +30,7 @@ pub fn check_references( .with_context(|| { format!( "While checking the references in package directory {}", - relative_package_dir.display() + relative_package_dir ) }) } @@ -41,11 +42,11 @@ pub fn check_references( /// The absolute package directory gets prepended before doing anything with it though. fn check_path( nix_file_store: &mut NixFileStore, - relative_package_dir: &Path, + relative_package_dir: &RelativePath, absolute_package_dir: &Path, - subpath: &Path, + subpath: &RelativePath, ) -> validation::Result<()> { - let path = absolute_package_dir.join(subpath); + let path = subpath.to_path(absolute_package_dir); Ok(if path.is_symlink() { // Check whether the symlink resolves to outside the package directory @@ -55,8 +56,8 @@ fn check_path( // entire directory recursively anyways if let Err(_prefix_error) = target.strip_prefix(absolute_package_dir) { NixpkgsProblem::OutsideSymlink { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), } .into() } else { @@ -64,8 +65,8 @@ fn check_path( } } Err(io_error) => NixpkgsProblem::UnresolvableSymlink { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), io_error: io_error.to_string(), } .into(), @@ -80,11 +81,12 @@ fn check_path( nix_file_store, relative_package_dir, absolute_package_dir, - &subpath.join(entry.file_name()), + // TODO: The relative_path crate doesn't seem to support OsStr + &subpath.join(entry.file_name().to_string_lossy().to_string()), ) }) .collect_vec() - .with_context(|| format!("Error while recursing into {}", subpath.display()))?, + .with_context(|| format!("Error while recursing into {}", subpath))?, ) } else if path.is_file() { // Only check Nix files @@ -96,7 +98,7 @@ fn check_path( absolute_package_dir, subpath, ) - .with_context(|| format!("Error while checking Nix file {}", subpath.display()))? + .with_context(|| format!("Error while checking Nix file {}", subpath))? } else { Success(()) } @@ -105,7 +107,7 @@ fn check_path( } } else { // This should never happen, git doesn't support other file types - anyhow::bail!("Unsupported file type for path {}", subpath.display()); + anyhow::bail!("Unsupported file type for path {}", subpath); }) } @@ -113,11 +115,11 @@ fn check_path( /// directory fn check_nix_file( nix_file_store: &mut NixFileStore, - relative_package_dir: &Path, + relative_package_dir: &RelativePath, absolute_package_dir: &Path, - subpath: &Path, + subpath: &RelativePath, ) -> validation::Result<()> { - let path = absolute_package_dir.join(subpath); + let path = subpath.to_path(absolute_package_dir); let nix_file = nix_file_store.get(&path)?; @@ -135,29 +137,29 @@ fn check_nix_file( match nix_file.static_resolve_path(path, absolute_package_dir) { ResolvedPath::Interpolated => NixpkgsProblem::PathInterpolation { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), line, text, } .into(), ResolvedPath::SearchPath => NixpkgsProblem::SearchPath { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), line, text, } .into(), ResolvedPath::Outside => NixpkgsProblem::OutsidePathReference { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), line, text, } .into(), ResolvedPath::Unresolvable(e) => NixpkgsProblem::UnresolvablePathReference { - relative_package_dir: relative_package_dir.to_path_buf(), - subpath: subpath.to_path_buf(), + relative_package_dir: relative_package_dir.to_owned(), + subpath: subpath.to_owned(), line, text, io_error: e.to_string(), diff --git a/pkgs/test/nixpkgs-check-by-name/src/structure.rs b/pkgs/test/nixpkgs-check-by-name/src/structure.rs index 9b615dd9969a..09806bc3d4dc 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/structure.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/structure.rs @@ -7,8 +7,9 @@ use crate::NixFileStore; use itertools::concat; use lazy_static::lazy_static; use regex::Regex; +use relative_path::RelativePathBuf; use std::fs::DirEntry; -use std::path::{Path, PathBuf}; +use std::path::Path; lazy_static! { static ref SHARD_NAME_REGEX: Regex = Regex::new(r"^[a-z0-9_-]{1,2}$").unwrap(); @@ -21,15 +22,15 @@ pub fn shard_for_package(package_name: &str) -> String { package_name.to_lowercase().chars().take(2).collect() } -pub fn relative_dir_for_shard(shard_name: &str) -> PathBuf { - PathBuf::from(format!("{BASE_SUBPATH}/{shard_name}")) +pub fn relative_dir_for_shard(shard_name: &str) -> RelativePathBuf { + RelativePathBuf::from(format!("{BASE_SUBPATH}/{shard_name}")) } -pub fn relative_dir_for_package(package_name: &str) -> PathBuf { +pub fn relative_dir_for_package(package_name: &str) -> RelativePathBuf { relative_dir_for_shard(&shard_for_package(package_name)).join(package_name) } -pub fn relative_file_for_package(package_name: &str) -> PathBuf { +pub fn relative_file_for_package(package_name: &str) -> RelativePathBuf { relative_dir_for_package(package_name).join(PACKAGE_NIX_FILENAME) } @@ -120,7 +121,8 @@ fn check_package( ) -> validation::Result { let package_path = package_entry.path(); let package_name = package_entry.file_name().to_string_lossy().into_owned(); - let relative_package_dir = PathBuf::from(format!("{BASE_SUBPATH}/{shard_name}/{package_name}")); + let relative_package_dir = + RelativePathBuf::from(format!("{BASE_SUBPATH}/{shard_name}/{package_name}")); Ok(if !package_path.is_dir() { NixpkgsProblem::PackageNonDir { @@ -174,7 +176,7 @@ fn check_package( let result = result.and(references::check_references( nix_file_store, &relative_package_dir, - &path.join(&relative_package_dir), + &relative_package_dir.to_path(path), )?); result.map(|_| package_name.clone()) From fb0a07229f81417b90cbb05d6522dbc4c654fb76 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 1 Mar 2024 02:41:02 +0100 Subject: [PATCH 183/186] tests.nixpkgs-check-by-name: More inline format! arguments Now that the previous commit removed all the .display()'s that were previously necessary for PathBuf's, but now aren't for RelativePathBuf, we can also inline the format! arguments --- .../src/nixpkgs_problem.rs | 188 +++++++----------- 1 file changed, 76 insertions(+), 112 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs index f9e232b93933..7e257c0ed5d8 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/nixpkgs_problem.rs @@ -151,218 +151,185 @@ impl fmt::Display for NixpkgsProblem { NixpkgsProblem::ShardNonDir { relative_shard_path } => write!( f, - "{}: This is a file, but it should be a directory.", - relative_shard_path, + "{relative_shard_path}: This is a file, but it should be a directory.", ), NixpkgsProblem::InvalidShardName { relative_shard_path, shard_name } => write!( f, - "{}: Invalid directory name \"{shard_name}\", must be at most 2 ASCII characters consisting of a-z, 0-9, \"-\" or \"_\".", - relative_shard_path, + "{relative_shard_path}: Invalid directory name \"{shard_name}\", must be at most 2 ASCII characters consisting of a-z, 0-9, \"-\" or \"_\".", ), NixpkgsProblem::PackageNonDir { relative_package_dir } => write!( f, - "{}: This path is a file, but it should be a directory.", - relative_package_dir, + "{relative_package_dir}: This path is a file, but it should be a directory.", ), NixpkgsProblem::CaseSensitiveDuplicate { relative_shard_path, first, second } => write!( f, - "{}: Duplicate case-sensitive package directories {first:?} and {second:?}.", - relative_shard_path, + "{relative_shard_path}: Duplicate case-sensitive package directories {first:?} and {second:?}.", ), NixpkgsProblem::InvalidPackageName { relative_package_dir, package_name } => write!( f, - "{}: Invalid package directory name \"{package_name}\", must be ASCII characters consisting of a-z, A-Z, 0-9, \"-\" or \"_\".", - relative_package_dir, + "{relative_package_dir}: Invalid package directory name \"{package_name}\", must be ASCII characters consisting of a-z, A-Z, 0-9, \"-\" or \"_\".", ), NixpkgsProblem::IncorrectShard { relative_package_dir, correct_relative_package_dir } => write!( f, - "{}: Incorrect directory location, should be {} instead.", - relative_package_dir, - correct_relative_package_dir, + "{relative_package_dir}: Incorrect directory location, should be {correct_relative_package_dir} instead.", ), NixpkgsProblem::PackageNixNonExistent { relative_package_dir } => write!( f, - "{}: Missing required \"{PACKAGE_NIX_FILENAME}\" file.", - relative_package_dir, + "{relative_package_dir}: Missing required \"{PACKAGE_NIX_FILENAME}\" file.", ), NixpkgsProblem::PackageNixDir { relative_package_dir } => write!( f, - "{}: \"{PACKAGE_NIX_FILENAME}\" must be a file.", - relative_package_dir, + "{relative_package_dir}: \"{PACKAGE_NIX_FILENAME}\" must be a file.", ), NixpkgsProblem::UndefinedAttr { relative_package_file, package_name } => write!( f, - "pkgs.{package_name}: This attribute is not defined but it should be defined automatically as {}", - relative_package_file, + "pkgs.{package_name}: This attribute is not defined but it should be defined automatically as {relative_package_file}", ), - NixpkgsProblem::EmptyArgument { package_name, file, line, column, definition } => + NixpkgsProblem::EmptyArgument { package_name, file, line, column, definition } => { + let relative_package_dir = structure::relative_dir_for_package(package_name); + let relative_package_file = structure::relative_file_for_package(package_name); + let indented_definition = indent_definition(*column, definition.clone()); writedoc!( f, " - - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + - Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage ./{} {{ /* ... */ }}; + {package_name} = callPackage ./{relative_package_file} {{ /* ... */ }}; - However, in this PR, the second argument is empty. See the definition in {}:{}: + However, in this PR, the second argument is empty. See the definition in {file}:{line}: - {} + {indented_definition} Such a definition is provided automatically and therefore not necessary. Please remove it. ", - structure::relative_dir_for_package(package_name), - structure::relative_file_for_package(package_name), - file, - line, - indent_definition(*column, definition.clone()), - ), - NixpkgsProblem::NonToplevelCallPackage { package_name, file, line, column, definition } => + ) + } + NixpkgsProblem::NonToplevelCallPackage { package_name, file, line, column, definition } => { + let relative_package_dir = structure::relative_dir_for_package(package_name); + let relative_package_file = structure::relative_file_for_package(package_name); + let indented_definition = indent_definition(*column, definition.clone()); writedoc!( f, " - - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + - Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage ./{} {{ /* ... */ }}; + {package_name} = callPackage ./{relative_package_file} {{ /* ... */ }}; - However, in this PR, a different `callPackage` is used. See the definition in {}:{}: + However, in this PR, a different `callPackage` is used. See the definition in {file}:{line}: - {} + {indented_definition} ", - structure::relative_dir_for_package(package_name), - structure::relative_file_for_package(package_name), - file, - line, - indent_definition(*column, definition.clone()), - ), - NixpkgsProblem::NonPath { package_name, file, line, column, definition } => + ) + } + NixpkgsProblem::NonPath { package_name, file, line, column, definition } => { + let relative_package_dir = structure::relative_dir_for_package(package_name); + let relative_package_file = structure::relative_file_for_package(package_name); + let indented_definition = indent_definition(*column, definition.clone()); writedoc!( f, " - - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + - Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage ./{} {{ /* ... */ }}; + {package_name} = callPackage ./{relative_package_file} {{ /* ... */ }}; - However, in this PR, the first `callPackage` argument is not a path. See the definition in {}:{}: + However, in this PR, the first `callPackage` argument is not a path. See the definition in {file}:{line}: - {} + {indented_definition} ", - structure::relative_dir_for_package(package_name), - structure::relative_file_for_package(package_name), - file, - line, - indent_definition(*column, definition.clone()), - ), - NixpkgsProblem::WrongCallPackagePath { package_name, file, line, actual_path, expected_path } => + ) + } + NixpkgsProblem::WrongCallPackagePath { package_name, file, line, actual_path, expected_path } => { + let relative_package_dir = structure::relative_dir_for_package(package_name); + let expected_path_expr = create_path_expr(file, expected_path); + let actual_path_expr = create_path_expr(file, actual_path); writedoc! { f, " - - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + - Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage {} {{ /* ... */ }}; + {package_name} = callPackage {expected_path_expr} {{ /* ... */ }}; - However, in this PR, the first `callPackage` argument is the wrong path. See the definition in {}:{}: + However, in this PR, the first `callPackage` argument is the wrong path. See the definition in {file}:{line}: - {package_name} = callPackage {} {{ /* ... */ }}; + {package_name} = callPackage {actual_path_expr} {{ /* ... */ }}; ", - structure::relative_dir_for_package(package_name), - create_path_expr(file, expected_path), - file, line, - create_path_expr(file, actual_path), - }, + } + } NixpkgsProblem::NonSyntacticCallPackage { package_name, file, line, column, definition } => { + let relative_package_dir = structure::relative_dir_for_package(package_name); + let relative_package_file = structure::relative_file_for_package(package_name); + let indented_definition = indent_definition(*column, definition.clone()); writedoc!( f, " - - Because {} exists, the attribute `pkgs.{package_name}` must be defined like + - Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like - {package_name} = callPackage ./{} {{ /* ... */ }}; + {package_name} = callPackage ./{relative_package_file} {{ /* ... */ }}; - However, in this PR, it isn't defined that way. See the definition in {}:{} + However, in this PR, it isn't defined that way. See the definition in {file}:{line} - {} + {indented_definition} ", - structure::relative_dir_for_package(package_name), - structure::relative_file_for_package(package_name), - file, - line, - indent_definition(*column, definition.clone()), ) } NixpkgsProblem::NonDerivation { relative_package_file, package_name } => write!( f, - "pkgs.{package_name}: This attribute defined by {} is not a derivation", - relative_package_file, + "pkgs.{package_name}: This attribute defined by {relative_package_file} is not a derivation", ), NixpkgsProblem::OutsideSymlink { relative_package_dir, subpath } => write!( f, - "{}: Path {} is a symlink pointing to a path outside the directory of that package.", - relative_package_dir, - subpath, + "{relative_package_dir}: Path {subpath} is a symlink pointing to a path outside the directory of that package.", ), NixpkgsProblem::UnresolvableSymlink { relative_package_dir, subpath, io_error } => write!( f, - "{}: Path {} is a symlink which cannot be resolved: {io_error}.", - relative_package_dir, - subpath, + "{relative_package_dir}: Path {subpath} is a symlink which cannot be resolved: {io_error}.", ), NixpkgsProblem::PathInterpolation { relative_package_dir, subpath, line, text } => write!( f, - "{}: File {} at line {line} contains the path expression \"{}\", which is not yet supported and may point outside the directory of that package.", - relative_package_dir, - subpath, - text + "{relative_package_dir}: File {subpath} at line {line} contains the path expression \"{text}\", which is not yet supported and may point outside the directory of that package.", ), NixpkgsProblem::SearchPath { relative_package_dir, subpath, line, text } => write!( f, - "{}: File {} at line {line} contains the nix search path expression \"{}\" which may point outside the directory of that package.", - relative_package_dir, - subpath, - text + "{relative_package_dir}: File {subpath} at line {line} contains the nix search path expression \"{text}\" which may point outside the directory of that package.", ), NixpkgsProblem::OutsidePathReference { relative_package_dir, subpath, line, text } => write!( f, - "{}: File {} at line {line} contains the path expression \"{}\" which may point outside the directory of that package.", - relative_package_dir, - subpath, - text, + "{relative_package_dir}: File {subpath} at line {line} contains the path expression \"{text}\" which may point outside the directory of that package.", ), NixpkgsProblem::UnresolvablePathReference { relative_package_dir, subpath, line, text, io_error } => write!( f, - "{}: File {} at line {line} contains the path expression \"{}\" which cannot be resolved: {io_error}.", - relative_package_dir, - subpath, - text, + "{relative_package_dir}: File {subpath} at line {line} contains the path expression \"{text}\" which cannot be resolved: {io_error}.", ), NixpkgsProblem::MovedOutOfByNameEmptyArg { package_name, call_package_path, file } => { let call_package_arg = if let Some(path) = &call_package_path { - format!("./{}", path) + format!("./{path}") } else { "...".into() }; + let relative_package_file = structure::relative_file_for_package(package_name); writedoc!( f, " - - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {}. + - Attribute `pkgs.{package_name}` was previously defined in {relative_package_file}, but is now manually defined as `callPackage {call_package_arg} {{ /* ... */ }}` in {file}. Please move the package back and remove the manual `callPackage`. ", - structure::relative_file_for_package(package_name), - file, - ) + ) }, NixpkgsProblem::MovedOutOfByNameNonEmptyArg { package_name, call_package_path, file } => { let call_package_arg = @@ -371,17 +338,16 @@ impl fmt::Display for NixpkgsProblem { } else { "...".into() }; + let relative_package_file = structure::relative_file_for_package(package_name); // This can happen if users mistakenly assume that for custom arguments, // pkgs/by-name can't be used. writedoc!( f, " - - Attribute `pkgs.{package_name}` was previously defined in {}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {}. + - Attribute `pkgs.{package_name}` was previously defined in {relative_package_file}, but is now manually defined as `callPackage {call_package_arg} {{ ... }}` in {file}. While the manual `callPackage` is still needed, it's not necessary to move the package files. ", - structure::relative_file_for_package(package_name), - file, - ) + ) }, NixpkgsProblem::NewPackageNotUsingByNameEmptyArg { package_name, call_package_path, file } => { let call_package_arg = @@ -390,16 +356,15 @@ impl fmt::Display for NixpkgsProblem { } else { "...".into() }; + let relative_package_file = structure::relative_file_for_package(package_name); writedoc!( f, " - Attribute `pkgs.{package_name}` is a new top-level package using `pkgs.callPackage {call_package_arg} {{ /* ... */ }}`. - Please define it in {} instead. + Please define it in {relative_package_file} instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {} is needed anymore. + Since the second `callPackage` argument is `{{ }}`, no manual `callPackage` in {file} is needed anymore. ", - structure::relative_file_for_package(package_name), - file, ) }, NixpkgsProblem::NewPackageNotUsingByNameNonEmptyArg { package_name, call_package_path, file } => { @@ -409,16 +374,15 @@ impl fmt::Display for NixpkgsProblem { } else { "...".into() }; + let relative_package_file = structure::relative_file_for_package(package_name); writedoc!( f, " - Attribute `pkgs.{package_name}` is a new top-level package using `pkgs.callPackage {call_package_arg} {{ /* ... */ }}`. - Please define it in {} instead. + Please define it in {relative_package_file} instead. See `pkgs/by-name/README.md` for more details. - Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {} is still needed. + Since the second `callPackage` argument is not `{{ }}`, the manual `callPackage` in {file} is still needed. ", - structure::relative_file_for_package(package_name), - file, ) }, NixpkgsProblem::InternalCallPackageUsed { attr_name } => From 6eef1793ca4a066f6ad20a46bcd9b44b538940d6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 1 Mar 2024 22:48:18 +0000 Subject: [PATCH 184/186] distrobuilder.tests: update `incus.container` reference Without the change the test build attempt fails the evaluation as: $ nix build --no-link -f. distrobuilder.tests.incus error: attribute 'container' missing at pkgs/tools/virtualization/distrobuilder/default.nix:54:19: 53| passthru = { 54| tests.incus = nixosTests.incus.container; | ^ This started happening after `container` test was split in two in c607e70f7053 "nixosTests.incus: add test with old and new init". --- pkgs/tools/virtualization/distrobuilder/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/virtualization/distrobuilder/default.nix b/pkgs/tools/virtualization/distrobuilder/default.nix index da2f1a909156..fb08c7110039 100644 --- a/pkgs/tools/virtualization/distrobuilder/default.nix +++ b/pkgs/tools/virtualization/distrobuilder/default.nix @@ -51,7 +51,10 @@ buildGoModule rec { ''; passthru = { - tests.incus = nixosTests.incus.container; + tests = { + incus-old-init = nixosTests.incus.container-old-init; + incus-new-init = nixosTests.incus.container-new-init; + }; generator = callPackage ./generator.nix { inherit src version; }; }; From 520456e9053da088ca8a4dc8eec28601e9415203 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Mar 2024 21:04:27 -0500 Subject: [PATCH 185/186] qt6Packages.fcitx5-qt: fix repo in fetchFromGitHub --- pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix index 5311d20ffa32..b0cd6dc6d59b 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "fcitx"; - repo = pname; + repo = "fcitx5-qt"; rev = version; sha256 = "sha256-bVH2US/uEZGERslnAh/fyUbzR9fK1UfG4J+mOmrIE8Y="; }; From 25bf31036f2d95aa707a9c368a5b899dff02cec0 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Mar 2024 21:10:20 -0500 Subject: [PATCH 186/186] vamp-plugin-sdk: fix owner in fetchFromGitHub --- pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix b/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix index 65ce6580dcec..198d94dbee7e 100644 --- a/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix +++ b/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix @@ -8,10 +8,10 @@ stdenv.mkDerivation rec { version = "2.10"; src = fetchFromGitHub { - owner = "c4dm"; + owner = "vamp-plugins"; repo = "vamp-plugin-sdk"; rev = "vamp-plugin-sdk-v${version}"; - sha256 = "1lhmskcyk7qqfikmasiw7wjry74gc8g5q6a3j1iya84yd7ll0cz6"; + hash = "sha256-5jNA6WmeIOVjkEMZXB5ijxyfJT88alVndBif6dnUFdI="; }; nativeBuildInputs = [ pkg-config ];