Browse Source

Merge branch 'rightlib' into mergelibs-240918-0758

Alexander Smirnov 5 months ago
parent
commit
636052a930

+ 1 - 0
build/conf/autoincludes.json

@@ -0,0 +1 @@
+[]

+ 7 - 0
build/conf/compilers/gnu_compiler.conf

@@ -75,9 +75,16 @@ when ($ARCH_XTENSA == "yes") {
 when ($OS_EMSCRIPTEN == "yes") {
     FSTACK=-fno-stack-protector
     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

+ 1 - 0
build/conf/java.conf

@@ -585,6 +585,7 @@ module JAVA_CONTRIB_PROXY: _JAR_BASE {
     .SEM=JAVA_CONTRIB_PROXY_SEM
 
     _DONT_REQUIRE_LICENSE()
+    WITHOUT_VERSION()
 }
 
 # tag:java-specific

+ 1 - 1
build/conf/proto.conf

@@ -796,7 +796,7 @@ multimodule PROTO_LIBRARY {
 
     module TS_PROTO: _TS_PROTO_IMPL {
         # opt-in. We don't want to have TS_PROTO by default
-        # To include TS_PROTO user have to set INCLUDE_TAGS(TS_PROTO) in ya.make
+        # To include TS_PROTO user have to set INCLUDE_TAGS(TS_PROTO TS_PREPARE_DEPS) in ya.make
         .INCLUDE_TAG=no
         .EPILOGUE=_TS_CONFIG_EPILOGUE
         .PEERDIRSELF=TS_PREPARE_DEPS

+ 6 - 0
build/conf/python.conf

@@ -364,6 +364,7 @@ module PY2TEST: PYTEST_BIN {
     SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
     NO_CLANG_TIDY()
     _DONT_REQUIRE_LICENSE()
+    WITHOUT_VERSION()
 }
 
 # tag:python-specific tag:deprecated tag:test
@@ -406,11 +407,13 @@ multimodule PY3TEST {
 
         SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
         _DONT_REQUIRE_LICENSE()
+        WITHOUT_VERSION()
     }
 
     module PY3TEST_LIBRARY: PY3_LIBRARY {
         PEERDIR+=library/python/pytest
         _DONT_REQUIRE_LICENSE()
+        WITHOUT_VERSION()
     }
 }
 
@@ -1118,6 +1121,7 @@ multimodule PY23_TEST {
         SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/py2test/result.json)
 
         _DONT_REQUIRE_LICENSE()
+        WITHOUT_VERSION()
     }
     module PY3TEST_PROGRAM: PY3TEST_BIN {
         .FINAL_TARGET=yes
@@ -1129,6 +1133,7 @@ multimodule PY23_TEST {
         SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/py3test/result.json)
 
         _DONT_REQUIRE_LICENSE()
+        WITHOUT_VERSION()
     }
 
     module PY3TEST_LIBRARY: PY3_LIBRARY {
@@ -1137,5 +1142,6 @@ multimodule PY23_TEST {
         RUN_CYTHON_SCRIPT_H=$YMAKE_PYTHON $CYTHON_SCRIPT
 
         _DONT_REQUIRE_LICENSE()
+        WITHOUT_VERSION()
     }
 }

+ 2 - 0
build/conf/settings.conf

@@ -129,3 +129,5 @@ _FOLDABLE_VARS=\
 
 ARCADIA_TEST_ROOT=../arcadia_tests_data/
 DEFAULT_REQUIREMENTS=network:restricted cpu:1 ram:32
+
+AUTOINCLUDE_PATHS=build/conf/autoincludes.json

+ 21 - 1
build/conf/ts/ts_proto.conf

@@ -1,7 +1,8 @@
-_TS_PROTO_SRCS_FILES=
+_TS_PROTO_OPT=
 _TS_PROTO_IMPL_CMD=$TOUCH_UNIT \
     && $_TS_FILES_COPY_CMD \
     && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-ts-proto $NOTS_TOOL_COMMON_BUILDER_ARGS \
+        ${_TS_PROTO_OPT} \
         --protoc-bin $PROTOC \
         --proto-srcs $_TS_PROTO_SRCS_FILES \
         --proto-paths ./$PROTO_NAMESPACE $ARCADIA_ROOT/$PROTO_NAMESPACE $_PROTO__INCLUDE $ARCADIA_BUILD_ROOT $PROTOBUF_INCLUDE_PATH \
@@ -45,3 +46,22 @@ module _TS_PROTO_IMPL: _TS_BASE_UNIT {
 macro _TS_PROTO_SRCS(FILES...) {
     _SET_APPEND_WITH_DIRECTIVE(_TS_PROTO_SRCS_FILES input $FILES)
 }
+
+### @usage: TS_PROTO_OPT(key1=value1 key2=value2)
+###
+### Overrides default options for `--ts_proto_opt`
+### ([supported options](https://github.com/stephenh/ts-proto?tab=readme-ov-file#supported-options)).
+###
+### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/PROTO_LIBRARY#ts_proto_opt
+###
+### @example
+###
+###     TS_PROTO_OPT(env=browser)
+###     TS_PROTO_OPT(
+###         useJsonName=true
+###         useJsonWireFormat=true
+###     )
+###
+macro TS_PROTO_OPT(OPTS...) {
+    SET_APPEND(_TS_PROTO_OPT ${pre=--ts-proto-opt :OPTS})
+}

+ 32 - 0
build/conf/ts/ts_test.conf

@@ -113,6 +113,38 @@ module TS_TEST_PLAYWRIGHT_FOR: _TS_TEST_BASE {
     _TS_TEST_FOR_CONFIGURE(playwright playwright.config.ts workspace_node_modules.tar)
 }
 
+TS_TEST_PLAYWRIGHT_LARGE_CMD=$TOUCH_UNIT \
+    && ${cwd:BINDIR} $MOVE_FILE ${input:TS_TEST_NM} ${output:"workspace_node_modules.tar"} \
+    ${kv;hide:"p TSPW"} ${kv;hide:"pc magenta"}
+
+### @usage: TS_TEST_PLAYWRIGHT_LARGE_FOR(Path)
+###
+### Defines testing module with playwright test runner.
+###
+### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_TEST_PLAYWRIGHT_FOR
+###
+### @example
+###
+###     TS_TEST_PLAYWRIGHT_LARGE_FOR(path/to/module)
+###         TS_TEST_SRCS(../src)
+###         TS_TEST_CONFIG(../playwright.config.js)
+###     END()
+###
+module TS_TEST_PLAYWRIGHT_LARGE_FOR: _TS_TEST_BASE {
+    .CMD=TS_TEST_PLAYWRIGHT_LARGE_CMD
+
+    # for multimodule peers we should choose TS
+    SET(PEERDIR_TAGS TS)
+
+    # compatibility with old TS_TEST_SRCS
+    SET(TS_TEST_EXTENSION (playwright|spec).(ts|js))
+
+    TS_TEST_DEPENDS_ON_BUILD()
+    _DEPENDS_ON_MOD()
+    _PEERDIR_TS_RESOURCE(nodejs playwright)
+    _TS_TEST_FOR_CONFIGURE(playwright_large playwright.config.ts workspace_node_modules.tar)
+}
+
 ### # internal
 module _TS_TEST_BASE: _BARE_UNIT {
     # ignore SRCS macro

+ 37 - 12
build/export_generators/cmake/cmake/conan_provider.cmake

@@ -210,16 +210,37 @@ function(detect_lib_cxx lib_cxx)
 endfunction()
 
 
-function(detect_compiler compiler compiler_version compiler_runtime compiler_runtime_type)
+
+function(detect_compiler_and_version language compiler compiler_version compiler_is_clang_cl)
+    if (${CMAKE_${language}_COMPILER_ID} STREQUAL Clang
+            AND "${CMAKE_${language}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
+            AND "${CMAKE_${language}_SIMULATE_ID}" STREQUAL "MSVC")
+
+        # set it to MSVC because some packages like 'OpenSSL 1.1.1t' have issues with clang-cl.
+        set(_compiler MSVC)
+        set(${compiler_is_clang_cl} 1 PARENT_SCOPE)
+    else()
+        set(_compiler ${CMAKE_${language}_COMPILER_ID})
+        set(${compiler_is_clang_cl} 0 PARENT_SCOPE)
+    endif()
+    if(_compiler MATCHES MSVC)
+        string(SUBSTRING ${MSVC_VERSION} 0 3 _compiler_version)
+    else()
+        set(_compiler_version ${CMAKE_${language}_COMPILER_VERSION})
+    endif()
+    set(${compiler} ${_compiler} PARENT_SCOPE)
+    set(${compiler_version} ${_compiler_version} PARENT_SCOPE)
+endfunction()
+
+
+function(detect_compiler compiler compiler_version compiler_runtime compiler_runtime_type compiler_is_clang_cl)
     if(DEFINED CMAKE_CXX_COMPILER_ID)
-        set(_compiler ${CMAKE_CXX_COMPILER_ID})
-        set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+        detect_compiler_and_version(CXX _compiler _compiler_version _compiler_is_clang_cl)
     else()
         if(NOT DEFINED CMAKE_C_COMPILER_ID)
             message(FATAL_ERROR "C or C++ compiler not defined")
         endif()
-        set(_compiler ${CMAKE_C_COMPILER_ID})
-        set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+        detect_compiler_and_version(C _compiler _compiler_version _compiler_is_clang_cl)
     endif()
 
     message(STATUS "CMake-Conan: CMake compiler=${_compiler}")
@@ -227,7 +248,6 @@ function(detect_compiler compiler compiler_version compiler_runtime compiler_run
 
     if(_compiler MATCHES MSVC)
         set(_compiler "msvc")
-        string(SUBSTRING ${MSVC_VERSION} 0 3 _compiler_version)
         # Configure compiler.runtime and compiler.runtime_type settings for MSVC
         if(CMAKE_MSVC_RUNTIME_LIBRARY)
             set(_msvc_runtime_library ${CMAKE_MSVC_RUNTIME_LIBRARY})
@@ -293,6 +313,7 @@ function(detect_compiler compiler compiler_version compiler_runtime compiler_run
     set(${compiler_version} ${_compiler_version} PARENT_SCOPE)
     set(${compiler_runtime} ${_compiler_runtime} PARENT_SCOPE)
     set(${compiler_runtime_type} ${_compiler_runtime_type} PARENT_SCOPE)
+    set(${compiler_is_clang_cl} ${_compiler_is_clang_cl} PARENT_SCOPE)
 endfunction()
 
 
@@ -328,7 +349,7 @@ macro(append_compiler_executables_configuration)
     set(_conan_rc_compiler "")
     set(_conan_compilers_list "")
     if(CMAKE_C_COMPILER)
-        set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\"")
+        set(_conan_c_compiler "\"c\":\"\\\"${CMAKE_C_COMPILER}\\\"\"")
         set_conan_compiler_if_appleclang(C cc _conan_c_compiler)
         list(APPEND _conan_compilers_list ${_conan_c_compiler})
     else()
@@ -336,7 +357,7 @@ macro(append_compiler_executables_configuration)
                         "Please define CMAKE_C_COMPILER or enable the C language.")
     endif()
     if(CMAKE_CXX_COMPILER)
-        set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"")
+        set(_conan_cpp_compiler "\"cpp\":\"\\\"${CMAKE_CXX_COMPILER}\\\"\"")
         set_conan_compiler_if_appleclang(CXX c++ _conan_cpp_compiler)
         list(APPEND _conan_compilers_list ${_conan_cpp_compiler})
     else()
@@ -344,7 +365,7 @@ macro(append_compiler_executables_configuration)
                         "Please define CMAKE_CXX_COMPILER or enable the C++ language.")
     endif()
     if(CMAKE_RC_COMPILER)
-        set(_conan_rc_compiler "\"rc\":\"${CMAKE_RC_COMPILER}\"")
+        set(_conan_rc_compiler "\"rc\":\"\\\"${CMAKE_RC_COMPILER}\\\"\"")
         list(APPEND _conan_compilers_list ${_conan_rc_compiler})
         # Not necessary to warn if RC not defined
     endif()
@@ -362,7 +383,7 @@ endmacro()
 function(detect_host_profile output_file)
     detect_os(os os_api_level os_sdk os_subsystem os_version)
     detect_arch(arch)
-    detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type)
+    detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type compiler_is_clang_cl)
     detect_cxx_standard(compiler_cppstd)
     detect_lib_cxx(compiler_libcxx)
     detect_build_type(build_type)
@@ -418,8 +439,12 @@ function(detect_host_profile output_file)
     string(APPEND profile "[conf]\n")
     string(APPEND profile "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n")
 
-    # propagate compilers via profile
-    append_compiler_executables_configuration()
+    if (NOT compiler_is_clang_cl)
+        # propagate compilers via profile
+        append_compiler_executables_configuration()
+    else()
+        message(STATUS "CMake-Conan: do not propagate compilers via profile for clang-cl")
+    endif()
 
     if(os STREQUAL "Android")
         string(APPEND profile "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n")

+ 5 - 5
build/external_resources/ymake/public.resources.json

@@ -1,19 +1,19 @@
 {
     "by_platform": {
         "darwin": {
-            "uri": "sbr:7070261862"
+            "uri": "sbr:7095381929"
         },
         "darwin-arm64": {
-            "uri": "sbr:7070261345"
+            "uri": "sbr:7095381018"
         },
         "linux": {
-            "uri": "sbr:7070262933"
+            "uri": "sbr:7095384078"
         },
         "linux-aarch64": {
-            "uri": "sbr:7070260816"
+            "uri": "sbr:7095380204"
         },
         "win32-clang-cl": {
-            "uri": "sbr:7070262364"
+            "uri": "sbr:7095382771"
         }
     }
 }

Some files were not shown because too many files changed in this diff