Skip to content

Commit

Permalink
Merge pull request #13420 from ydb-platform/merge-libs-250116-0020
Browse files Browse the repository at this point in the history
  • Loading branch information
alexv-smirnov committed Jan 16, 2025
2 parents 0b34000 + dd1688c commit 4c4b273
Show file tree
Hide file tree
Showing 148 changed files with 2,895 additions and 3,827 deletions.
8 changes: 0 additions & 8 deletions build/conf/compilers/gnu_compiler.conf
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ when ($OS_EMSCRIPTEN == "yes") {
CFLAGS+=-D__EMSCRIPTEN__
}

when ($ARCH_WASM64 == "yes") {
CFLAGS+=-D_LIBCPP_HAS_MUSL_LIBC
}

when ($ARCH_WASM32 == "yes") {
CFLAGS+=-D_musl_
}

CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL
CXXFLAGS+=$CFLAGS $_STD_CXX $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
Expand Down
1 change: 1 addition & 0 deletions build/conf/settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ YMAKE_USE_NEW_UIDS=yes
PIC_NO_PIE=no
FAIL_PY2=no
MAIN_OUTPUT_AS_EXTRA=yes
USE_REACHABILITY_TO_REPORT_CONF_ERRORS = yes

when ($YMAKE_USE_OLD_UIDS == "yes") {
YMAKE_USE_NEW_UIDS=no
Expand Down
97 changes: 97 additions & 0 deletions build/config/tests/cpp_style/config18.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Language: Cpp
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignEscapedNewlines: Left
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: All
FixNamespaceComments: true
ShortNamespaceLines: 0
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
SpacesInSquareBrackets: false
Cpp11BracedListStyle: true
Standard: c++20
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
InsertBraces: true

# NB: BraceWrapping has no effect unless BreakBeforeBraces is set to Custom
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: true

SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [
foreach,
Q_FOREACH,
BOOST_FOREACH,
# Is not a foreach, but correct formatting is achieved
Y_DEFER
]
IfMacros: [
with_lock # Is not an if, but correct formatting is achieved
]
SpaceBeforeParens: ControlStatements
DisableFormat: false
SortIncludes: false
IndentPPDirectives: BeforeHash

SpaceBeforeInheritanceColon: false
NamespaceMacros: [Y_UNIT_TEST_SUITE]
AttributeMacros: [Y_PRINTF_FORMAT, Y_NO_SANITIZE, Y_FORCE_INLINE, Y_NO_INLINE, Y_WARN_UNUSED_RESULT, Y_HIDDEN, Y_PUBLIC, Y_PURE_FUNCTION]
IndentExternBlock: Indent
TypenameMacros: [Y_THREAD, Y_STATIC_THREAD, Y_POD_THREAD, Y_POD_STATIC_THREAD]
StatementAttributeLikeMacros: [ythrow]
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
1 change: 1 addition & 0 deletions build/config/tests/cpp_style/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ LIBRARY()

RESOURCE_FILES(
config.clang-format
config18.clang-format
)

END()
4 changes: 4 additions & 0 deletions build/mapping.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@
"7750425697": "https://devtools-registry.s3.yandex.net/7750425697",
"7808687279": "https://devtools-registry.s3.yandex.net/7808687279",
"7808709138": "https://devtools-registry.s3.yandex.net/7808709138",
"7827427680": "https://devtools-registry.s3.yandex.net/7827427680",
"7827481464": "https://devtools-registry.s3.yandex.net/7827481464",
"5486731632": "https://devtools-registry.s3.yandex.net/5486731632",
"5514350352": "https://devtools-registry.s3.yandex.net/5514350352",
"5514360398": "https://devtools-registry.s3.yandex.net/5514360398",
Expand Down Expand Up @@ -1645,6 +1647,8 @@
"7750425697": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"7808687279": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"7808709138": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"7827427680": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"7827481464": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
"5486731632": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5514350352": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
"5514360398": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
Expand Down
10 changes: 5 additions & 5 deletions build/platform/test_tool/host.ya.make.inc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808708280)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827478825)
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808707972)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827476769)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808709138)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827481464)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808707633)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827475180)
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808708809)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827480238)

ENDIF()
10 changes: 5 additions & 5 deletions build/platform/test_tool/host_os.ya.make.inc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808686430)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827425105)
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808685838)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827423650)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808687279)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827427680)
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808685532)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827422227)
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7808686875)
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7827426459)

ENDIF()
7 changes: 0 additions & 7 deletions build/scripts/make_java_srclists.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--moddir')
parser.add_argument('--java')
parser.add_argument('--groovy')
parser.add_argument('--kotlin')
parser.add_argument('--coverage')
parser.add_argument('--source-root')
args, remaining_args = parser.parse_known_args(args)

java = []
kotlin = []
groovy = []
coverage = []

cur_resources_list_file = None
Expand Down Expand Up @@ -74,8 +72,6 @@ def main():
kotlin.append(src)
if args.coverage and args.source_root:
add_rel_src_to_coverage(coverage, src, args.source_root)
elif args.groovy and src.endswith(".groovy"):
groovy.append(src)
else:
if src == '--resources':
if cur_resources_list_file is not None:
Expand Down Expand Up @@ -118,9 +114,6 @@ def main():
if args.kotlin:
with open(args.kotlin, 'w') as f:
writelines(f, kotlin)
if args.groovy:
with open(args.groovy, 'w') as f:
writelines(f, groovy)
if args.coverage:
jcov.write_coverage_sources(args.coverage, args.source_root, coverage)

Expand Down
43 changes: 26 additions & 17 deletions build/sysincl/stl-to-libcxx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,34 @@

# Though these are headers provided by libcxx, we do not want to allow them to be included.
# We are using non-existent filename to generate error instead, as there is no specific syntax for this case.
- includes:
- ext/hash_map: DO_NOT_INCLUDE_NON_STANDARD_EXT_HASH_MAP
- ext/hash_set: DO_NOT_INCLUDE_NON_STANDARD_EXT_HASH_SET
- experimental/any: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_ANY
- experimental/chrono: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_CHRONO
- experimental/coroutine: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_COROUTINE
- experimental/filesystem: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_FILESYSTEM
- experimental/numeric: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_NUMERIC
- experimental/memory: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_MEMORY
- experimental/optional: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_OPTIONAL
- experimental/ratio: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_RATIO
- experimental/source_location: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_SOURCE_LOCATION
- experimental/string_view: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_STRING_VIEW
- experimental/system_error: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_SYSTEM_ERROR
- experimental/tuple: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_TUPLE

# GENERATED BY YM2
- source_filter: "^(?!(contrib/libs/cxxsupp/libcxx)).*"
includes:
- ext/__hash: DO_NOT_INCLUDE_NON_STANDARD_EXT___HASH
- ext/hash_map: DO_NOT_INCLUDE_NON_STANDARD_EXT_HASH_MAP
- ext/hash_set: DO_NOT_INCLUDE_NON_STANDARD_EXT_HASH_SET
- experimental/__config: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___CONFIG
- experimental/__memory: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___MEMORY
- experimental/__simd/abi_tag.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_ABI_TAG_H
- experimental/__simd/aligned_tag.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_ALIGNED_TAG_H
- experimental/__simd/declaration.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_DECLARATION_H
- experimental/__simd/internal_declaration.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_INTERNAL_DECLARATION_H
- experimental/__simd/reference.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_REFERENCE_H
- experimental/__simd/scalar.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_SCALAR_H
- experimental/__simd/simd.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_SIMD_H
- experimental/__simd/simd_mask.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_SIMD_MASK_H
- experimental/__simd/traits.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_TRAITS_H
- experimental/__simd/utility.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_UTILITY_H
- experimental/__simd/vec_ext.h: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL___SIMD_VEC_EXT_H
- experimental/iterator: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_ITERATOR
- experimental/memory: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_MEMORY
#TODO: ban this header too
# - experimental/propagate_const: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_PROPAGATE_CONST
- experimental/simd: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_SIMD
- experimental/type_traits: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_TYPE_TRAITS
- experimental/utility: DO_NOT_INCLUDE_NON_STANDARD_EXPERIMENTAL_UTILITY

# This includes all headers needed to resolve includes in c-headers from libcxx listed above
# GENERATED BY YM2
- includes:
- algorithm: contrib/libs/cxxsupp/libcxx/include/algorithm
- any: contrib/libs/cxxsupp/libcxx/include/any
Expand Down
13 changes: 12 additions & 1 deletion build/ymake.core.conf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ _TOOL_PROTOC_GEN_GO_GRPC_V2=vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc
_TOOL_RESCOMPILER=tools/rescompiler
_TOOL_RESCOMPRESSOR=tools/rescompressor
_TOOL_RORESCOMPILER=tools/rorescompiler
TOOL_CPPYNDEXER=

when ($DISABLE_SEPARATE_AUX_CPP != "yes") {
SEPARATE_AUX_CPP=yes
Expand Down Expand Up @@ -257,8 +258,15 @@ otherwise {

# tag:codenav
when ($CODENAVIGATION && $NOCODENAVIGATION != "yes") {
when ($TOOL_CPPYNDEXER == "") {
_TOOL_CPPYNDEXER_REAL=$CPPYNDEXER_RESOURCE_GLOBAL/yndexer
}
otherwise {
_TOOL_CPPYNDEXER_REAL=$TOOL_CPPYNDEXER
}

PY_PROGRAM_LINK_EXE=$LINK_EXE && ${hide;kv:"pyndex $TARGET"}
YNDEXER_ARGS=$YMAKE_PYTHON ${input:"build/scripts/yndexer.py"} $CPPYNDEXER_RESOURCE_GLOBAL/yndexer 1500 $(SOURCE_ROOT) $ARCADIA_BUILD_ROOT ${input:SRC}
YNDEXER_ARGS=$YMAKE_PYTHON ${input:"build/scripts/yndexer.py"} $_TOOL_CPPYNDEXER_REAL 1500 $(SOURCE_ROOT) $ARCADIA_BUILD_ROOT ${input:SRC}
YNDEXER_OUTPUT=${noauto;output;suf=${OBJ_CROSS_SUF}${COMPILE_OUT_SUFFIX}.ydx.pb2:SRC}
}
otherwise {
Expand Down Expand Up @@ -764,6 +772,9 @@ module _BASE_UNIT: _BARE_UNIT {
when ($OS_EMSCRIPTEN == "yes") {
when ($NOLIBC != "yes") {
PEERDIR+=contrib/restricted/emscripten/include
PEERDIR+=contrib/restricted/emscripten/system/lib/c
PEERDIR+=contrib/restricted/emscripten/system/lib/dlmalloc
PEERDIR+=contrib/restricted/emscripten/system/lib/standalonewasm
}
}

Expand Down
45 changes: 37 additions & 8 deletions contrib/libs/cxxsupp/libcxx/.yandex_meta/scripts/sysincls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
assert sysincl.count("# END OF GENERATION") == 1

headers = []
ext_headers = []
expr_headers = []

for header in include_dir.glob("**/*"):
if not header.is_file():
Expand All @@ -23,29 +25,56 @@

if header.parent == include_dir:
if header.name.startswith("__") or not '.' in header.name:
headers.append(rel_path)
headers.append(str(rel_path))
else:
str_path = str(rel_path)
if str_path.startswith('experimental') or str_path.startswith('ext'):
continue
headers.append(rel_path)
if str_path.startswith('experimental'):
expr_headers.append(str_path)
elif str_path.startswith('ext'):
ext_headers.append(str_path)
else:
headers.append(str_path)

headers = sorted(headers, key = lambda header: (str(header).count('/') != 0, str(header).count('__') != 0, header))

headers = sorted(headers, key = lambda header: (header.count('/') != 0, header.count('__') != 0, header))
ext_headers = sorted(ext_headers)
expr_headers = sorted(expr_headers)

manual, generated = sysincl.split(GENERATED_BEG)
generated, manual_end = generated.split(GENERATED_END)

generated = []
banned_generated = []

for header in ext_headers + expr_headers:
banned_generated.append(
" - {name}:{spaces}DO_NOT_INCLUDE_NON_STANDARD_{banned_name}".format(
name=str(header),
spaces=' ' * max(1, 54 - len(header)),
banned_name=header.replace('/', '_').replace('.', '_').upper(),
)
)
if "experimental/propagate_const" == header:
banned_generated[-1] = "#TODO: ban this header too\n#" + banned_generated[-1]

for header in headers:
generated.append(
" - {name}:{spaces}contrib/libs/cxxsupp/libcxx/include/{name}".format(
name=str(header),
spaces=' ' * max(1, 54 - len(str(header)))
name=header,
spaces=' ' * max(1, 54 - len(header))
)
)

generated = "- includes:\n" + '\n'.join(generated)
generated = """- source_filter: "^(?!(contrib/libs/cxxsupp/libcxx)).*"
includes:
""" \
+ '\n'.join(banned_generated) \
+ """
# This includes all headers needed to resolve includes in c-headers from libcxx listed above
- includes:
""" \
+ '\n'.join(generated)

with open(sysicncl_path, 'w') as f:
f.write(f"{manual}{GENERATED_BEG}{generated}\n{GENERATED_END}{manual_end}")
Loading

0 comments on commit 4c4b273

Please sign in to comment.