packages feed

hercules-ci-cnix-store 0.3.6.1 → 0.3.7.0

raw patch · 10 files changed

+96/−36 lines, 10 files

Files

CHANGELOG.md view
@@ -5,6 +5,13 @@  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 0.3.7.0 - 2025-05-05++### Added++ - `getMaxBuildJobs`+ - Nix 2.28 support+ ## 0.3.6.1 - 2024-11-15  ### Added
hercules-ci-cnix-store.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4  name:           hercules-ci-cnix-store-version:        0.3.6.1+version:        0.3.7.0 synopsis:       Haskell bindings for Nix's libstore category:       Nix homepage:       https://docs.hercules-ci.com@@ -95,8 +95,8 @@   include-dirs:       include   pkgconfig-depends:-      nix-store (>= 2.4 && < 2.19) || (>= 2.19.3 && < 2.21) || (>= 2.24.10 && < 2.25)-    , nix-main >= 2.4 && < 2.19 || (>= 2.19.3 && < 2.21) || (>= 2.24.10 && < 2.25)+      nix-store (>= 2.4 && < 2.19) || (>= 2.19.3 && < 2.21) || (>= 2.24.10 && < 2.25) || (>= 2.28 && < 2.29)+    , nix-main >= 2.4 && < 2.19 || (>= 2.19.3 && < 2.21) || (>= 2.24.10 && < 2.25) || (>= 2.28 && < 2.29)   install-includes:       hercules-ci-cnix/store.hxx       hercules-ci-cnix/string.hxx
include/hercules-ci-cnix/store.hxx view
@@ -1,7 +1,11 @@  #pragma once +#if NIX_IS_AT_LEAST(2,28,0)+#include <nix/store/path-info.hh>+#else #include <nix/path-info.hh>+#endif  typedef nix::ref<nix::Store> refStore; 
src/Hercules/CNix.hs view
@@ -34,42 +34,36 @@  C.context context -C.include "<stdio.h>"+#if NIX_IS_AT_LEAST(2, 28, 0) -C.include "<cstring>"+C.include "<nix/util/config-global.hh>"+C.include "<nix/store/derivations.hh>"+C.include "<nix/store/globals.hh>"+C.include "<nix/main/shared.hh>" +#else+C.include "<stdio.h>"+C.include "<cstring>" C.include "<math.h>"- C.include "<nix/config.h>"- C.include "<nix/shared.hh>"- C.include "<nix/store-api.hh>"- C.include "<nix/get-drvs.hh>"- C.include "<nix/derivations.hh>"- C.include "<nix/globals.hh>"--C.include "hercules-ci-cnix/store.hxx"+#  if NIX_IS_AT_LEAST(2, 24, 0)+C.include "<config-global.hh>"+#  endif+#endif  C.include "<gc/gc.h>"- C.include "<gc/gc_cpp.h>"- C.include "<gc/gc_allocator.h>" -#if NIX_IS_AT_LEAST(2, 24, 0)--C.include "<config-global.hh>"--#endif- C.include "hercules-ci-cnix/string.hxx"+C.include "hercules-ci-cnix/store.hxx"  C.using "namespace nix"- C.using "namespace hercules_ci_cnix"  init :: IO ()
src/Hercules/CNix/Exception.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} @@ -16,9 +17,14 @@  C.context context +#if NIX_IS_AT_LEAST(2, 28, 0)+C.include "<nix/main/shared.hh>"+C.include "<nix/store/globals.hh>"+#else C.include "<nix/config.h>" C.include "<nix/shared.hh>" C.include "<nix/globals.hh>"+#endif  -- | Log C++ exceptions and call 'exitWith' the way Nix would exit when an -- exception occurs.
src/Hercules/CNix/Settings.hs view
@@ -7,6 +7,7 @@   ( getExtraPlatforms,     getSystem,     getSystemFeatures,+    getMaxBuildJobs,     getSubstituters,     getTrustedPublicKeys,     getNarinfoCacheNegativeTtl,@@ -36,10 +37,16 @@   )  C.include "<cstring>"-C.include "<nix/config.h>"-C.include "<nix/globals.hh>" C.include "<set>" C.include "<string>"++#if NIX_IS_AT_LEAST(2, 28, 0)+C.include "<nix/store/globals.hh>"+#else+C.include "<nix/config.h>"+C.include "<nix/globals.hh>"+#endif+ C.include "hercules-ci-cnix/string.hxx"  C.using "namespace hercules_ci_cnix"@@ -79,6 +86,16 @@     [C.block| std::set<std::string>*{       return new nix::StringSet(nix::settings.systemFeatures.get());     }|]++getMaxBuildJobs :: IO Word+getMaxBuildJobs = do+  n <-+    [C.block| unsigned int {+      return nix::settings.maxBuildJobs.get();+    }|]+  if (fromIntegral n :: Integer) > (fromIntegral (maxBound :: Word))+    then panic ("Nix max-jobs is too large. Can't continue. Value: " <> show n :: Text)+    else pure (fromIntegral n)  getSubstituters :: IO [ByteString] getSubstituters =
src/Hercules/CNix/Store.hs view
@@ -187,6 +187,21 @@  C.include "<cstring>" +C.include "<variant>"++#if NIX_IS_AT_LEAST(2, 28, 0)++C.include "<nix/main/shared.hh>"+C.include "<nix/store/store-api.hh>"+C.include "<nix/store/derivations.hh>"+C.include "<nix/store/globals.hh>"+C.include "<nix/store/path.hh>"+C.include "<nix/store/worker-protocol.hh>"+C.include "<nix/store/path-with-outputs.hh>"+C.include "<nix/util/signals.hh>"++#else+ C.include "<nix/config.h>"  C.include "<nix/shared.hh>"@@ -201,31 +216,30 @@  C.include "<nix/path.hh>" -C.include "<variant>"- C.include "<nix/worker-protocol.hh>"  C.include "<nix/path-with-outputs.hh>"  C.include "<nix/hash.hh>" -C.include "hercules-ci-cnix/store.hxx"--C.include "hercules-ci-cnix/string.hxx"--#if NIX_IS_AT_LEAST(2,19,0)+#  if NIX_IS_AT_LEAST(2,19,0)  C.include "<nix/signals.hh>"  C.include "<nix/hash.hh>" -#endif+#  endif -#if ! NIX_IS_AT_LEAST(2,20,0)+#  if ! NIX_IS_AT_LEAST(2,20,0)  C.include "<nix/nar-info-disk-cache.hh>" +#  endif #endif++C.include "hercules-ci-cnix/store.hxx"++C.include "hercules-ci-cnix/string.hxx"  C.using "namespace nix" 
src/Hercules/CNix/Store/Instances.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-orphans #-}@@ -16,9 +17,15 @@  C.context $ context <> stdVectorCtx <> stdSetCtx +#if NIX_IS_AT_LEAST(2, 28, 0)+C.include "<nix/store/path.hh>"+C.include "<nix/store/derivations.hh>"+C.include "<nix/store/path-with-outputs.hh>"+#else C.include "<nix/path.hh>" C.include "<nix/derivations.hh>" C.include "<nix/path-with-outputs.hh>"+#endif  _ = Proxy :: Proxy NixStorePath 
src/Hercules/CNix/Util.hs view
@@ -25,12 +25,16 @@  C.context context -C.include "<nix/config.h>"+#if NIX_IS_AT_LEAST(2, 28, 0) -C.include "<nix/util.hh>"+C.include "<nix/util/signals.hh>" -#if NIX_IS_AT_LEAST(2,19,0)+#else+C.include "<nix/config.h>"+C.include "<nix/util.hh>"+#  if NIX_IS_AT_LEAST(2,19,0) C.include "<nix/signals.hh>"+#  endif #endif  C.using "namespace nix"
src/Hercules/CNix/Verbosity.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} @@ -19,10 +20,16 @@  C.context context +#if NIX_IS_AT_LEAST(2, 28, 0)++C.include "<nix/util/logging.hh>"++#else C.include "<nix/config.h>" C.include "<nix/error.hh>" C.include "<nix/globals.hh>" C.include "<nix/logging.hh>"+#endif  data Verbosity   = Error