Skip to content

Commit a90cfc7

Browse files
apolukhinrobot-piglet
authored andcommitted
feat conan: relax Boost requirements and fix conan-center review issues
Tests: протестировано CI --- Pull Request resolved: #1122 commit_hash:b6eae276d62c8fd201587ed904301842b236e33e
1 parent 6de613b commit a90cfc7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

conanfile.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class UserverConan(ConanFile):
4646
'with_s3api': [True, False],
4747
'with_grpc_reflection': [True, False],
4848
'with_grpc_protovalidate': [True, False],
49+
'with_phdr_cache': [True, False],
4950
}
5051

5152
default_options = {
@@ -68,6 +69,7 @@ class UserverConan(ConanFile):
6869
'with_s3api': True,
6970
'with_grpc_reflection': True,
7071
'with_grpc_protovalidate': False,
72+
'with_phdr_cache': True,
7173
'mongo-c-driver/*:with_sasl': 'cyrus',
7274
'grpc/*:php_plugin': False,
7375
'grpc/*:node_plugin': False,
@@ -108,10 +110,13 @@ def layout(self):
108110
cmake_layout(self)
109111

110112
def requirements(self):
111-
self.requires('boost/1.86.0', transitive_headers=True)
113+
self.requires('boost/[>=1.83 <1.88]', transitive_headers=True)
112114
self.requires('c-ares/[^1.33]')
113115
self.requires('cctz/[^2.4]', transitive_headers=True)
116+
117+
# 1.0.4 does not work due to https://github.com/cameron314/concurrentqueue/issues/439
114118
self.requires('concurrentqueue/1.0.3', transitive_headers=True)
119+
115120
self.requires('cryptopp/[^8.9]')
116121
self.requires('fmt/[>=8.1.1 <13]', transitive_headers=True)
117122
self.requires('libiconv/[^1.17]')
@@ -120,7 +125,7 @@ def requirements(self):
120125
self.requires('libev/[^4.33]')
121126
self.requires('openssl/[>=1.1 <4]')
122127
self.requires('rapidjson/[>=cci.20230929 <cci.20230930]', transitive_headers=True)
123-
self.requires('yaml-cpp/[^0.8]')
128+
self.requires('yaml-cpp/[^0.8.0]')
124129
self.requires('zlib/[^1.3]')
125130
self.requires('zstd/[^1.5]')
126131
self.requires('icu/[>=74.1 <77]', force=True)
@@ -223,6 +228,7 @@ def generate(self):
223228
tool_ch.cache_variables['USERVER_FEATURE_S3API'] = self.options.with_s3api
224229
tool_ch.cache_variables['USERVER_FEATURE_GRPC_REFLECTION'] = self.options.with_grpc_reflection
225230
tool_ch.cache_variables['USERVER_FEATURE_GRPC_PROTOVALIDATE'] = self.options.with_grpc_protovalidate
231+
tool_ch.cache_variables['USERVER_DISABLE_PHDR_CACHE'] = not self.options.with_phdr_cache
226232

227233
if self.options.with_grpc:
228234
tool_ch.cache_variables['USERVER_GOOGLE_COMMON_PROTOS'] = (
@@ -243,8 +249,8 @@ def generate(self):
243249
def build(self):
244250
# pg_config is required to build psycopg2 from source without system package.
245251
# However, this approach fails on later stage, when venv for tests is built.
246-
if libpq := self.dependencies.get('libpq'):
247-
os.environ['PATH'] = os.environ['PATH'] + ':' + libpq.package_folder + '/bin'
252+
if self.options.with_postgresql:
253+
os.environ['PATH'] = os.environ['PATH'] + ':' + self.dependencies['libpq'].package_folder + '/bin'
248254

249255
cmake = CMake(self)
250256
cmake.configure()

0 commit comments

Comments
 (0)