Skip to content

Commit 461d186

Browse files
committed
Conditionally compile the code that uses AWS to pass windows build (#8966)
1 parent 356c98d commit 461d186

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

ydb/core/driver_lib/run/kikimr_services_initializers.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,13 @@
240240

241241
#include <util/system/hostname.h>
242242

243+
#ifndef KIKIMR_DISABLE_S3_OPS
243244
#include <aws/core/Aws.h>
245+
#endif
244246

245247
namespace {
246248

249+
#ifndef KIKIMR_DISABLE_S3_OPS
247250
struct TAwsApiGuard {
248251
TAwsApiGuard() {
249252
Aws::InitAPI(Options);
@@ -256,6 +259,7 @@ struct TAwsApiGuard {
256259
private:
257260
Aws::SDKOptions Options;
258261
};
262+
#endif
259263

260264
}
261265

@@ -2812,6 +2816,7 @@ void TGraphServiceInitializer::InitializeServices(NActors::TActorSystemSetup* se
28122816
TActorSetupCmd(NGraph::CreateGraphService(appData->TenantName), TMailboxType::HTSwap, appData->UserPoolId));
28132817
}
28142818

2819+
#ifndef KIKIMR_DISABLE_S3_OPS
28152820
TAwsApiInitializer::TAwsApiInitializer(IGlobalObjectStorage& globalObjects)
28162821
: GlobalObjects(globalObjects)
28172822
{
@@ -2822,6 +2827,7 @@ void TAwsApiInitializer::InitializeServices(NActors::TActorSystemSetup* setup, c
28222827
Y_UNUSED(appData);
28232828
GlobalObjects.AddGlobalObject(std::make_shared<TAwsApiGuard>());
28242829
}
2830+
#endif
28252831

28262832
} // namespace NKikimrServicesInitializers
28272833
} // namespace NKikimr

ydb/core/driver_lib/run/kikimr_services_initializers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ class TGraphServiceInitializer : public IKikimrServicesInitializer {
612612
void InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) override;
613613
};
614614

615+
#ifndef KIKIMR_DISABLE_S3_OPS
615616
class TAwsApiInitializer : public IServiceInitializer {
616617
IGlobalObjectStorage& GlobalObjects;
617618

@@ -620,6 +621,7 @@ class TAwsApiInitializer : public IServiceInitializer {
620621

621622
void InitializeServices(NActors::TActorSystemSetup* setup, const NKikimr::TAppData* appData) override;
622623
};
624+
#endif
623625

624626
} // namespace NKikimrServicesInitializers
625627
} // namespace NKikimr

ydb/core/driver_lib/run/run.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,9 +1651,11 @@ TIntrusivePtr<TServiceInitializersList> TKikimrRunner::CreateServiceInitializers
16511651
sil->AddServiceInitializer(new TGraphServiceInitializer(runConfig));
16521652
}
16531653

1654+
#ifndef KIKIMR_DISABLE_S3_OPS
16541655
if (serviceMask.EnableAwsService) {
16551656
sil->AddServiceInitializer(new TAwsApiInitializer(*this));
16561657
}
1658+
#endif
16571659

16581660
return sil;
16591661
}

ydb/core/driver_lib/run/ya.make

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
LIBRARY(run)
22

3+
IF (OS_WINDOWS)
4+
CFLAGS(
5+
-DKIKIMR_DISABLE_S3_OPS
6+
)
7+
ELSE()
8+
PEERDIR(
9+
contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core
10+
)
11+
ENDIF()
12+
313
SRCS(
414
auto_config_initializer.cpp
515
config.cpp
@@ -20,7 +30,6 @@ SRCS(
2030
)
2131

2232
PEERDIR(
23-
contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core
2433
contrib/libs/protobuf
2534
ydb/library/actors/core
2635
ydb/library/actors/dnsresolver

0 commit comments

Comments
 (0)