diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,10 @@
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
+## 0.3.6.3 - 2024-05-19
+
+Solve build warnings.
+
 ## 0.3.6.2 - 2024-05-03
 
 ### Fixed
diff --git a/hercules-ci-cnix-expr.cabal b/hercules-ci-cnix-expr.cabal
--- a/hercules-ci-cnix-expr.cabal
+++ b/hercules-ci-cnix-expr.cabal
@@ -1,7 +1,7 @@
 cabal-version: 2.4
 
 name:           hercules-ci-cnix-expr
-version:        0.3.6.2
+version:        0.3.6.3
 synopsis:       Bindings for the Nix evaluator
 category:       Nix, CI, Testing, DevOps
 homepage:       https://docs.hercules-ci.com
diff --git a/src/Hercules/CNix/Expr.hs b/src/Hercules/CNix/Expr.hs
--- a/src/Hercules/CNix/Expr.hs
+++ b/src/Hercules/CNix/Expr.hs
@@ -94,6 +94,7 @@
 import Protolude hiding (evalState)
 import System.Directory (makeAbsolute)
 import Data.Aeson.KeyMap (toMapText)
+import qualified Data.ByteString.Unsafe as BS
 
 C.context (Hercules.CNix.Store.Context.context <> Hercules.CNix.Expr.Context.evalContext)
 
@@ -465,13 +466,13 @@
       gather acc i | i == end = pure acc
       gather acc i = do
 #if NIX_IS_AT_LEAST(2,9,0)
-        name <- unsafeMallocBS [C.block| const char *{
+        name <- BS.unsafePackMallocCString =<< [C.block| const char *{
           EvalState &evalState = *$(EvalState *evalState);
           SymbolStr str = evalState.symbols[$(Attr *i)->name];
           return stringdup(static_cast<std::string>(str));
         }|]
 #else
-        name <- unsafeMallocBS [C.exp| const char *{ stringdup(static_cast<std::string>($(Attr *i)->name)) } |]
+        name <- BS.unsafePackMallocCString =<< [C.exp| const char *{ stringdup(static_cast<std::string>($(Attr *i)->name)) } |]
 #endif
         value <- mkRawValue =<< [C.exp| Value *{ new (NoGC) Value(*$(Attr *i)->value) } |]
         let acc' = M.insert name value acc
@@ -581,14 +582,18 @@
     }|]
 
 mkPath :: Ptr EvalState -> ByteString -> IO (Value NixPath)
+#if NIX_IS_AT_LEAST(2,19,0)
 mkPath evalState path =
+#else
+mkPath _evalState path =
+#endif
   Value
     <$> ( mkRawValue
             =<< [C.throwBlock| Value *{
-      EvalState & state = *$(EvalState *evalState);
       Value *r = new (NoGC) Value();
       std::string s($bs-ptr:path, $bs-len:path);
 #if NIX_IS_AT_LEAST(2,19,0)
+      EvalState & state = *$(EvalState *evalState);
       r->mkPath(state.rootPath(CanonPath(s)));
 #else
       r->mkPath(stringdup(s));
diff --git a/src/Hercules/CNix/Expr/Typed.hs b/src/Hercules/CNix/Expr/Typed.hs
--- a/src/Hercules/CNix/Expr/Typed.hs
+++ b/src/Hercules/CNix/Expr/Typed.hs
@@ -29,6 +29,7 @@
 where
 
 import Control.Exception (throwIO)
+import qualified Data.ByteString.Unsafe as BS
 import Hercules.CNix.Expr.Context
 import Hercules.CNix.Expr.Raw
 import qualified Language.C.Inline.Cpp as C
@@ -160,8 +161,8 @@
 -- NOT coerceToString
 getStringIgnoreContext :: Value NixString -> IO ByteString
 getStringIgnoreContext (Value (RawValue v)) =
-  unsafeMallocBS
-    [C.exp| const char *{
+  BS.unsafePackMallocCString
+    =<< [C.exp| const char *{
 #if NIX_IS_AT_LEAST(2,19,0)
     strdup($(Value *v)->c_str())
 #else
