diff --git a/src/libfetchers/git-lfs-fetch.cc b/src/libfetchers/git-lfs-fetch.cc index 35230ae88..a68cdf832 100644 --- a/src/libfetchers/git-lfs-fetch.cc +++ b/src/libfetchers/git-lfs-fetch.cc @@ -292,7 +292,7 @@ void Fetch::fetch( auto authIt = headerIt->find("Authorization"); if (authIt == headerIt->end()) return std::nullopt; - return *authIt; + return std::string(*authIt); }(); const uint64_t size = obj.at("size"); sizeCallback(size); diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 0b53ef44d..3da58cb70 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -66,6 +66,7 @@ this_library = library( link_args : linker_export_flags, prelink : true, # For C++ static initializers install : true, + cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [], ) install_headers(headers, subdir : 'nix/fetchers', preserve_path : true) diff --git a/src/libfetchers/pch/precompiled-headers.hh b/src/libfetchers/pch/precompiled-headers.hh new file mode 100644 index 000000000..db7f22a2e --- /dev/null +++ b/src/libfetchers/pch/precompiled-headers.hh @@ -0,0 +1,3 @@ +#include "nix/fetchers/fetchers.hh" +#include "nix/store/store-api.hh" +#include "nix/util/json-utils.hh"