From 8ba43324cde2da5e1660044be10c0f3331e86491 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 8 Feb 2025 17:04:07 +0100 Subject: [PATCH] Fix build with latest Lix, use CLang Contrary to what I had in mind, this wasn't the case yet and caused a bunch of compilation failures with latest Lix main. --- .envrc | 2 +- flake.lock | 14 +++++++------- flake.nix | 4 ++-- src/hydra-queue-runner/hydra-queue-runner.cc | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.envrc b/.envrc index 4359d1f66..bc49353db 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake .#clang +use flake .# diff --git a/flake.lock b/flake.lock index 394844e88..4fb3b4dba 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1738174211, - "narHash": "sha256-eYmp1mKM4kULV1W+EBtCPk6LmKWl2REivaYfGRl+AWo=", + "lastModified": 1739016888, + "narHash": "sha256-JUOvTAYx+/bAec9H7C/nnpT1NRm/6tdy5EZ/XuUGHlA=", "ref": "refs/heads/main", - "rev": "64e33a7e09a0d1faacf2fd3f6ebd647fe4d8346a", - "revCount": 17329, + "rev": "72326c404487bbf8dc6ee069930c6c2a0319857e", + "revCount": 17371, "type": "git", "url": "https://git.lix.systems/lix-project/lix" }, @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737672001, - "narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=", + "lastModified": 1738843498, + "narHash": "sha256-7x+Q4xgFj9UxZZO9aUDCR8h4vyYut4zPUvfj3i+jBHE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8", + "rev": "f5a32fa27df91dfc4b762671a0e0a859a8a0058f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2f7bef08f..fd17a4b6f 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ hydra = final.callPackage ./package.nix { inherit (final.lib) fileset; rawSrc = self; + stdenv = final.clangStdenv; }; }; @@ -79,8 +80,7 @@ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) pkgs.clang-tools; }; in { - default = mkDevShell pkgs.stdenv; - clang = mkDevShell pkgs.clangStdenv; + default = mkDevShell pkgs.clangStdenv; }); nixosModules = import ./nixos-modules { diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index c09be0108..7d788a3b1 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -596,7 +596,7 @@ std::shared_ptr State::acquireGlobalLock() createDirs(dirOf(lockPath)); auto lock = std::make_shared(); - if (!lock->lockPaths(PathSet({lockPath}), "", false)) return nullptr; + if (!lock->tryLockPaths(PathSet({lockPath}))) return nullptr; return lock; }