about summary refs log tree commit diff
path: root/third_party/nix/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore')
-rw-r--r--third_party/nix/src/libstore/local-store.cc8
-rw-r--r--third_party/nix/src/libstore/nar-info-disk-cache.cc7
-rw-r--r--third_party/nix/src/libstore/nar-info-disk-cache.hh2
3 files changed, 13 insertions, 4 deletions
diff --git a/third_party/nix/src/libstore/local-store.cc b/third_party/nix/src/libstore/local-store.cc
index e7746973f956..995bc4f998b4 100644
--- a/third_party/nix/src/libstore/local-store.cc
+++ b/third_party/nix/src/libstore/local-store.cc
@@ -490,10 +490,18 @@ static void canonicalisePathMetaData_(const Path& path, uid_t fromUid,
     if (inodesSeen.find(Inode(st.st_dev, st.st_ino)) == inodesSeen.end()) {
       throw BuildError(format("invalid ownership on file '%1%'") % path);
     }
+
+// `mode` variable is only used in debug builds
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-variable"
+
     mode_t mode = st.st_mode & ~S_IFMT;
     assert(S_ISLNK(st.st_mode) ||
            (st.st_uid == geteuid() && (mode == 0444 || mode == 0555) &&
             st.st_mtime == mtimeStore));
+
+#pragma clang diagnostic pop
+
     return;
   }
 
diff --git a/third_party/nix/src/libstore/nar-info-disk-cache.cc b/third_party/nix/src/libstore/nar-info-disk-cache.cc
index c98882bff319..be2ad8f2dac1 100644
--- a/third_party/nix/src/libstore/nar-info-disk-cache.cc
+++ b/third_party/nix/src/libstore/nar-info-disk-cache.cc
@@ -49,7 +49,7 @@ create table if not exists LastPurge (
 
 )sql";
 
-class NarInfoDiskCacheImpl : public NarInfoDiskCache {
+class NarInfoDiskCacheImpl final : public NarInfoDiskCache {
  public:
   /* How often to purge expired entries from the cache. */
   const int purgeInterval = 24 * 3600;
@@ -280,8 +280,9 @@ class NarInfoDiskCacheImpl : public NarInfoDiskCache {
   }
 };
 
-ref<NarInfoDiskCache> getNarInfoDiskCache() {
-  static ref<NarInfoDiskCache> cache = make_ref<NarInfoDiskCacheImpl>();
+std::shared_ptr<NarInfoDiskCache> getNarInfoDiskCache() {
+  static std::shared_ptr<NarInfoDiskCache> cache =
+      std::make_shared<NarInfoDiskCacheImpl>();
   return cache;
 }
 
diff --git a/third_party/nix/src/libstore/nar-info-disk-cache.hh b/third_party/nix/src/libstore/nar-info-disk-cache.hh
index b4107721aad1..8eeab7635a4e 100644
--- a/third_party/nix/src/libstore/nar-info-disk-cache.hh
+++ b/third_party/nix/src/libstore/nar-info-disk-cache.hh
@@ -25,6 +25,6 @@ class NarInfoDiskCache {
 
 /* Return a singleton cache object that can be used concurrently by
    multiple threads. */
-ref<NarInfoDiskCache> getNarInfoDiskCache();
+std::shared_ptr<NarInfoDiskCache> getNarInfoDiskCache();
 
 }  // namespace nix