Browse Source

bump userver, switch to clang (#8247)

itrofimow 2 years ago
parent
commit
66d182d2b0

+ 5 - 2
frameworks/C++/userver/userver-bare.dockerfile

@@ -1,15 +1,18 @@
 FROM ghcr.io/userver-framework/ubuntu-userver-build-base:v1 AS builder
 
+RUN apt install -y clang-14 lld-14
+
 WORKDIR /src
 RUN git clone https://github.com/userver-framework/userver.git && \
-    cd userver && git checkout 3a8ea5c0e6e1200a1ec5e8d5c87dfba3987cdd98
+    cd userver && git checkout b8070f28ea2fcbb4d72ccac1449639a2f352a001
 COPY userver_benchmark/ ./
 RUN mkdir build && cd build && \
     cmake -DUSERVER_IS_THE_ROOT_PROJECT=0 -DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0 \
           -DUSERVER_FEATURE_REDIS=0 -DUSERVER_FEATURE_CLICKHOUSE=0 -DUSERVER_FEATURE_MONGODB=0 -DUSERVER_FEATURE_RABBITMQ=0 -DUSERVER_FEATURE_GRPC=0 \
           -DUSERVER_FEATURE_UTEST=0 \
           -DUSERVER_FEATURE_POSTGRESQL=1 \
-          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" .. && \
+          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" -DCMAKE_C_FLAGS="-march=native" \
+          -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14 -DUSERVER_USE_LD=lld-14 .. && \
     make -j $(nproc)
 
 FROM builder AS runner

+ 5 - 2
frameworks/C++/userver/userver.dockerfile

@@ -1,15 +1,18 @@
 FROM ghcr.io/userver-framework/ubuntu-userver-build-base:v1 AS builder
 
+RUN apt install -y clang-14 lld-14
+
 WORKDIR /src
 RUN git clone https://github.com/userver-framework/userver.git && \
-    cd userver && git checkout 3a8ea5c0e6e1200a1ec5e8d5c87dfba3987cdd98
+    cd userver && git checkout b8070f28ea2fcbb4d72ccac1449639a2f352a001
 COPY userver_benchmark/ ./
 RUN mkdir build && cd build && \
     cmake -DUSERVER_IS_THE_ROOT_PROJECT=0 -DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0 \
           -DUSERVER_FEATURE_REDIS=0 -DUSERVER_FEATURE_CLICKHOUSE=0 -DUSERVER_FEATURE_MONGODB=0 -DUSERVER_FEATURE_RABBITMQ=0 -DUSERVER_FEATURE_GRPC=0 \
           -DUSERVER_FEATURE_UTEST=0 \
           -DUSERVER_FEATURE_POSTGRESQL=1 \
-          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" .. && \
+          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" -DCMAKE_C_FLAGS="-march=native" \
+          -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14 -DUSERVER_USE_LD=lld-14 .. && \
     make -j $(nproc)
 
 FROM builder AS runner

+ 3 - 2
frameworks/C++/userver/userver_benchmark/controllers/plaintext/handler.cpp

@@ -1,14 +1,15 @@
 #include "handler.hpp"
 
+#include <userver/http/common_headers.hpp>
+
 namespace userver_techempower::plaintext {
 
-const std::string kContentTypeHeader{"Content-Type"};
 const std::string kContentTypeTextPlain{"text/plain"};
 
 std::string Handler::HandleRequestThrow(
     const userver::server::http::HttpRequest& request,
     userver::server::request::RequestContext&) const {
-  request.GetHttpResponse().SetHeader(kContentTypeHeader,
+  request.GetHttpResponse().SetHeader(userver::http::headers::kContentType,
                                       kContentTypeTextPlain);
   return GetResponse();
 }

+ 1 - 0
frameworks/C++/userver/userver_configs/dynamic_config_fallback.json

@@ -3,6 +3,7 @@
   "USERVER_CANCEL_HANDLE_REQUEST_BY_DEADLINE": false,
   "POSTGRES_DEADLINE_PROPAGATION_ENABLED": false,
   "POSTGRES_CONNECTION_PIPELINE_MODE_ENABLED": false,
+  "POSTGRES_CONNECTION_PIPELINE_EXPERIMENT": 0,
   "USERVER_CHECK_AUTH_IN_HANDLERS": false,
   "USERVER_DUMPS": {},
   "USERVER_HTTP_PROXY": "",

+ 7 - 0
frameworks/C++/userver/userver_configs/static_config.yaml

@@ -65,11 +65,13 @@ components_manager:
         plaintext-handler:
             path: /plaintext
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         json-handler:
             path: /json
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         hello-world-db:
@@ -83,16 +85,19 @@ components_manager:
         single-query-handler:
             path: /db
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         multiple-queries-handler:
             path: /queries
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         updates-handler:
             path: /updates
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         world-pg-cache:
@@ -104,10 +109,12 @@ components_manager:
         cached-queries-handler:
             path: /cached-queries
             method: GET
+            decompress_request: false
             task_processor: main-task-processor
 
         fortunes-handler:
             path: /fortunes
             method: GET
+            decompress_request: false
             task_processor: main-task-processor