-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cobrazz improvements #316
base: develop
Are you sure you want to change the base?
Cobrazz improvements #316
Conversation
PATTERN "*.h" | ||
) | ||
|
||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/signal_catcher.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-pasta: we shouldn't need to edit CMake scripts when adding new source files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part install private file that we need to include after installation (from src/ folder, userver_add_library install only include folder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stuff in src/
and impl
is private API. We provide no support for code that uses such workarounds to access it anyway. If you still need it, move it to public API (include
). Please expand on why you need it, we'll figure out the best way to expose the necessary tools.
} | ||
}; | ||
|
||
void DoRun(std::mutex& stop_mutex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why copy-paste components::Run
? Please expand on why stop_mutex
is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run can be stopped only from components (usually by signal handling), we need to have ability stop it from code (here mutex unlock initiate components destruction and stopping as result)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::raise(SIGINT)
?
@@ -0,0 +1,54 @@ | |||
#include <utils/userver_experiment.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra file as a rebase artifact?
@@ -0,0 +1,26 @@ | |||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra file as a rebase artifact?
|
||
userver_export(TARGETS ${PROJECT_NAME}-deps) | ||
|
||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/ugrpc/client/impl/client_configs.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
@@ -1 +1 @@ | |||
protobuf>=4.21.12 | |||
protobuf>=3.21.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing these versions will break gRPC tests for someone again :)
We've only just found a good combination that satisfies most users
Protobuf has broken backwards compatibility around version 3.21 (which is, confusingly, also called 4.21): old Python packages must be used with older system protoc, and new Python packages must be used with newer system protoc versions.
We now support two build modes for gRPC. If we detect an old enough system protobuf, we use scripts/grpc/requirements-old.txt
instead of scripts/grpc/requirements.txt
. Same for testsuite/requirements-grpc.txt
and testsuite/requirements-grpc-old.txt
.
@@ -140,4 +170,8 @@ else () | |||
add_definitions(-D_FORTIFY_SOURCE=2) | |||
endif () | |||
|
|||
if (UNIX AND BUILD_SHARED_LIBS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not support building userver as a dynamic library. Doing so will result in performance drops (we rely on LTO heavily) and bugs around non-constexpr inline
variables and things like AnyMovable
comparing std::type_info
by pointer value
@@ -6,6 +6,16 @@ USERVER_NAMESPACE_BEGIN | |||
|
|||
namespace fs { | |||
|
|||
// Please, review this TempFile::TempFile implementation | |||
// I simple added it as workaround for linkage error (if linked as shared library) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple: don't use shared linkage with userver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ? We already debugged shared library variant installation in this request and it works, here much reasons why 99% of libraries on unix systems install in shared variant. And here we try to make this variant available for userver ….
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple reasons why we would like to avoid building shared libraries:
- we guarantee no ABI stability even on minor changes. This is usually a deal breaker for shared libraries distributions
- supporting shared libraries would double the testing efforts, double the support efforts, double the build scripts boilerplate and double the development efforts, as it would require
-fvisibility=hidden
and visibility attributes in code - LTO is not quite nicely supported with shared libraries, we would not like to provoke users for inefficient services
@@ -147,6 +147,9 @@ function(generate_grpc_files) | |||
|
|||
set(did_generate_proto_sources FALSE) | |||
if("${newest_proto_dependency}" IS_NEWER_THAN "${GENERATED_PROTO_DIR}/${path_base}.pb.cc") | |||
# resolve root_path, proto_file to real path's - protoc check that root_path is prefix of proto_file (this can be non true if project inside folder sym linked to other dir) | |||
get_filename_component(real_root_path ${root_path} REALPATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few lines above we already do this, so the root_path should be already a real path. Are we missing something?
CLA Assistant Lite bot: I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/ 1 out of 2 committers have signed the CLA. |
Improvements:
Fixes:
for fix - we resolve paths to real paths before protoc execute
Specific changes:
Otherwise we have strange requirement: should be installed latest version of these packages by pip, independent on versions of c++ packages
All these changes we tested : we link userver preinstalled on host as rpm package, and runned http, grpc components in production