diff options
author | jade <lix@jade.fyi> | 2024-08-25 19:59:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-08-25 19:59:46 +0000 |
commit | 3bf8819fa2717176c9b3bfc24281b3428c431e71 (patch) | |
tree | 9f9080191ab24c9f4eaeee71147029c891691db9 | |
parent | cae260a15874dab1dfa505a1f11ae98be2f03afd (diff) | |
parent | 7e677d15a4466d19f9d0c471e218ecb38f4ba56e (diff) |
Merge changes Ief8e8ebc,Id3135db0,If1e76169 into main
* changes:
libutil: delete unused boost context cruft
build: remove approximately 400 seconds of CPU time (30%)
fix: use http proxy for s3 access
-rw-r--r-- | doc/manual/rl-next/http-proxy-for-s3.md | 10 | ||||
-rw-r--r-- | meson.build | 11 | ||||
-rw-r--r-- | src/libstore/s3-binary-cache-store.cc | 2 | ||||
-rw-r--r-- | src/libutil/serialise.hh | 19 |
4 files changed, 23 insertions, 19 deletions
diff --git a/doc/manual/rl-next/http-proxy-for-s3.md b/doc/manual/rl-next/http-proxy-for-s3.md new file mode 100644 index 000000000..57b0107dd --- /dev/null +++ b/doc/manual/rl-next/http-proxy-for-s3.md @@ -0,0 +1,10 @@ +--- +synopsis: HTTP proxy environment variables are now respected for S3 binary cache stores +issues: [fj#433] +cls: [1788] +category: Fixes +credits: jade +--- + +Due to "legacy reasons" (according to the AWS C++ SDK docs), the AWS SDK ignores system proxy configuration by default. +We turned it back on. diff --git a/meson.build b/meson.build index ea713acf0..3a772ac08 100644 --- a/meson.build +++ b/meson.build @@ -147,6 +147,17 @@ if should_pch # Unlike basically everything else that takes a file, Meson requires the arguments to # cpp_pch : to be strings and doesn't accept files(). So absolute path it is. cpp_pch = [meson.project_source_root() / 'src/pch/precompiled-headers.hh'] + + # Saves about 400s (30% at time of writing) from compile time on-cpu, mostly + # by removing instantiations of nlohmann from every single damned compilation + # unit. + # There is no equivalent in gcc. + if cxx.get_id() == 'clang' + add_project_arguments( + '-fpch-instantiate-templates', + language : 'cpp', + ) + endif else cpp_pch = [] endif diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index 4683f00f9..ffebfda8d 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -140,6 +140,8 @@ ref<Aws::Client::ClientConfiguration> S3Helper::makeConfig( res->connectTimeoutMs = 5 * 1000; res->retryStrategy = std::make_shared<RetryStrategy>(); res->caFile = settings.caFile; + // Use the system proxy env-vars in curl for s3, which is off by default for some reason + res->allowSystemProxy = true; return res; } diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index 6c637bd35..8218db440 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -9,8 +9,6 @@ #include "types.hh" #include "file-descriptor.hh" -namespace boost::context { struct stack_context; } - namespace nix { @@ -612,23 +610,6 @@ struct FramedSink : nix::BufferedSink }; }; -/** - * Stack allocation strategy for sinkToSource. - * Mutable to avoid a boehm gc dependency in libutil. - * - * boost::context doesn't provide a virtual class, so we define our own. - */ -struct StackAllocator { - virtual boost::context::stack_context allocate() = 0; - virtual void deallocate(boost::context::stack_context sctx) = 0; - - /** - * The stack allocator to use in sinkToSource and potentially elsewhere. - * It is reassigned by the initGC() method in libexpr. - */ - static StackAllocator *defaultAllocator; -}; - /* Disabling GC when entering a coroutine (without the boehm patch). mutable to avoid boehm gc dependency in libutil. */ |