diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /build | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build')
155 files changed, 7601 insertions, 7601 deletions
diff --git a/build/conf/compilers/gnu_compiler.conf b/build/conf/compilers/gnu_compiler.conf index 373be5bedd..67ff2f4d0c 100644 --- a/build/conf/compilers/gnu_compiler.conf +++ b/build/conf/compilers/gnu_compiler.conf @@ -1,470 +1,470 @@ -_C_DEFINES_ANDROID= -_C_DEFINES_ANDROID_OTHERWISE= -when ($OS_ANDROID == "yes") { - _C_DEFINES_ANDROID=-DANDROID_FAKEID=$ANDROID_FAKEID -} -otherwise { - # There is no usable _FILE_OFFSET_BITS=64 support in Androids until API 21. And it's incomplete until at least API 24. - # https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md - # Arcadia have API 16 for 32-bit Androids. - _C_DEFINES_ANDROID_OTHERWISE=-D_FILE_OFFSET_BITS=64 -} - -_C_DEFINES_GNU_SOURCE= -when ($OS_LINUX == "yes" || $OS_ANDROID == "yes" || $OS_CYGWIN == "yes") { - _C_DEFINES_GNU_SOURCE=-D_GNU_SOURCE -} - -_C_DEFINES_CLANG_LINUX_X86_64= -when ($CLANG == "yes" && $OS_LINUX == "yes" && $ARCH_X86_64 == "yes") { - _C_DEFINES_CLANG_LINUX_X86_64=-D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE -} - -_C_DEFINES_IOS= -when ($OS_IOS == "yes") { - _C_DEFINES_IOS=-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -} - -_C_DEFINES_WITH_VALGRIND= -when ($WITH_VALGRIND == "yes") { - _C_DEFINES_WITH_VALGRIND=-DWITH_VALGRIND=1 -} - -C_DEFINES =-DFAKEID=$CPP_FAKEID -C_DEFINES+=$_C_DEFINES_ANDROID -C_DEFINES+=\ --DARCADIA_ROOT=${ARCADIA_ROOT} \ --DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT} \ --D_THREAD_SAFE \ --D_PTHREADS \ --D_REENTRANT \ --D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES \ --D_LARGEFILE_SOURCE \ --D__STDC_CONSTANT_MACROS \ --D__STDC_FORMAT_MACROS -C_DEFINES+=$_C_DEFINES_ANDROID_OTHERWISE -C_DEFINES+=$_C_DEFINES_GNU_SOURCE -C_DEFINES+=$_C_DEFINES_CLANG_LINUX_X86_64 -C_DEFINES+=$_C_DEFINES_IOS -C_DEFINES+=$_C_DEFINES_WITH_VALGRIND -C_DEFINES+=$_C_DEFINES_NDEBUG - -_C_FOPTIONS_INIT_ARRAY= -when ($CLANG == "yes" && $OS_LINUX == "yes") { - # Use .init_array instead of .ctors (default for old clang versions) - # See: https://maskray.me/blog/2021-11-07-init-ctors-init-array - _C_FOPTIONS_INIT_ARRAY=-fuse-init-array -} - -_C_FOPTIONS_COLOR= -_C_FOPTIONS_ALIGNED_ALLOCATION= -when ($CLANG == "yes") { - # Set up output colorization - _C_FOPTIONS_COLOR=-fcolor-diagnostics - # Enable aligned allocation - _C_FOPTIONS_ALIGNED_ALLOCATION=-faligned-allocation -} -elsewhen ($GCC == "yes") { - # Set up output colorization - _C_FOPTIONS_COLOR=-fdiagnostics-color=always - # It looks like there is no way to enable aligned allocation in gcc -} - -_C_FOPTIONS_MAPSMOBI_ARM= -when ($OS_IOS == "yes") { - when ($MAPSMOBI_BUILD_TARGET == "yes" && $ARCH_ARM == "yes") { - _C_FOPTIONS_MAPSMOBI_ARM=-fembed-bitcode - } -} - -_C_WARNINGS_CLANG= -_CXX_WARNINGS_CLANG= -when ($CLANG == "yes") { - - _CXX_WARNINGS_CLANG=\ --Wimport-preprocessor-directive-pedantic \ --Wno-undefined-var-template \ --Wno-return-std-move \ --Wno-address-of-packed-member \ --Wno-defaulted-function-deleted \ --Wno-pessimizing-move \ --Wno-range-loop-construct \ --Wno-deprecated-anon-enum-enum-conversion \ --Wno-deprecated-enum-enum-conversion \ --Wno-deprecated-enum-float-conversion \ --Wno-ambiguous-reversed-operator \ --Wno-deprecated-volatile - -# -Wno-unknown-warning-option -# For nvcc to accept the above. - _C_WARNINGS_CLANG=\ --Wno-implicit-const-int-float-conversion \ --Wno-unknown-warning-option - -} - -_C_FOPTIONS_GCC= -when ($GCC == "yes") { - _C_FOPTIONS_GCC=-fno-delete-null-pointer-checks -fabi-version=8 -} - -_C_FOPTIONS_IOS= -when ($OS_IOS != "yes") { - # Split all functions and data into separate sections for DCE and ICF linker passes - # NOTE: iOS build uses -fembed-bitcode which conflicts with -ffunction-sections (only relevant for ELF targets) - _C_FOPTIONS_IOS=-ffunction-sections -fdata-sections -} - -_C_FOPTIONS_DEBUG= -when ($_BUILD_DEBUG == "yes") { - _C_FOPTIONS_DEBUG=$FSTACK -} - -_C_FLAGS_RELEASE= -_C_FOPTIONS_RELEASE= -_OPTIMIZE_RELEASE= -when ($_BUILD_RELEASE == "yes") { - _C_FLAGS_RELEASE=$OPTIMIZE - when ($_BUILD_SIZE_OPTIMIZED == "yes") { - # -Oz is clang's more size-aggressive version of -Os - # For ARM specifically, clang -Oz is on par with gcc -Os: - # https://github.com/android/ndk/issues/133#issuecomment-365763507 - when($CLANG == "yes") { - _OPTIMIZE_RELEASE=-Oz - } - otherwise { - _OPTIMIZE_RELEASE=-Os - } - - # Generate sections with address significance tables for ICF linker pass - when($CLANG == "yes") { - _C_FOPTIONS_RELEASE=-faddrsig - } - } - otherwise { - _OPTIMIZE_RELEASE=-O3 - } -} - -_C_FOPTIONS_PROFILER= -when ($_BUILD_PROFILER_TYPE != "") { - when ($_BUILD_PROFILER_TYPE in ["generic", "gprof"]) { - _C_FOPTIONS_PROFILER=-fno-omit-frame-pointer - } -} - -_C_FOPTIONS = - -# Enable C++ exceptions (and allow them to be throw through pure C code) -_C_FOPTIONS+=-fexceptions - -# Enable standard-conforming behavior and generate duplicate symbol error in case of duplicated global constants. -# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678#c0 -_C_FOPTIONS+=-fno-common - -_C_FOPTIONS+=$_C_FOPTIONS_INIT_ARRAY -_C_FOPTIONS+=$_C_FOPTIONS_COLOR -_C_FOPTIONS+=$_C_FOPTIONS_ALIGNED_ALLOCATION -_C_FOPTIONS+=$_C_FOPTIONS_MAPSMOBI_ARM -_C_FOPTIONS+=$_C_FOPTIONS_DEBUG -_C_FOPTIONS+=$_C_FOPTIONS_RELEASE -_C_FOPTIONS+=$_C_FOPTIONS_PROFILER -_C_FOPTIONS+=$_C_FOPTIONS_GCC -_C_FOPTIONS+=$_C_FOPTIONS_IOS - -# Enable default warnings subset -_C_WARNINGS =-Wall -Wextra - -# Disable some warnings which will fail compilation at the time -_C_WARNINGS+=-Wno-parentheses - -_C_WARNINGS+=$_C_WARNINGS_CLANG - -# Issue a warning if certain overload is hidden due to inheritance -_CXX_WARNINGS =-Woverloaded-virtual - -_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG - -_C_FLAGS_ARCH= -when ($ARCH_I386 == "yes") { - _C_FLAGS_ARCH=-m32 -} -when ($ARCH_X86_64 == "yes") { - _C_FLAGS_ARCH=-m64 -} - -_C_FLAGS_FAST_DEBUG= -when ($_BUILD_FAST_DEBUG == "yes") { - _C_FLAGS_FAST_DEBUG=-Og -} - -_C_DEFINES_NDEBUG=-UNDEBUG -when ($_BUILD_WITH_NDEBUG == "yes") { - _C_DEFINES_NDEBUG=-DNDEBUG -} - -_C_FLAGS_PROFILER= -when ($_BUILD_PROFILER_TYPE == "gprof") { - _C_FLAGS_PROFILER=-pg -} - -_C_FLAGS=\ -$CL_DEBUG_INFO $CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__ $_C_FLAGS_ARCH_OPT -pipe -_C_FLAGS+=$_C_FLAGS_ARCH -_C_FLAGS+=$_C_FLAGS_FAST_DEBUG -_C_FLAGS+=$_C_FLAGS_RELEASE -_C_FLAGS+=$_C_FLAGS_PROFILER - -_SFDL_FLAGS=-E -C -x c++ -when ($CLANG == "yes") { - _SFDL_FLAGS+=-Qunused-arguments -} - -_DEBUG_INFO_FLAGS=-g -when ($OS_LINUX == "yes") { - _DEBUG_INFO_FLAGS=-g -ggnu-pubnames -} - -_CROSS_SUFFIX=.pic -when ($FORCE_NO_PIC == "yes") { - _CROSS_SUFFIX= -} - -C_COMPILER=${quo:C_COMPILER_UNQUOTED} -OPTIMIZE=$_OPTIMIZE_RELEASE -FSTACK=-fstack-protector -DUMP_DEPS= -GCC_PREPROCESSOR_OPTS=$DUMP_DEPS $C_DEFINES -C_WARNING_OPTS=$_C_WARNINGS -CXX_WARNING_OPTS=$_CXX_WARNINGS - -# PIE is only valid for executables, while PIC implies a shared library -# `-pie` with a shared library is either ignored or fails to link -when ($PIC == "yes") { - CFLAGS+=-fPIC - LDFLAGS+=-fPIC -} -elsewhen ($PIE == "yes") { - CFLAGS+=-fPIE - LDFLAGS+=-fPIE -pie -} - -CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL -CXXFLAGS+=$CFLAGS $_CXX_STD $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL -CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL -CXX_COMPILER=${quo:CXX_COMPILER_UNQUOTED} -NOGCCSTACKCHECK=yes -SFDL_FLAG=$_SFDL_FLAGS -o $SFDL_TMP_OUT -WERROR_FLAG=-Werror -DEBUG_INFO_FLAGS=$_DEBUG_INFO_FLAGS - -when ($NO_WSHADOW == "yes") { - C_WARNING_OPTS += -Wno-shadow -} -when ($NO_COMPILER_WARNINGS == "yes") { - C_WARNING_OPTS = -w - CXX_WARNING_OPTS = -Wno-everything -} -when ($NO_OPTIMIZE == "yes") { - OPTIMIZE = -O0 -} -when ($SAVE_TEMPS == "yes") { - CXXFLAGS += -save-temps -} -when ($NOGCCSTACKCHECK != "yes") { - FSTACK += -fstack-check -} - -# _C_DEBUG_LIGHT=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -# _C_DEBUG_LIGHT_CL=$_C_DEBUG_LIGHT -Xclang -fdebug-compilation-dir -Xclang /tmp -# _C_DEBUG=$_C_DEBUG_LIGHT -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T -# _C_DEBUG_CL=$_C_DEBUG -Xclang -fdebug-compilation-dir -Xclang /tmp -# _YASM_DEBUG_LIGHT=--replace=${ARCADIA_BUILD_ROOT}=/-B -# _YASM_DEBUG=$_YASM_DEBUG_LIGHT --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T -# when ($FORCE_CONSISTENT_DEBUG == "yes") { -# when ($CLANG == "yes") { -# CL_DEBUG_INFO=$_C_DEBUG_CL -# } -# otherwise { -# CL_DEBUG_INFO=$_C_DEBUG -# } -# YASM_DEBUG_INFO=$_YASM_DEBUG -# } -# elsewhen ($CONSISTENT_DEBUG == "yes") { -# when ($CLANG == "yes") { -# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_CL -# } -# otherwise { -# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG -# } -# YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_YASM_DEBUG -# } -# elsewhen ($CONSISTENT_DEBUG_LIGHT == "yes") { -# when ($CLANG == "yes") { -# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_LIGHT_CL -# } -# otherwise { -# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_LIGHT -# } -# YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_YASM_DEBUG_LIGHT -# } -# -# _C_BUILTINS=-Wno-builtin-macro-redefined -D__DATE__="\"""Sep 31 2019""\"" -D__TIME__=\"00:00:00\" -# when ($CLANG == "yes" && $_TC_VERSION_AT_LEAST_10 || $GCC == "yes" && $_TC_VERSION_AT_LEAST_8 == "yes") { -# # XXX does not support non-normalized paths -# _C_BUILTINS+=-fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= -# } -# otherwise { -# # XXX this macro substitution breaks __FILE__ in included sources -# _C_BUILTINS+=-D__FILE__=\"${input;qe;rootrel:SRC}\" -# } -# -# when ($FORCE_CONSISTENT_BUILD == "yes") { -# CL_MACRO_INFO=$_C_BUILTINS -# } -# elsewhen ($CONSISTENT_BUILD == "yes") { -# CL_MACRO_INFO_DISABLE_CACHE__NO_UID__=$_C_BUILTINS -# } - -when ($FORCE_CONSISTENT_DEBUG == "yes") { - when ($CLANG == "yes") { - CL_DEBUG_INFO=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T -Xclang -fdebug-compilation-dir -Xclang /tmp - } - otherwise { - CL_DEBUG_INFO=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T - } - YASM_DEBUG_INFO=--replace=${ARCADIA_BUILD_ROOT}=/-B --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T -} -elsewhen ($CONSISTENT_DEBUG == "yes") { - when ($CLANG == "yes") { - CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T -Xclang -fdebug-compilation-dir -Xclang /tmp - } - otherwise { - CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T - } - YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=--replace=${ARCADIA_BUILD_ROOT}=/-B --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T -} -elsewhen ($CONSISTENT_DEBUG_LIGHT == "yes") { - when ($CLANG == "yes") { - CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -Xclang -fdebug-compilation-dir -Xclang /tmp - } - otherwise { - CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B - } - YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=--replace=${ARCADIA_BUILD_ROOT}=/-B -} - -when ($FORCE_CONSISTENT_BUILD == "yes") { - CL_MACRO_INFO=-Wno-builtin-macro-redefined -D__DATE__=\""Sep 31 2019\"" -D__TIME__=\"00:00:00\" -fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= -} -elsewhen ($CONSISTENT_BUILD == "yes") { - CL_MACRO_INFO_DISABLE_CACHE__NO_UID__=-Wno-builtin-macro-redefined -D__DATE__=\""Sep 31 2019\"" -D__TIME__=\"00:00:00\" -fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= -} - -_CFLAGS_ARCH_I386= -when ($ARCH_I386 == "yes" && $ARCH_I686 != "yes") { - _CFLAGS_ARCH_I386=-march=pentiumpro -mtune=pentiumpro -} - -CFLAGS+=$_CFLAGS_ARCH_I386 - -BC_CFLAGS+=$CFLAGS -BC_CXXFLAGS+=$CXXFLAGS -C_DEFINES+=-D__LONG_LONG_SUPPORTED - -OBJ_CROSS_SUF=$OBJ_SUF$_CROSS_SUFFIX -OBJECT_SUF=$OBJ_SUF$_CROSS_SUFFIX.o -GCC_COMPILE_FLAGS=$EXTRA_C_FLAGS -c -o $_COMPILE_OUTPUTS ${pre=-I:_C__INCLUDE} -EXTRA_COVERAGE_OUTPUT=${output;noauto;hide;suf=${OBJECT_SUF}.gcno:SRC} -CLANG_TIDY_OUTPUT_FILE=${output;noauto;suf=${OBJECT_SUF}.tidyjson:SRC} -YNDEXER_OUTPUT_FILE=${output;noauto;suf=${OBJECT_SUF}.ydx.pb2:SRC} - -when ($DUMP_COMPILER_DEPS == "yes") { - DUMP_DEPS=-MD ${output;hide;noauto;suf=${OBJ_SUF}.o.d:SRC} -} -elsewhen ($DUMP_COMPILER_DEPS_FAST == "yes") { - DUMP_DEPS=-E -M -MF ${output;noauto;suf=${OBJ_SUF}.o.d:SRC} -} - -_COMPILER_TIME_TRACE_GRANULARITY=500 -when ($TIME_TRACE_GRANULARITY && $TIME_TRACE_GRANULARITY != "") { - _COMPILER_TIME_TRACE_GRANULARITY=$TIME_TRACE_GRANULARITY -} - -_COMPILER_TIME_TRACE_FLAGS= -_COMPILER_TIME_TRACE_POSTPROCESS= -when (($TIME_TRACE == "yes" || $COMPILER_TIME_TRACE == "yes") && $CLANG == "yes" && $_TC_VERSION_AT_LEAST_9 == "yes") { - _COMPILER_TIME_TRACE_FLAGS=-ftime-trace -ftime-trace-granularity=$_COMPILER_TIME_TRACE_GRANULARITY - _COMPILER_TIME_TRACE_POSTPROCESS=$YMAKE_PYTHON ${input:"build/scripts/find_time_trace.py"} $_COMPILE_OUTPUTS $_COMPILE_TIME_TRACE_OUTPUTS -} - -_C_CPP_KV_STYLE=${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"p CC"} ${hide;kv:"pc green"} -_CPP_ARGS=\ -$CLANG_TIDY_ARGS \ -$YNDEXER_ARGS \ -$CXX_COMPILER \ -$C_FLAGS_PLATFORM \ -$GCC_COMPILE_FLAGS \ -$CXXFLAGS \ -$CL_MACRO_INFO \ -$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ \ -$_COMPILER_TIME_TRACE_FLAGS \ -$EXTRA_OUTPUT \ -$SRCFLAGS \ -$_LANG_CFLAGS_VALUE \ -${input:SRC} \ -$TOOLCHAIN_ENV \ -$YNDEXER_OUTPUT \ -&& $_COMPILER_TIME_TRACE_POSTPROCESS \ -$_C_CPP_KV_STYLE - -_C_ARGS=\ -$CLANG_TIDY_ARGS \ -$YNDEXER_ARGS \ -$C_COMPILER \ -$C_FLAGS_PLATFORM \ -$GCC_COMPILE_FLAGS \ -$CFLAGS \ -$CL_MACRO_INFO \ -$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ \ -$_COMPILER_TIME_TRACE_FLAGS \ -$CONLYFLAGS \ -$EXTRA_OUTPUT \ -$SRCFLAGS \ -${input:SRC} \ -$TOOLCHAIN_ENV \ -$YNDEXER_OUTPUT \ -$_C_CPP_KV_STYLE - -### _SRC_C_NODEPS_CMD is obtained from _C_ARGS by filtering the following elements: -### ${input:SRC} -### $CL_MACRO_INFO -### $CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ -### $CLANG_TIDY_ARGS -### $EXTRA_OUTPUT -### $EXTRA_COVERAGE_OUTPUT -### $SRCFLAGS -### $YNDEXER_ARGS -### $YNDEXER_OUTPUT -### -### $GCC_COMPILE_FLAGS is substituted for $EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC} -_SRC_C_NODEPS_CMD=\ -$C_COMPILER \ -$C_FLAGS_PLATFORM \ -$EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC} \ -$CFLAGS \ -$CONLYFLAGS \ -$TOOLCHAIN_ENV \ -$_C_CPP_KV_STYLE - -_SRC_CPP_CMD=$_CPP_ARGS -_SRC_C_CMD=$_C_ARGS -_SRC_M_CMD=$SRC_c($SRC $SRCFLAGS) -_SRC_MASM_CMD=$_EMPTY_CMD - -# fuzzing configuration -when ($CLANG == "yes") { - when ($_TC_VERSION_AT_LEAST_12 == "yes") { - LIBFUZZER_PATH=contrib/libs/libfuzzer12 - } -} +_C_DEFINES_ANDROID= +_C_DEFINES_ANDROID_OTHERWISE= +when ($OS_ANDROID == "yes") { + _C_DEFINES_ANDROID=-DANDROID_FAKEID=$ANDROID_FAKEID +} +otherwise { + # There is no usable _FILE_OFFSET_BITS=64 support in Androids until API 21. And it's incomplete until at least API 24. + # https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md + # Arcadia have API 16 for 32-bit Androids. + _C_DEFINES_ANDROID_OTHERWISE=-D_FILE_OFFSET_BITS=64 +} + +_C_DEFINES_GNU_SOURCE= +when ($OS_LINUX == "yes" || $OS_ANDROID == "yes" || $OS_CYGWIN == "yes") { + _C_DEFINES_GNU_SOURCE=-D_GNU_SOURCE +} + +_C_DEFINES_CLANG_LINUX_X86_64= +when ($CLANG == "yes" && $OS_LINUX == "yes" && $ARCH_X86_64 == "yes") { + _C_DEFINES_CLANG_LINUX_X86_64=-D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE +} + +_C_DEFINES_IOS= +when ($OS_IOS == "yes") { + _C_DEFINES_IOS=-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE +} + +_C_DEFINES_WITH_VALGRIND= +when ($WITH_VALGRIND == "yes") { + _C_DEFINES_WITH_VALGRIND=-DWITH_VALGRIND=1 +} + +C_DEFINES =-DFAKEID=$CPP_FAKEID +C_DEFINES+=$_C_DEFINES_ANDROID +C_DEFINES+=\ +-DARCADIA_ROOT=${ARCADIA_ROOT} \ +-DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT} \ +-D_THREAD_SAFE \ +-D_PTHREADS \ +-D_REENTRANT \ +-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES \ +-D_LARGEFILE_SOURCE \ +-D__STDC_CONSTANT_MACROS \ +-D__STDC_FORMAT_MACROS +C_DEFINES+=$_C_DEFINES_ANDROID_OTHERWISE +C_DEFINES+=$_C_DEFINES_GNU_SOURCE +C_DEFINES+=$_C_DEFINES_CLANG_LINUX_X86_64 +C_DEFINES+=$_C_DEFINES_IOS +C_DEFINES+=$_C_DEFINES_WITH_VALGRIND +C_DEFINES+=$_C_DEFINES_NDEBUG + +_C_FOPTIONS_INIT_ARRAY= +when ($CLANG == "yes" && $OS_LINUX == "yes") { + # Use .init_array instead of .ctors (default for old clang versions) + # See: https://maskray.me/blog/2021-11-07-init-ctors-init-array + _C_FOPTIONS_INIT_ARRAY=-fuse-init-array +} + +_C_FOPTIONS_COLOR= +_C_FOPTIONS_ALIGNED_ALLOCATION= +when ($CLANG == "yes") { + # Set up output colorization + _C_FOPTIONS_COLOR=-fcolor-diagnostics + # Enable aligned allocation + _C_FOPTIONS_ALIGNED_ALLOCATION=-faligned-allocation +} +elsewhen ($GCC == "yes") { + # Set up output colorization + _C_FOPTIONS_COLOR=-fdiagnostics-color=always + # It looks like there is no way to enable aligned allocation in gcc +} + +_C_FOPTIONS_MAPSMOBI_ARM= +when ($OS_IOS == "yes") { + when ($MAPSMOBI_BUILD_TARGET == "yes" && $ARCH_ARM == "yes") { + _C_FOPTIONS_MAPSMOBI_ARM=-fembed-bitcode + } +} + +_C_WARNINGS_CLANG= +_CXX_WARNINGS_CLANG= +when ($CLANG == "yes") { + + _CXX_WARNINGS_CLANG=\ +-Wimport-preprocessor-directive-pedantic \ +-Wno-undefined-var-template \ +-Wno-return-std-move \ +-Wno-address-of-packed-member \ +-Wno-defaulted-function-deleted \ +-Wno-pessimizing-move \ +-Wno-range-loop-construct \ +-Wno-deprecated-anon-enum-enum-conversion \ +-Wno-deprecated-enum-enum-conversion \ +-Wno-deprecated-enum-float-conversion \ +-Wno-ambiguous-reversed-operator \ +-Wno-deprecated-volatile + +# -Wno-unknown-warning-option +# For nvcc to accept the above. + _C_WARNINGS_CLANG=\ +-Wno-implicit-const-int-float-conversion \ +-Wno-unknown-warning-option + +} + +_C_FOPTIONS_GCC= +when ($GCC == "yes") { + _C_FOPTIONS_GCC=-fno-delete-null-pointer-checks -fabi-version=8 +} + +_C_FOPTIONS_IOS= +when ($OS_IOS != "yes") { + # Split all functions and data into separate sections for DCE and ICF linker passes + # NOTE: iOS build uses -fembed-bitcode which conflicts with -ffunction-sections (only relevant for ELF targets) + _C_FOPTIONS_IOS=-ffunction-sections -fdata-sections +} + +_C_FOPTIONS_DEBUG= +when ($_BUILD_DEBUG == "yes") { + _C_FOPTIONS_DEBUG=$FSTACK +} + +_C_FLAGS_RELEASE= +_C_FOPTIONS_RELEASE= +_OPTIMIZE_RELEASE= +when ($_BUILD_RELEASE == "yes") { + _C_FLAGS_RELEASE=$OPTIMIZE + when ($_BUILD_SIZE_OPTIMIZED == "yes") { + # -Oz is clang's more size-aggressive version of -Os + # For ARM specifically, clang -Oz is on par with gcc -Os: + # https://github.com/android/ndk/issues/133#issuecomment-365763507 + when($CLANG == "yes") { + _OPTIMIZE_RELEASE=-Oz + } + otherwise { + _OPTIMIZE_RELEASE=-Os + } + + # Generate sections with address significance tables for ICF linker pass + when($CLANG == "yes") { + _C_FOPTIONS_RELEASE=-faddrsig + } + } + otherwise { + _OPTIMIZE_RELEASE=-O3 + } +} + +_C_FOPTIONS_PROFILER= +when ($_BUILD_PROFILER_TYPE != "") { + when ($_BUILD_PROFILER_TYPE in ["generic", "gprof"]) { + _C_FOPTIONS_PROFILER=-fno-omit-frame-pointer + } +} + +_C_FOPTIONS = + +# Enable C++ exceptions (and allow them to be throw through pure C code) +_C_FOPTIONS+=-fexceptions + +# Enable standard-conforming behavior and generate duplicate symbol error in case of duplicated global constants. +# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678#c0 +_C_FOPTIONS+=-fno-common + +_C_FOPTIONS+=$_C_FOPTIONS_INIT_ARRAY +_C_FOPTIONS+=$_C_FOPTIONS_COLOR +_C_FOPTIONS+=$_C_FOPTIONS_ALIGNED_ALLOCATION +_C_FOPTIONS+=$_C_FOPTIONS_MAPSMOBI_ARM +_C_FOPTIONS+=$_C_FOPTIONS_DEBUG +_C_FOPTIONS+=$_C_FOPTIONS_RELEASE +_C_FOPTIONS+=$_C_FOPTIONS_PROFILER +_C_FOPTIONS+=$_C_FOPTIONS_GCC +_C_FOPTIONS+=$_C_FOPTIONS_IOS + +# Enable default warnings subset +_C_WARNINGS =-Wall -Wextra + +# Disable some warnings which will fail compilation at the time +_C_WARNINGS+=-Wno-parentheses + +_C_WARNINGS+=$_C_WARNINGS_CLANG + +# Issue a warning if certain overload is hidden due to inheritance +_CXX_WARNINGS =-Woverloaded-virtual + +_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG + +_C_FLAGS_ARCH= +when ($ARCH_I386 == "yes") { + _C_FLAGS_ARCH=-m32 +} +when ($ARCH_X86_64 == "yes") { + _C_FLAGS_ARCH=-m64 +} + +_C_FLAGS_FAST_DEBUG= +when ($_BUILD_FAST_DEBUG == "yes") { + _C_FLAGS_FAST_DEBUG=-Og +} + +_C_DEFINES_NDEBUG=-UNDEBUG +when ($_BUILD_WITH_NDEBUG == "yes") { + _C_DEFINES_NDEBUG=-DNDEBUG +} + +_C_FLAGS_PROFILER= +when ($_BUILD_PROFILER_TYPE == "gprof") { + _C_FLAGS_PROFILER=-pg +} + +_C_FLAGS=\ +$CL_DEBUG_INFO $CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__ $_C_FLAGS_ARCH_OPT -pipe +_C_FLAGS+=$_C_FLAGS_ARCH +_C_FLAGS+=$_C_FLAGS_FAST_DEBUG +_C_FLAGS+=$_C_FLAGS_RELEASE +_C_FLAGS+=$_C_FLAGS_PROFILER + +_SFDL_FLAGS=-E -C -x c++ +when ($CLANG == "yes") { + _SFDL_FLAGS+=-Qunused-arguments +} + +_DEBUG_INFO_FLAGS=-g +when ($OS_LINUX == "yes") { + _DEBUG_INFO_FLAGS=-g -ggnu-pubnames +} + +_CROSS_SUFFIX=.pic +when ($FORCE_NO_PIC == "yes") { + _CROSS_SUFFIX= +} + +C_COMPILER=${quo:C_COMPILER_UNQUOTED} +OPTIMIZE=$_OPTIMIZE_RELEASE +FSTACK=-fstack-protector +DUMP_DEPS= +GCC_PREPROCESSOR_OPTS=$DUMP_DEPS $C_DEFINES +C_WARNING_OPTS=$_C_WARNINGS +CXX_WARNING_OPTS=$_CXX_WARNINGS + +# PIE is only valid for executables, while PIC implies a shared library +# `-pie` with a shared library is either ignored or fails to link +when ($PIC == "yes") { + CFLAGS+=-fPIC + LDFLAGS+=-fPIC +} +elsewhen ($PIE == "yes") { + CFLAGS+=-fPIE + LDFLAGS+=-fPIE -pie +} + +CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL +CXXFLAGS+=$CFLAGS $_CXX_STD $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL +CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL +CXX_COMPILER=${quo:CXX_COMPILER_UNQUOTED} +NOGCCSTACKCHECK=yes +SFDL_FLAG=$_SFDL_FLAGS -o $SFDL_TMP_OUT +WERROR_FLAG=-Werror +DEBUG_INFO_FLAGS=$_DEBUG_INFO_FLAGS + +when ($NO_WSHADOW == "yes") { + C_WARNING_OPTS += -Wno-shadow +} +when ($NO_COMPILER_WARNINGS == "yes") { + C_WARNING_OPTS = -w + CXX_WARNING_OPTS = -Wno-everything +} +when ($NO_OPTIMIZE == "yes") { + OPTIMIZE = -O0 +} +when ($SAVE_TEMPS == "yes") { + CXXFLAGS += -save-temps +} +when ($NOGCCSTACKCHECK != "yes") { + FSTACK += -fstack-check +} + +# _C_DEBUG_LIGHT=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B +# _C_DEBUG_LIGHT_CL=$_C_DEBUG_LIGHT -Xclang -fdebug-compilation-dir -Xclang /tmp +# _C_DEBUG=$_C_DEBUG_LIGHT -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T +# _C_DEBUG_CL=$_C_DEBUG -Xclang -fdebug-compilation-dir -Xclang /tmp +# _YASM_DEBUG_LIGHT=--replace=${ARCADIA_BUILD_ROOT}=/-B +# _YASM_DEBUG=$_YASM_DEBUG_LIGHT --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T +# when ($FORCE_CONSISTENT_DEBUG == "yes") { +# when ($CLANG == "yes") { +# CL_DEBUG_INFO=$_C_DEBUG_CL +# } +# otherwise { +# CL_DEBUG_INFO=$_C_DEBUG +# } +# YASM_DEBUG_INFO=$_YASM_DEBUG +# } +# elsewhen ($CONSISTENT_DEBUG == "yes") { +# when ($CLANG == "yes") { +# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_CL +# } +# otherwise { +# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG +# } +# YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_YASM_DEBUG +# } +# elsewhen ($CONSISTENT_DEBUG_LIGHT == "yes") { +# when ($CLANG == "yes") { +# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_LIGHT_CL +# } +# otherwise { +# CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_C_DEBUG_LIGHT +# } +# YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=$_YASM_DEBUG_LIGHT +# } +# +# _C_BUILTINS=-Wno-builtin-macro-redefined -D__DATE__="\"""Sep 31 2019""\"" -D__TIME__=\"00:00:00\" +# when ($CLANG == "yes" && $_TC_VERSION_AT_LEAST_10 || $GCC == "yes" && $_TC_VERSION_AT_LEAST_8 == "yes") { +# # XXX does not support non-normalized paths +# _C_BUILTINS+=-fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= +# } +# otherwise { +# # XXX this macro substitution breaks __FILE__ in included sources +# _C_BUILTINS+=-D__FILE__=\"${input;qe;rootrel:SRC}\" +# } +# +# when ($FORCE_CONSISTENT_BUILD == "yes") { +# CL_MACRO_INFO=$_C_BUILTINS +# } +# elsewhen ($CONSISTENT_BUILD == "yes") { +# CL_MACRO_INFO_DISABLE_CACHE__NO_UID__=$_C_BUILTINS +# } + +when ($FORCE_CONSISTENT_DEBUG == "yes") { + when ($CLANG == "yes") { + CL_DEBUG_INFO=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T -Xclang -fdebug-compilation-dir -Xclang /tmp + } + otherwise { + CL_DEBUG_INFO=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T + } + YASM_DEBUG_INFO=--replace=${ARCADIA_BUILD_ROOT}=/-B --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T +} +elsewhen ($CONSISTENT_DEBUG == "yes") { + when ($CLANG == "yes") { + CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T -Xclang -fdebug-compilation-dir -Xclang /tmp + } + otherwise { + CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -fdebug-prefix-map=${ARCADIA_ROOT}=/-S -fdebug-prefix-map=$(TOOL_ROOT)=/-T + } + YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=--replace=${ARCADIA_BUILD_ROOT}=/-B --replace=${ARCADIA_ROOT}=/-S --replace=$(TOOL_ROOT)=/-T +} +elsewhen ($CONSISTENT_DEBUG_LIGHT == "yes") { + when ($CLANG == "yes") { + CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B -Xclang -fdebug-compilation-dir -Xclang /tmp + } + otherwise { + CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__=-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B + } + YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__=--replace=${ARCADIA_BUILD_ROOT}=/-B +} + +when ($FORCE_CONSISTENT_BUILD == "yes") { + CL_MACRO_INFO=-Wno-builtin-macro-redefined -D__DATE__=\""Sep 31 2019\"" -D__TIME__=\"00:00:00\" -fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= +} +elsewhen ($CONSISTENT_BUILD == "yes") { + CL_MACRO_INFO_DISABLE_CACHE__NO_UID__=-Wno-builtin-macro-redefined -D__DATE__=\""Sep 31 2019\"" -D__TIME__=\"00:00:00\" -fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/= -fmacro-prefix-map=${ARCADIA_ROOT}/= -fmacro-prefix-map=$(TOOL_ROOT)/= +} + +_CFLAGS_ARCH_I386= +when ($ARCH_I386 == "yes" && $ARCH_I686 != "yes") { + _CFLAGS_ARCH_I386=-march=pentiumpro -mtune=pentiumpro +} + +CFLAGS+=$_CFLAGS_ARCH_I386 + +BC_CFLAGS+=$CFLAGS +BC_CXXFLAGS+=$CXXFLAGS +C_DEFINES+=-D__LONG_LONG_SUPPORTED + +OBJ_CROSS_SUF=$OBJ_SUF$_CROSS_SUFFIX +OBJECT_SUF=$OBJ_SUF$_CROSS_SUFFIX.o +GCC_COMPILE_FLAGS=$EXTRA_C_FLAGS -c -o $_COMPILE_OUTPUTS ${pre=-I:_C__INCLUDE} +EXTRA_COVERAGE_OUTPUT=${output;noauto;hide;suf=${OBJECT_SUF}.gcno:SRC} +CLANG_TIDY_OUTPUT_FILE=${output;noauto;suf=${OBJECT_SUF}.tidyjson:SRC} +YNDEXER_OUTPUT_FILE=${output;noauto;suf=${OBJECT_SUF}.ydx.pb2:SRC} + +when ($DUMP_COMPILER_DEPS == "yes") { + DUMP_DEPS=-MD ${output;hide;noauto;suf=${OBJ_SUF}.o.d:SRC} +} +elsewhen ($DUMP_COMPILER_DEPS_FAST == "yes") { + DUMP_DEPS=-E -M -MF ${output;noauto;suf=${OBJ_SUF}.o.d:SRC} +} + +_COMPILER_TIME_TRACE_GRANULARITY=500 +when ($TIME_TRACE_GRANULARITY && $TIME_TRACE_GRANULARITY != "") { + _COMPILER_TIME_TRACE_GRANULARITY=$TIME_TRACE_GRANULARITY +} + +_COMPILER_TIME_TRACE_FLAGS= +_COMPILER_TIME_TRACE_POSTPROCESS= +when (($TIME_TRACE == "yes" || $COMPILER_TIME_TRACE == "yes") && $CLANG == "yes" && $_TC_VERSION_AT_LEAST_9 == "yes") { + _COMPILER_TIME_TRACE_FLAGS=-ftime-trace -ftime-trace-granularity=$_COMPILER_TIME_TRACE_GRANULARITY + _COMPILER_TIME_TRACE_POSTPROCESS=$YMAKE_PYTHON ${input:"build/scripts/find_time_trace.py"} $_COMPILE_OUTPUTS $_COMPILE_TIME_TRACE_OUTPUTS +} + +_C_CPP_KV_STYLE=${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"p CC"} ${hide;kv:"pc green"} +_CPP_ARGS=\ +$CLANG_TIDY_ARGS \ +$YNDEXER_ARGS \ +$CXX_COMPILER \ +$C_FLAGS_PLATFORM \ +$GCC_COMPILE_FLAGS \ +$CXXFLAGS \ +$CL_MACRO_INFO \ +$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ \ +$_COMPILER_TIME_TRACE_FLAGS \ +$EXTRA_OUTPUT \ +$SRCFLAGS \ +$_LANG_CFLAGS_VALUE \ +${input:SRC} \ +$TOOLCHAIN_ENV \ +$YNDEXER_OUTPUT \ +&& $_COMPILER_TIME_TRACE_POSTPROCESS \ +$_C_CPP_KV_STYLE + +_C_ARGS=\ +$CLANG_TIDY_ARGS \ +$YNDEXER_ARGS \ +$C_COMPILER \ +$C_FLAGS_PLATFORM \ +$GCC_COMPILE_FLAGS \ +$CFLAGS \ +$CL_MACRO_INFO \ +$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ \ +$_COMPILER_TIME_TRACE_FLAGS \ +$CONLYFLAGS \ +$EXTRA_OUTPUT \ +$SRCFLAGS \ +${input:SRC} \ +$TOOLCHAIN_ENV \ +$YNDEXER_OUTPUT \ +$_C_CPP_KV_STYLE + +### _SRC_C_NODEPS_CMD is obtained from _C_ARGS by filtering the following elements: +### ${input:SRC} +### $CL_MACRO_INFO +### $CL_MACRO_INFO_DISABLE_CACHE__NO_UID__ +### $CLANG_TIDY_ARGS +### $EXTRA_OUTPUT +### $EXTRA_COVERAGE_OUTPUT +### $SRCFLAGS +### $YNDEXER_ARGS +### $YNDEXER_OUTPUT +### +### $GCC_COMPILE_FLAGS is substituted for $EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC} +_SRC_C_NODEPS_CMD=\ +$C_COMPILER \ +$C_FLAGS_PLATFORM \ +$EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC} \ +$CFLAGS \ +$CONLYFLAGS \ +$TOOLCHAIN_ENV \ +$_C_CPP_KV_STYLE + +_SRC_CPP_CMD=$_CPP_ARGS +_SRC_C_CMD=$_C_ARGS +_SRC_M_CMD=$SRC_c($SRC $SRCFLAGS) +_SRC_MASM_CMD=$_EMPTY_CMD + +# fuzzing configuration +when ($CLANG == "yes") { + when ($_TC_VERSION_AT_LEAST_12 == "yes") { + LIBFUZZER_PATH=contrib/libs/libfuzzer12 + } +} diff --git a/build/conf/compilers/msvc_compiler.conf b/build/conf/compilers/msvc_compiler.conf index 6667f35c5c..d09d51d8bd 100644 --- a/build/conf/compilers/msvc_compiler.conf +++ b/build/conf/compilers/msvc_compiler.conf @@ -1,294 +1,294 @@ -_MSVC_MACRO=_WIN32_WINNT -_MSVC_WINDOWS7=0x0601 -_MSVC_WINDOWS8=0x0602 - -_MSVC_WARNS_ENABLED= -# 'expression' : signed/unsigned mismatch -_MSVC_WARNS_ENABLED+=/w14018 -# 'class' : class has virtual functions, but destructor is not virtual -_MSVC_WARNS_ENABLED+=/w14265 -# 'operator' : expression is always false -_MSVC_WARNS_ENABLED+=/w14296 -# missing type specifier - int assumed -_MSVC_WARNS_ENABLED+=/w14431 - -_MSVC_WARNS_AS_ERRORS= -# 'function' undefined; assuming extern returning int -_MSVC_WARNS_AS_ERRORS+=/we4013 - -_MSVC_WARNS_DISABLED= -# conditional expression is constant -_MSVC_WARNS_DISABLED+=/wd4127 -# nonstandard extension used : zero-sized array in struct/union -_MSVC_WARNS_DISABLED+=/wd4200 -# nonstandard extension used : nameless struct/union -_MSVC_WARNS_DISABLED+=/wd4201 -# elements of array will be default initialized -_MSVC_WARNS_DISABLED+=/wd4351 -# 'this' : used in base member initializer list -_MSVC_WARNS_DISABLED+=/wd4355 -# decorated name length exceeded, name was truncated -_MSVC_WARNS_DISABLED+=/wd4503 -# default constructor could not be generated -_MSVC_WARNS_DISABLED+=/wd4510 -# copy constructor could not be generated -_MSVC_WARNS_DISABLED+=/wd4511 -# assignment operator could not be generated -_MSVC_WARNS_DISABLED+=/wd4512 -# check operator precedence for possible error; use parentheses to clarify precedence -_MSVC_WARNS_DISABLED+=/wd4554 -# 'object' can never be instantiated - user defined constructor required -_MSVC_WARNS_DISABLED+=/wd4610 -# assignment within conditional expression -_MSVC_WARNS_DISABLED+=/wd4706 -# forcing value to bool 'true' or 'false' (performance warning) -_MSVC_WARNS_DISABLED+=/wd4800 -# The POSIX name for this item is deprecated -_MSVC_WARNS_DISABLED+=/wd4996 -# function marked as __forceinline not inlined -_MSVC_WARNS_DISABLED+=/wd4714 -# 'TAtomic' : top-level volatile in cast is ignored -_MSVC_WARNS_DISABLED+=/wd4197 -# 'initializing' : conversion from 'int' to 'ui32', signed/unsigned mismatch -_MSVC_WARNS_DISABLED+=/wd4245 -# 'ystd::function<void (uint8_t *)>': structure was padded due to alignment specifier -_MSVC_WARNS_DISABLED+=/wd4324 -# 'register' is no longer a supported storage class -_MSVC_WARNS_DISABLED+=/wd5033 - -_C_WARNINGS_CLANG_CL= -_CXX_WARNINGS_CLANG_CL= -_CXX_WARNINGS_CLANG_CL_2019= -_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS= -when ($CLANG_CL == "yes") { - _C_WARNINGS_CLANG_CL=\ --Wno-absolute-value \ --Wno-bitwise-op-parentheses \ --Wno-dll-attribute-on-redeclaration \ --Wno-extern-initializer \ --Wno-format \ --Wno-ignored-pragma-optimize \ --Wno-inconsistent-dllimport \ --Wno-int-conversion \ --Wno-int-to-void-pointer-cast \ --Wno-invalid-noreturn \ --Wno-logical-op-parentheses \ --Wno-macro-redefined \ --Wno-parentheses \ --Wno-pragma-pack \ --Wno-tautological-constant-out-of-range-compare \ --Wno-unknown-argument \ --Wno-unknown-warning-option - - _CXX_WARNINGS_CLANG_CL=\ --Woverloaded-virtual \ --Wno-attributes - # IGNIETFERRO-722 needed for contrib - _CXX_WARNINGS_CLANG_CL+=-Wno-register - - _CXX_WARNINGS_CLANG_CL+=\ --Wimport-preprocessor-directive-pedantic \ --Wno-undefined-var-template - - when ($_TC_VERSION_AT_LEAST_2019 == "yes") { - _CXX_WARNINGS_CLANG_CL_2019=\ --Wno-deprecated-volatile \ --Wno-deprecated-anon-enum-enum-conversion \ --Wno-defaulted-function-deleted \ --Wno-deprecated-enum-enum-conversion \ --Wno-ambiguous-reversed-operator \ --Wno-deprecated-enum-float-conversion \ --Wno-pointer-to-int-cast - } - - when ($IDE_MSVS == "yes") { - _CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS=-Wno-unused-command-line-argument - } -} - -_C_WARNINGS =$_MSVC_WARNS_AS_ERRORS -_C_WARNINGS+=$_MSVC_WARNS_ENABLED -_C_WARNINGS+=$_MSVC_WARNS_DISABLED -_C_WARNINGS+=$_C_WARNINGS_CLANG_CL - -_CXX_WARNINGS = -_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL -_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019 -_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS - -_WINAPI_UNICODE=no - -_DEFINES_ARCH= -when ($ARCH_X86_64 == "yes") { - _DEFINES_ARCH=/D_WIN64 /DWIN64 -} -elsewhen ($ARCH_ARMV7 == "yes") { - _DEFINES_ARCH=/D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /D__arm__ -} - -_DEFINES_WIN32_WINNT=/D$_MSVC_MACRO=$_MSVC_WINDOWS7 - -when ($_WINAPI_UNICODE == "yes") { - _DEFINES_UNICODE=/DUNICODE /D_UNICODE -} -otherwise { - _DEFINES_UNICODE=/D_MBCS -} - -_C_DEFINES=\ -/DARCADIA_ROOT=${ARCADIA_ROOT} \ -/DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT} \ -/DFAKEID=$CPP_FAKEID \ -/DWIN32 \ -/D_WIN32 \ -/D_WINDOWS \ -/D_CRT_SECURE_NO_WARNINGS \ -/D_CRT_NONSTDC_NO_WARNINGS \ -/D_USE_MATH_DEFINES \ -/D__STDC_CONSTANT_MACROS \ -/D__STDC_FORMAT_MACROS \ -/D_USING_V110_SDK71_ \ -/D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES \ -/DNOMINMAX \ -/DWIN32_LEAN_AND_MEAN - -_C_DEFINES+=$_DEFINES_ARCH -_C_DEFINES+=$_DEFINES_WIN32_WINNT -_C_DEFINES+=$_DEFINES_UNICODE - -C_DEFINES+=$_C_DEFINES - -_MSVC_FLAGS_CLANG= -_MSVC_FLAGS_CLANG_NO_WARNINGS= -_MSVC_FLAGS_CLANG_ARCH= -_MSVC_FLAGS_CLANG_EQ_2019= -when ($CLANG_CL == "yes") { - # -fcase-insensitive-paths - # Allow <windows.h> to be included via <Windows.h> in case-sensitive file-systems. - # - # -fno-common - # Enable standard-conforming behavior and generate duplicate symbol error in case of duplicated global constants. - # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678#c0 - _MSVC_FLAGS_CLANG=-fcase-insensitive-paths -fno-common - when ($ARCH_X86_64 == "yes") { - _MSVC_FLAGS_CLANG_ARCH=-m64 - } - elsewhen ($ARCH_I386 == "yes") { - _MSVC_FLAGS_CLANG_ARCH=-m32 - } - otherwise { - _MSVC_FLAGS_CLANG_ARCH= - } - - # Some warnings are getting triggered even when NO_COMPILER_WARNINGS is enabled - _MSVC_FLAGS_CLANG_NO_WARNINGS=-Wno-c++11-narrowing -Wno-register - - when ($_TC_VERSION_EXACTLY_2019 == "yes") { - # heretic: на момент коммита в нашей конфигурации указано, что тулчейн clang11-windows - аналог msvc 2019 - # https://a.yandex-team.ru/arc/trunk/arcadia/build/ya.conf.json?rev=r7910792#L2185 - # сам clang11 по дефолту представляется msvc2017 (#define _MSC_VER 1911 - # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/clang11/lib/Driver/ToolChains/MSVC.cpp?rev=r7913127#L1352 - # вручную заставляем его представляться msvc2019 (#define _MSC_VER 1921) - # значение версии взято вот отсюда: - # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/llvm11/include/llvm/Support/Compiler.h?blame=true&rev=r7913127#L89 - _MSVC_FLAGS_CLANG_EQ_2019=-fms-compatibility-version=19.21 - } -} - -_MSVC_FLAGS=/nologo /Zm500 /GR /bigobj /FC /EHs /errorReport:prompt $MSVC_INLINE_FLAG /utf-8 -# enable standard conforming mode -_MSVC_FLAGS+=/permissive- -_MSVC_FLAGS+=$_MSVC_FLAGS_ARCH_OPT -_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG -_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_ARCH -_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_NO_WARNINGS -_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_EQ_2019 -_MSVC_FLAGS+=$_MSVC_FLAGS_INCLUDE - -MSVC_INLINE_OPTIMIZED=yes -when ($MSVC_INLINE_OPTIMIZED == "yes") { - MSVC_INLINE_FLAG=/Zc:inline -} -when ($MSVC_INLINE_OPTIMIZED == "no") { - MSVC_INLINE_FLAG=/Zc:inline- -} - -# Use builtin offsetof implementation -# instead of a crutcy macro defined in ucrt/stddef.h. -# The latter can not be used in constexpr statements. -_CXX_DEFINES=/D_CRT_USE_BUILTIN_OFFSETOF - -_FLAGS_C_ONLY= - -# Provide proper __cplusplus value -# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ -_CXX_FLAGS=/Zc:__cplusplus - -_FLAGS_MSVS_ONLY= -DEBUG_INFO_FLAGS=/Z7 -when ($IDE_MSVS == "yes") { - when ($CLANG_CL != "yes") { - _FLAGS_MSVS_ONLY=/FD /MP - } - DEBUG_INFO_FLAGS=/Zi /FS -} - -C_WARNING_OPTS=$_C_WARNINGS -CXX_WARNING_OPTS=$_CXX_WARNINGS - -# https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx -when ($DLL_RUNTIME == "yes") { - _FLAGS_DEBUG_RUNTIME=/MDd - _FLAGS_RELEASE_RUNTIME=/MD -} -otherwise { - _FLAGS_DEBUG_RUNTIME=/MTd - _FLAGS_RELEASE_RUNTIME=/MT -} -CFLAGS_DEBUG=/Ob0 /Od /D_DEBUG $_FLAGS_DEBUG_RUNTIME -CFLAGS_RELEASE=/Ox /Ob2 /Oi /DNDEBUG $_FLAGS_RELEASE_RUNTIME - -MASMFLAGS= -_MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC} -when ($ARCH_ARMV7) { - _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC} -} - -OBJ_CROSS_SUF=$OBJ_SUF -OBJECT_SUF=$OBJ_SUF.obj - -CFLAGS+=$_MSVC_FLAGS $_FLAGS_MSVS_ONLY $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL -CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL -CONLYFLAGS+=$_FLAGS_C_ONLY $USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL - -BC_CFLAGS+=$CFLAGS -BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS - -CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES - -when ($NO_WSHADOW == "yes") { - C_WARNING_OPTS+=/wd4456 /wd4457 -} -when ($NO_COMPILER_WARNINGS == "yes") { - C_WARNING_OPTS=/w - CXX_WARNING_OPTS= -} -when ($NO_OPTIMIZE == "yes") { - OPTIMIZE=/Od -} - -SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT -WERROR_FLAG=/WX - -CL_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} cl -ML_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} ml -when ($_UNDER_WINE == "yes") { - CL_WRAPPER= - ML_WRAPPER= -} - -_SRC_C_NODEPS_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo${OUTFILE} ${SRC} ${EXTRA_C_FLAGS} ${pre=/I :INC} ${CFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} -_SRC_CPP_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} -_SRC_C_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CFLAGS} ${CONLYFLAGS} ${SRCFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} -_SRC_M_CMD=$_EMPTY_CMD -_SRC_MASM_CMD=${cwd:ARCADIA_BUILD_ROOT} ${TOOLCHAIN_ENV} ${ML_WRAPPER} ${MASM_COMPILER} ${MASMFLAGS} ${SRCFLAGS} $_MASM_IO ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p AS"} ${kv;hide:"pc yellow"} +_MSVC_MACRO=_WIN32_WINNT +_MSVC_WINDOWS7=0x0601 +_MSVC_WINDOWS8=0x0602 + +_MSVC_WARNS_ENABLED= +# 'expression' : signed/unsigned mismatch +_MSVC_WARNS_ENABLED+=/w14018 +# 'class' : class has virtual functions, but destructor is not virtual +_MSVC_WARNS_ENABLED+=/w14265 +# 'operator' : expression is always false +_MSVC_WARNS_ENABLED+=/w14296 +# missing type specifier - int assumed +_MSVC_WARNS_ENABLED+=/w14431 + +_MSVC_WARNS_AS_ERRORS= +# 'function' undefined; assuming extern returning int +_MSVC_WARNS_AS_ERRORS+=/we4013 + +_MSVC_WARNS_DISABLED= +# conditional expression is constant +_MSVC_WARNS_DISABLED+=/wd4127 +# nonstandard extension used : zero-sized array in struct/union +_MSVC_WARNS_DISABLED+=/wd4200 +# nonstandard extension used : nameless struct/union +_MSVC_WARNS_DISABLED+=/wd4201 +# elements of array will be default initialized +_MSVC_WARNS_DISABLED+=/wd4351 +# 'this' : used in base member initializer list +_MSVC_WARNS_DISABLED+=/wd4355 +# decorated name length exceeded, name was truncated +_MSVC_WARNS_DISABLED+=/wd4503 +# default constructor could not be generated +_MSVC_WARNS_DISABLED+=/wd4510 +# copy constructor could not be generated +_MSVC_WARNS_DISABLED+=/wd4511 +# assignment operator could not be generated +_MSVC_WARNS_DISABLED+=/wd4512 +# check operator precedence for possible error; use parentheses to clarify precedence +_MSVC_WARNS_DISABLED+=/wd4554 +# 'object' can never be instantiated - user defined constructor required +_MSVC_WARNS_DISABLED+=/wd4610 +# assignment within conditional expression +_MSVC_WARNS_DISABLED+=/wd4706 +# forcing value to bool 'true' or 'false' (performance warning) +_MSVC_WARNS_DISABLED+=/wd4800 +# The POSIX name for this item is deprecated +_MSVC_WARNS_DISABLED+=/wd4996 +# function marked as __forceinline not inlined +_MSVC_WARNS_DISABLED+=/wd4714 +# 'TAtomic' : top-level volatile in cast is ignored +_MSVC_WARNS_DISABLED+=/wd4197 +# 'initializing' : conversion from 'int' to 'ui32', signed/unsigned mismatch +_MSVC_WARNS_DISABLED+=/wd4245 +# 'ystd::function<void (uint8_t *)>': structure was padded due to alignment specifier +_MSVC_WARNS_DISABLED+=/wd4324 +# 'register' is no longer a supported storage class +_MSVC_WARNS_DISABLED+=/wd5033 + +_C_WARNINGS_CLANG_CL= +_CXX_WARNINGS_CLANG_CL= +_CXX_WARNINGS_CLANG_CL_2019= +_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS= +when ($CLANG_CL == "yes") { + _C_WARNINGS_CLANG_CL=\ +-Wno-absolute-value \ +-Wno-bitwise-op-parentheses \ +-Wno-dll-attribute-on-redeclaration \ +-Wno-extern-initializer \ +-Wno-format \ +-Wno-ignored-pragma-optimize \ +-Wno-inconsistent-dllimport \ +-Wno-int-conversion \ +-Wno-int-to-void-pointer-cast \ +-Wno-invalid-noreturn \ +-Wno-logical-op-parentheses \ +-Wno-macro-redefined \ +-Wno-parentheses \ +-Wno-pragma-pack \ +-Wno-tautological-constant-out-of-range-compare \ +-Wno-unknown-argument \ +-Wno-unknown-warning-option + + _CXX_WARNINGS_CLANG_CL=\ +-Woverloaded-virtual \ +-Wno-attributes + # IGNIETFERRO-722 needed for contrib + _CXX_WARNINGS_CLANG_CL+=-Wno-register + + _CXX_WARNINGS_CLANG_CL+=\ +-Wimport-preprocessor-directive-pedantic \ +-Wno-undefined-var-template + + when ($_TC_VERSION_AT_LEAST_2019 == "yes") { + _CXX_WARNINGS_CLANG_CL_2019=\ +-Wno-deprecated-volatile \ +-Wno-deprecated-anon-enum-enum-conversion \ +-Wno-defaulted-function-deleted \ +-Wno-deprecated-enum-enum-conversion \ +-Wno-ambiguous-reversed-operator \ +-Wno-deprecated-enum-float-conversion \ +-Wno-pointer-to-int-cast + } + + when ($IDE_MSVS == "yes") { + _CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS=-Wno-unused-command-line-argument + } +} + +_C_WARNINGS =$_MSVC_WARNS_AS_ERRORS +_C_WARNINGS+=$_MSVC_WARNS_ENABLED +_C_WARNINGS+=$_MSVC_WARNS_DISABLED +_C_WARNINGS+=$_C_WARNINGS_CLANG_CL + +_CXX_WARNINGS = +_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL +_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019 +_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS + +_WINAPI_UNICODE=no + +_DEFINES_ARCH= +when ($ARCH_X86_64 == "yes") { + _DEFINES_ARCH=/D_WIN64 /DWIN64 +} +elsewhen ($ARCH_ARMV7 == "yes") { + _DEFINES_ARCH=/D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /D__arm__ +} + +_DEFINES_WIN32_WINNT=/D$_MSVC_MACRO=$_MSVC_WINDOWS7 + +when ($_WINAPI_UNICODE == "yes") { + _DEFINES_UNICODE=/DUNICODE /D_UNICODE +} +otherwise { + _DEFINES_UNICODE=/D_MBCS +} + +_C_DEFINES=\ +/DARCADIA_ROOT=${ARCADIA_ROOT} \ +/DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT} \ +/DFAKEID=$CPP_FAKEID \ +/DWIN32 \ +/D_WIN32 \ +/D_WINDOWS \ +/D_CRT_SECURE_NO_WARNINGS \ +/D_CRT_NONSTDC_NO_WARNINGS \ +/D_USE_MATH_DEFINES \ +/D__STDC_CONSTANT_MACROS \ +/D__STDC_FORMAT_MACROS \ +/D_USING_V110_SDK71_ \ +/D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES \ +/DNOMINMAX \ +/DWIN32_LEAN_AND_MEAN + +_C_DEFINES+=$_DEFINES_ARCH +_C_DEFINES+=$_DEFINES_WIN32_WINNT +_C_DEFINES+=$_DEFINES_UNICODE + +C_DEFINES+=$_C_DEFINES + +_MSVC_FLAGS_CLANG= +_MSVC_FLAGS_CLANG_NO_WARNINGS= +_MSVC_FLAGS_CLANG_ARCH= +_MSVC_FLAGS_CLANG_EQ_2019= +when ($CLANG_CL == "yes") { + # -fcase-insensitive-paths + # Allow <windows.h> to be included via <Windows.h> in case-sensitive file-systems. + # + # -fno-common + # Enable standard-conforming behavior and generate duplicate symbol error in case of duplicated global constants. + # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678#c0 + _MSVC_FLAGS_CLANG=-fcase-insensitive-paths -fno-common + when ($ARCH_X86_64 == "yes") { + _MSVC_FLAGS_CLANG_ARCH=-m64 + } + elsewhen ($ARCH_I386 == "yes") { + _MSVC_FLAGS_CLANG_ARCH=-m32 + } + otherwise { + _MSVC_FLAGS_CLANG_ARCH= + } + + # Some warnings are getting triggered even when NO_COMPILER_WARNINGS is enabled + _MSVC_FLAGS_CLANG_NO_WARNINGS=-Wno-c++11-narrowing -Wno-register + + when ($_TC_VERSION_EXACTLY_2019 == "yes") { + # heretic: на момент коммита в нашей конфигурации указано, что тулчейн clang11-windows - аналог msvc 2019 + # https://a.yandex-team.ru/arc/trunk/arcadia/build/ya.conf.json?rev=r7910792#L2185 + # сам clang11 по дефолту представляется msvc2017 (#define _MSC_VER 1911 + # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/clang11/lib/Driver/ToolChains/MSVC.cpp?rev=r7913127#L1352 + # вручную заставляем его представляться msvc2019 (#define _MSC_VER 1921) + # значение версии взято вот отсюда: + # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/llvm11/include/llvm/Support/Compiler.h?blame=true&rev=r7913127#L89 + _MSVC_FLAGS_CLANG_EQ_2019=-fms-compatibility-version=19.21 + } +} + +_MSVC_FLAGS=/nologo /Zm500 /GR /bigobj /FC /EHs /errorReport:prompt $MSVC_INLINE_FLAG /utf-8 +# enable standard conforming mode +_MSVC_FLAGS+=/permissive- +_MSVC_FLAGS+=$_MSVC_FLAGS_ARCH_OPT +_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG +_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_ARCH +_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_NO_WARNINGS +_MSVC_FLAGS+=$_MSVC_FLAGS_CLANG_EQ_2019 +_MSVC_FLAGS+=$_MSVC_FLAGS_INCLUDE + +MSVC_INLINE_OPTIMIZED=yes +when ($MSVC_INLINE_OPTIMIZED == "yes") { + MSVC_INLINE_FLAG=/Zc:inline +} +when ($MSVC_INLINE_OPTIMIZED == "no") { + MSVC_INLINE_FLAG=/Zc:inline- +} + +# Use builtin offsetof implementation +# instead of a crutcy macro defined in ucrt/stddef.h. +# The latter can not be used in constexpr statements. +_CXX_DEFINES=/D_CRT_USE_BUILTIN_OFFSETOF + +_FLAGS_C_ONLY= + +# Provide proper __cplusplus value +# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +_CXX_FLAGS=/Zc:__cplusplus + +_FLAGS_MSVS_ONLY= +DEBUG_INFO_FLAGS=/Z7 +when ($IDE_MSVS == "yes") { + when ($CLANG_CL != "yes") { + _FLAGS_MSVS_ONLY=/FD /MP + } + DEBUG_INFO_FLAGS=/Zi /FS +} + +C_WARNING_OPTS=$_C_WARNINGS +CXX_WARNING_OPTS=$_CXX_WARNINGS + +# https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx +when ($DLL_RUNTIME == "yes") { + _FLAGS_DEBUG_RUNTIME=/MDd + _FLAGS_RELEASE_RUNTIME=/MD +} +otherwise { + _FLAGS_DEBUG_RUNTIME=/MTd + _FLAGS_RELEASE_RUNTIME=/MT +} +CFLAGS_DEBUG=/Ob0 /Od /D_DEBUG $_FLAGS_DEBUG_RUNTIME +CFLAGS_RELEASE=/Ox /Ob2 /Oi /DNDEBUG $_FLAGS_RELEASE_RUNTIME + +MASMFLAGS= +_MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC} +when ($ARCH_ARMV7) { + _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC} +} + +OBJ_CROSS_SUF=$OBJ_SUF +OBJECT_SUF=$OBJ_SUF.obj + +CFLAGS+=$_MSVC_FLAGS $_FLAGS_MSVS_ONLY $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL +CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL +CONLYFLAGS+=$_FLAGS_C_ONLY $USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL + +BC_CFLAGS+=$CFLAGS +BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS + +CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES + +when ($NO_WSHADOW == "yes") { + C_WARNING_OPTS+=/wd4456 /wd4457 +} +when ($NO_COMPILER_WARNINGS == "yes") { + C_WARNING_OPTS=/w + CXX_WARNING_OPTS= +} +when ($NO_OPTIMIZE == "yes") { + OPTIMIZE=/Od +} + +SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT +WERROR_FLAG=/WX + +CL_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} cl +ML_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} ml +when ($_UNDER_WINE == "yes") { + CL_WRAPPER= + ML_WRAPPER= +} + +_SRC_C_NODEPS_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo${OUTFILE} ${SRC} ${EXTRA_C_FLAGS} ${pre=/I :INC} ${CFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} +_SRC_CPP_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} +_SRC_C_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CFLAGS} ${CONLYFLAGS} ${SRCFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"} +_SRC_M_CMD=$_EMPTY_CMD +_SRC_MASM_CMD=${cwd:ARCADIA_BUILD_ROOT} ${TOOLCHAIN_ENV} ${ML_WRAPPER} ${MASM_COMPILER} ${MASMFLAGS} ${SRCFLAGS} $_MASM_IO ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p AS"} ${kv;hide:"pc yellow"} diff --git a/build/conf/java.ymake.conf b/build/conf/java.ymake.conf index ed85153c78..78b9522daf 100644 --- a/build/conf/java.ymake.conf +++ b/build/conf/java.ymake.conf @@ -152,7 +152,7 @@ multimodule JAVA_CONTRIB_PROGRAM { } module _DLL_COMPATIBLE_JAVA_LIBRARY: EXTERNAL_JAVA_LIBRARY { - SET(DONT_RESOLVE_INCLUDES yes) + SET(DONT_RESOLVE_INCLUDES yes) } ### @usage: DLL_JAVA() diff --git a/build/conf/linkers/ld.conf b/build/conf/linkers/ld.conf index 655c09dc66..16a73122e4 100644 --- a/build/conf/linkers/ld.conf +++ b/build/conf/linkers/ld.conf @@ -1,383 +1,383 @@ -_LD_FLAGS_1= -_LD_FLAGS_2= -when ($MUSL == "yes") { - _LD_FLAGS_1=-Wl,--no-as-needed - when ($GCC == "yes") { - # MUSL_BFD: musl build uses --no-dynamic-linker linker flag - # which gold doesn't know about. And we can only specify linker - # type, not it's path as we do for Clang through linker selector. - _LD_FLAGS_2=-fuse-ld=bfd - } -} -elsewhen ($OS_LINUX == "yes") { - _LD_FLAGS_1=-ldl -lrt -Wl,--no-as-needed - when ($GCC == "yes") { - _LD_FLAGS_2=-Wl,-Bstatic -latomic -Wl,-Bdynamic - } -} -elsewhen ($OS_ANDROID == "yes") { - _LD_FLAGS_1=-ldl -Wl,--no-as-needed - when ($_DEFAULT_LINKER_ID == "lld" && $_ANDROID_API_LESS_THEN_29 == "yes") { - # https://github.com/android/ndk/issues/1196 - _LD_FLAGS_2=-Wl,--no-rosegment - } -} -elsewhen ($OS_DARWIN == "yes") { - _LD_FLAGS_1=-Wl,-no_deduplicate - when ($CLANG != "yes") { - _LD_FLAGS_2=-Wl,-no_compact_unwind - } -} - -_LD_FLAGS_IOS_MAPSMOBI_ARM= -when ($OS_IOS == "yes" && $MAPSMOBI_BUILD_TARGET == "yes" && $ARCH_ARM) { - _LD_FLAGS_IOS_MAPSMOBI_ARM=-fembed-bitcode -Wl,-bitcode_verify -} - -_LD_FLAGS_PROFILER_TYPE= -when ($_BUILD_PROFILER_TYPE == "gprof") { - _LD_FLAGS_PROFILER_TYPE=-pg -} - -_LD_FLAGS_COVERAGE= -when ($_BUILD_COVERAGE == "yes") { - _LD_FLAGS_COVERAGE=-fprofile-arcs -ftest-coverage -} - -_LD_FLAGS = -_LD_FLAGS+=$_LD_FLAGS_1 -_LD_FLAGS+=$_LD_FLAGS_2 -_LD_FLAGS+=$_LD_FLAGS_IOS_MAPSMOBI_ARM -_LD_FLAGS+=$_LD_FLAGS_PROFILER_TYPE -_LD_FLAGS+=$_LD_FLAGS_COVERAGE -_LD_FLAGS+=$LD_SDK_VERSION - -LDFLAGS+=$USER_LDFLAGS $_LD_FLAGS -LDFLAGS_GLOBAL+= - -_START_GROUP= -_END_GROUP= -START_WHOLE_ARCHIVE_VALUE= -END_WHOLE_ARCHIVE_VALUE= -LD_STRIP_FLAG= -_SONAME_OPTION= -_LD_SRCS_GLOBALS=--start-wa ${rootrel;ext=.a:SRCS_GLOBAL} --end-wa ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL} -when ($OS_LINUX == "yes" || $OS_ANDROID == "yes" || $OS_CYGWIN == "yes" || $OS_NONE == "yes") { - _START_GROUP=-Wl,--start-group - _END_GROUP=-Wl,--end-group - START_WHOLE_ARCHIVE_VALUE=-Wl,--whole-archive - END_WHOLE_ARCHIVE_VALUE=-Wl,--no-whole-archive - LD_STRIP_FLAG=-s - _SONAME_OPTION=-soname - _LD_SRCS_GLOBALS=-Wl,--whole-archive ${rootrel;ext=.a:SRCS_GLOBAL} -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL} -} - -when ($_LD_WHOLE_ARCHIVE == "yes") { -} - -when ($OS_DARWIN == "yes" || $OS_IOS == "yes") { - _SONAME_OPTION=-install_name -} - -_LD_LINKER_OUTPUT= -_LD_LINKER_OUTPUT_FLAG=--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX$MODULE_VERSION.linker.txt:REALPRJNAME} - -# Enable section-level DCE (dead code elimination): -# remove whole unused code and data sections -# (needs `-ffunction-sections` and `-fdata-sections` to be useful) -# -# NOTE: CGO linker doesn't seem to support DCE, but shares common LDFLAGS -_LD_DCE_FLAG_GC_SECTIONS= -_LD_DCE_FLAG_PRINT_SECTIONS= -when ($OS_DARWIN == "yes") { - _LD_DCE_FLAG_GC_SECTIONS=-Wl,-dead_strip -} -elsewhen ($OS_LINUX == "yes" || $OS_ANDROID == "yes") { - _LD_DCE_FLAG_GC_SECTIONS=-Wl,--gc-sections - when ($LINKER_DCE_PRINT_SECTIONS == "yes") { - _LD_DCE_FLAG_PRINT_SECTIONS=-Wl,--print-gc-sections - _LD_LINKER_OUTPUT=$_LD_LINKER_OUTPUT_FLAG - } -} -LD_DCE_FLAG = -LD_DCE_FLAG+=$_LD_DCE_FLAG_GC_SECTIONS -LD_DCE_FLAG+=$_LD_DCE_FLAG_PRINT_SECTIONS -DCE_FLAG= - -_LD_ICF_FLAG= -_LD_ICF_FLAG_PRINT_SECTIONS= -when ($_DEFAULT_LINKER_ID == "lld") { - # Enable ICF (identical code folding pass) in safe mode - # https://research.google/pubs/pub36912/ - _LD_ICF_FLAG=-Wl,-icf=safe - when ($LINKER_ICF_PRINT_SECTIONS == "yes") { - _LD_ICF_FLAG_PRINT_SECTIONS=-Wl,--print-icf-sections - _LD_LINKER_OUTPUT=$_LD_LINKER_OUTPUT_FLAG - } -} -LD_ICF_FLAG = -LD_ICF_FLAG+=$_LD_ICF_FLAG -LD_ICF_FLAG+=$_LD_ICF_FLAG_PRINT_SECTIONS -ICF_FLAG= - -STRIP_FLAG= - -C_LIBRARY_PATH= -C_SYSTEM_LIBRARIES_INTERCEPT= - -_LD_THREAD_LIBRARY= -when ($OS_LINUX == "yes" || $OS_DARWIN == "yes") { - _LD_THREAD_LIBRARY=-lpthread -} - -_LD_USE_STDLIB= -when ($_BUILD_COVERAGE == "yes" || $GCOV_COVERAGE == "yes" || $CLANG_COVERAGE == "yes" || $_BUILD_SANITIZED == "yes") { - _LD_USE_STDLIB= -} -elsewhen ($OS_ANDROID == "yes") { - when ($_ANDROID_NDK_VERSION_LESS_THEN_23 == "yes") { - # Preserve old behaviour: specify runtime libs manually - _LD_USE_STDLIB=-nodefaultlibs - } - otherwise { - # Use toolchain defaults to link with libunwind/clang_rt.builtins - _LD_USE_STDLIB=-nostdlib++ - } -} -elsewhen ($OS_LINUX == "yes" || $OS_DARWIN == "yes" || $OS_IOS == "yes") { - _LD_USE_STDLIB=-nodefaultlibs -} - -_C_SYSTEM_LIBRARIES=$_LD_USE_STDLIB $_LD_THREAD_LIBRARY $_LD_SYS_LIB -lc -when ($MUSL == "yes") { - _C_SYSTEM_LIBRARIES=-nostdlib -} -C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES - -OBJADDE= - -LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG= -when ($OS_LINUX == "yes" || $OS_ANDROID == "yes") { - LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG=-rdynamic -} - -NO_EXPORT_DYNAMIC_SYMBOLS= -EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG -when ($EXPORTS_FILE) { - EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG -Wl,--version-script=${input:EXPORTS_FILE} -} -when ($NO_EXPORT_DYNAMIC_SYMBOLS == "yes") { - EXPORTS_VALUE= -} - -LINKER_SCRIPT_VALUE=${ext=.ld;pre=-T:SRCS_GLOBAL} - -_LINKER_TIME_TRACE_GRANULARITY=500 -when ($TIME_TRACE_GRANULARITY && $TIME_TRACE_GRANULARITY != "") { - _LINKER_TIME_TRACE_GRANULARITY=$TIME_TRACE_GRANULARITY -} - -_LINKER_TIME_TRACE_FLAG= -when (($TIME_TRACE == "yes" || $LINKER_TIME_TRACE == "yes") && $_DEFAULT_LINKER_ID == "lld") { - _LINKER_TIME_TRACE_FLAG=\ --Wl,--time-trace \ --Wl,--time-trace-granularity=$_LINKER_TIME_TRACE_GRANULARITY \ --Wl,--time-trace-file=${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.time_trace.json:REALPRJNAME} -} - -_EXE_FLAGS=\ -$C_FLAGS_PLATFORM \ -$BEFORE_PEERS \ -$_START_GROUP \ -${rootrel:PEERS} \ -$_END_GROUP \ -$AFTER_PEERS \ -$EXPORTS_VALUE \ -$LINKER_SCRIPT_VALUE \ -$LDFLAGS \ -$LDFLAGS_GLOBAL \ -$OBJADDE \ -$OBJADDE_LIB \ -$C_LIBRARY_PATH \ -$C_SYSTEM_LIBRARIES_INTERCEPT \ -$C_SYSTEM_LIBRARIES \ -$STRIP_FLAG \ -$DCE_FLAG \ -$ICF_FLAG \ -$_LINKER_TIME_TRACE_FLAG - -_SONAME_FLAG=-Wl,$_SONAME_OPTION,$_SONAME -_SHARED_FLAG=-shared -_EXEC_SHARED_FLAG= -when ($OS_LINUX == "yes") { - _EXEC_SHARED_FLAG=-pie -fPIE -Wl,--unresolved-symbols=ignore-all -rdynamic -} - -_LD_ENV_STYLE=${cwd:ARCADIA_BUILD_ROOT} $TOOLCHAIN_ENV ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - -# Program -GENERATE_MF_CMD=\ -$YMAKE_PYTHON ${input:"build/scripts/generate_mf.py"} \ ---build-root $ARCADIA_BUILD_ROOT \ ---module-name $REALPRJNAME \ --o ${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.mf:REALPRJNAME} \ --t $MODULE_TYPE \ ---ya-start-command-file \ --Ya,lics $LICENSE_NAMES \ --Ya,peers ${rootrel:PEERS} \ --Ya,credits ${input:CREDITS_TEXTS_FILE} $CREDITS_FLAGS \ ---ya-end-command-file - -LINK_SCRIPT_EXE_FLAGS= - -REAL_LINK_EXE_CMDLINE =\ -$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"} \ ---source-root $ARCADIA_ROOT -REAL_LINK_EXE_CMDLINE+=$_LD_LINKER_OUTPUT -REAL_LINK_EXE_CMDLINE+=\ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -$_LD_ARCH_FLAG \ -$LINK_SCRIPT_EXE_FLAGS \ -$CXX_COMPILER \ -$_LD_SRCS_GLOBALS \ -$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ -$_EXE_FLAGS \ -$_LD_ENV_STYLE - -REAL_LINK_EXE_TIDY=\ -$YMAKE_PYTHON ${input:"build/scripts/clang_tidy_arch.py"} \ ---build-root $ARCADIA_BUILD_ROOT \ ---source-root $ARCADIA_ROOT \ ---output-file $TARGET \ -$AUTO_INPUT \ -$_LD_ENV_STYLE - -# Executable Shared Library - -REAL_LINK_EXEC_DYN_LIB_CMDLINE =\ -$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \ ---target $TARGET -REAL_LINK_EXEC_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT -REAL_LINK_EXEC_DYN_LIB_CMDLINE+=\ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -$_LD_ARCH_FLAG \ -$LINK_DYN_LIB_FLAGS \ -$CXX_COMPILER \ -$_LD_SRCS_GLOBALS \ -$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ -$_EXEC_SHARED_FLAG \ -$_SONAME_FLAG \ -$_EXE_FLAGS \ -$_LD_ENV_STYLE - -REAL_LINK_EXEC_DYN_LIB=$REAL_LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) - -# Shared Library - -LINK_DYN_LIB_FLAGS= - -REAL_LINK_DYN_LIB_CMDLINE =\ -$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \ ---target $TARGET -REAL_LINK_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT -REAL_LINK_DYN_LIB_CMDLINE+=\ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -$_LD_ARCH_FLAG \ -$LINK_DYN_LIB_FLAGS \ -$CXX_COMPILER \ -$_LD_SRCS_GLOBALS \ -$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ -$_SHARED_FLAG \ -$_SONAME_FLAG \ -$_EXE_FLAGS \ -$_LD_ENV_STYLE - -REAL_LINK_DYN_LIB=$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) - -_DWARF_COMMAND= -when ($OS_DARWIN == "yes" && $NO_DEBUGINFO != "yes") { - _DWARF_COMMAND=$DWARF_TOOL $TARGET -o ${output;pre=$MODULE_PREFIX$REALPRJNAME.dSYM/Contents/Resources/DWARF/$MODULE_PREFIX:REALPRJNAME} $_LD_ENV_STYLE -} -DWARF_COMMAND=$_DWARF_COMMAND - -_REAL_LINK_EXE=$REAL_LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) -_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_EXE && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND && $PACK_IOS_CMD -_LINK_DYN_LIB=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND -when ($TIDY == "yes") { - _REAL_LINK_EXE=$REAL_LINK_EXE_TIDY - _LINK_EXE=$REAL_LINK_EXE - _LINK_DYN_LIB=$REAL_LINK_EXE -} -REAL_LINK_EXE=$_REAL_LINK_EXE -LINK_EXE=$_LINK_EXE -LINK_DYN_LIB=$_LINK_DYN_LIB - -LINK_EXEC_DYN_LIB=\ -$GENERATE_MF && \ -$GENERATE_VCS_C_INFO_NODEP && \ -$REAL_LINK_EXEC_DYN_LIB && \ -$DWARF_COMMAND && \ -$LINK_ADDITIONAL_SECTIONS_COMMAND - -SWIG_DLL_JAR_CMD=\ -$GENERATE_MF && \ -$GENERATE_VCS_C_INFO_NODEP && \ -$REAL_SWIG_DLL_JAR_CMD && \ -$DWARF_COMMAND - -_LD_TAIL_LINK_LIB=$AUTO_INPUT ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p AR"} $TOOLCHAIN_ENV ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} -_LD_ARCHIVER=$YMAKE_PYTHON ${input:"build/scripts/link_lib.py"} ${quo:AR_TOOL} $AR_TYPE $_LD_LLVM_AR_FORMAT $ARCADIA_BUILD_ROOT $_LD_AR_PLUGIN -_LD_LIB_GENERATE_MF=$GENERATE_MF && -when ($TIDY == "yes") { - _LD_ARCHIVER=$YMAKE_PYTHON ${input:"build/scripts/clang_tidy_arch.py"} --source-root $ARCADIA_ROOT --build-root $ARCADIA_BUILD_ROOT --output-file - _LD_LIB_GENERATE_MF= -} -LINK_LIB=$_LD_LIB_GENERATE_MF $_LD_ARCHIVER $TARGET $_LD_TAIL_LINK_LIB -GLOBAL_LINK_LIB=$_LD_ARCHIVER $GLOBAL_TARGET $_LD_TAIL_LINK_LIB - -# "Fat Object" : pre-linked global objects and static library with all dependencies -_LD_LINK_FAT_PREFIX=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $YMAKE_PYTHON ${input:"build/scripts/link_fat_obj.py"} --build-root $ARCADIA_BUILD_ROOT -_LD_LINK_FAT_SRCS_GLOBALS_WA=$_LD_SRCS_GLOBALS -_LD_LINK_FAT_SRCS_GLOBALS_NO_WA=${rootrel;ext=.a:SRCS_GLOBAL} ${rootrel;ext=.o:SRCS_GLOBAL} - -_LD_LINK_FAT_SUFFIX1=$_LD_ARCH_FLAG \ --Ya,input $AUTO_INPUT $VCS_C_OBJ \ --Ya,global_srcs - -_LD_LINK_FAT_SUFFIX2=-Ya,peers $PEERS \ --Ya,linker $CXX_COMPILER \ -$LDFLAGS_GLOBAL $C_FLAGS_PLATFORM $LD_SDK_VERSION \ --Ya,archiver $_LD_ARCHIVER \ -$TOOLCHAIN_ENV ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - -LINK_FAT_OBJECT=\ -$_LD_LINK_FAT_PREFIX \ ---obj=$TARGET --lib=${output:REALPRJNAME.a} \ -$_LD_LINK_FAT_SUFFIX1 \ -$_LD_LINK_FAT_SRCS_GLOBALS_WA \ -$_LD_LINK_FAT_SUFFIX2 - -LINK_RECURSIVE_LIBRARY=\ -$_LD_LINK_FAT_PREFIX \ ---lib=$TARGET --with-own-obj --with-global-srcs \ -$_LD_LINK_FAT_SUFFIX1 \ -$_LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ -$_LD_LINK_FAT_SUFFIX2 - -LINK_FAT_OBJECT_LIBRARY=\ -$_LD_LINK_FAT_PREFIX \ ---lib=$TARGET $FAT_OBJECT_ARGS $FAT_OBJECT_OUTS \ -$_LD_LINK_FAT_SUFFIX1 \ -$_LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ -$_LD_LINK_FAT_SUFFIX2 - -LIBRT=-lrt -MD5LIB=-lcrypt -LIBRESOLV= -when ($OS_LINUX || $OS_DARWIN || $OS_ANDROID) { - LIBRESOLV=-lresolv -} -PROFFLAG=-pg +_LD_FLAGS_1= +_LD_FLAGS_2= +when ($MUSL == "yes") { + _LD_FLAGS_1=-Wl,--no-as-needed + when ($GCC == "yes") { + # MUSL_BFD: musl build uses --no-dynamic-linker linker flag + # which gold doesn't know about. And we can only specify linker + # type, not it's path as we do for Clang through linker selector. + _LD_FLAGS_2=-fuse-ld=bfd + } +} +elsewhen ($OS_LINUX == "yes") { + _LD_FLAGS_1=-ldl -lrt -Wl,--no-as-needed + when ($GCC == "yes") { + _LD_FLAGS_2=-Wl,-Bstatic -latomic -Wl,-Bdynamic + } +} +elsewhen ($OS_ANDROID == "yes") { + _LD_FLAGS_1=-ldl -Wl,--no-as-needed + when ($_DEFAULT_LINKER_ID == "lld" && $_ANDROID_API_LESS_THEN_29 == "yes") { + # https://github.com/android/ndk/issues/1196 + _LD_FLAGS_2=-Wl,--no-rosegment + } +} +elsewhen ($OS_DARWIN == "yes") { + _LD_FLAGS_1=-Wl,-no_deduplicate + when ($CLANG != "yes") { + _LD_FLAGS_2=-Wl,-no_compact_unwind + } +} + +_LD_FLAGS_IOS_MAPSMOBI_ARM= +when ($OS_IOS == "yes" && $MAPSMOBI_BUILD_TARGET == "yes" && $ARCH_ARM) { + _LD_FLAGS_IOS_MAPSMOBI_ARM=-fembed-bitcode -Wl,-bitcode_verify +} + +_LD_FLAGS_PROFILER_TYPE= +when ($_BUILD_PROFILER_TYPE == "gprof") { + _LD_FLAGS_PROFILER_TYPE=-pg +} + +_LD_FLAGS_COVERAGE= +when ($_BUILD_COVERAGE == "yes") { + _LD_FLAGS_COVERAGE=-fprofile-arcs -ftest-coverage +} + +_LD_FLAGS = +_LD_FLAGS+=$_LD_FLAGS_1 +_LD_FLAGS+=$_LD_FLAGS_2 +_LD_FLAGS+=$_LD_FLAGS_IOS_MAPSMOBI_ARM +_LD_FLAGS+=$_LD_FLAGS_PROFILER_TYPE +_LD_FLAGS+=$_LD_FLAGS_COVERAGE +_LD_FLAGS+=$LD_SDK_VERSION + +LDFLAGS+=$USER_LDFLAGS $_LD_FLAGS +LDFLAGS_GLOBAL+= + +_START_GROUP= +_END_GROUP= +START_WHOLE_ARCHIVE_VALUE= +END_WHOLE_ARCHIVE_VALUE= +LD_STRIP_FLAG= +_SONAME_OPTION= +_LD_SRCS_GLOBALS=--start-wa ${rootrel;ext=.a:SRCS_GLOBAL} --end-wa ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL} +when ($OS_LINUX == "yes" || $OS_ANDROID == "yes" || $OS_CYGWIN == "yes" || $OS_NONE == "yes") { + _START_GROUP=-Wl,--start-group + _END_GROUP=-Wl,--end-group + START_WHOLE_ARCHIVE_VALUE=-Wl,--whole-archive + END_WHOLE_ARCHIVE_VALUE=-Wl,--no-whole-archive + LD_STRIP_FLAG=-s + _SONAME_OPTION=-soname + _LD_SRCS_GLOBALS=-Wl,--whole-archive ${rootrel;ext=.a:SRCS_GLOBAL} -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} ${rootrel;ext=.supp:SRCS_GLOBAL} +} + +when ($_LD_WHOLE_ARCHIVE == "yes") { +} + +when ($OS_DARWIN == "yes" || $OS_IOS == "yes") { + _SONAME_OPTION=-install_name +} + +_LD_LINKER_OUTPUT= +_LD_LINKER_OUTPUT_FLAG=--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX$MODULE_VERSION.linker.txt:REALPRJNAME} + +# Enable section-level DCE (dead code elimination): +# remove whole unused code and data sections +# (needs `-ffunction-sections` and `-fdata-sections` to be useful) +# +# NOTE: CGO linker doesn't seem to support DCE, but shares common LDFLAGS +_LD_DCE_FLAG_GC_SECTIONS= +_LD_DCE_FLAG_PRINT_SECTIONS= +when ($OS_DARWIN == "yes") { + _LD_DCE_FLAG_GC_SECTIONS=-Wl,-dead_strip +} +elsewhen ($OS_LINUX == "yes" || $OS_ANDROID == "yes") { + _LD_DCE_FLAG_GC_SECTIONS=-Wl,--gc-sections + when ($LINKER_DCE_PRINT_SECTIONS == "yes") { + _LD_DCE_FLAG_PRINT_SECTIONS=-Wl,--print-gc-sections + _LD_LINKER_OUTPUT=$_LD_LINKER_OUTPUT_FLAG + } +} +LD_DCE_FLAG = +LD_DCE_FLAG+=$_LD_DCE_FLAG_GC_SECTIONS +LD_DCE_FLAG+=$_LD_DCE_FLAG_PRINT_SECTIONS +DCE_FLAG= + +_LD_ICF_FLAG= +_LD_ICF_FLAG_PRINT_SECTIONS= +when ($_DEFAULT_LINKER_ID == "lld") { + # Enable ICF (identical code folding pass) in safe mode + # https://research.google/pubs/pub36912/ + _LD_ICF_FLAG=-Wl,-icf=safe + when ($LINKER_ICF_PRINT_SECTIONS == "yes") { + _LD_ICF_FLAG_PRINT_SECTIONS=-Wl,--print-icf-sections + _LD_LINKER_OUTPUT=$_LD_LINKER_OUTPUT_FLAG + } +} +LD_ICF_FLAG = +LD_ICF_FLAG+=$_LD_ICF_FLAG +LD_ICF_FLAG+=$_LD_ICF_FLAG_PRINT_SECTIONS +ICF_FLAG= + +STRIP_FLAG= + +C_LIBRARY_PATH= +C_SYSTEM_LIBRARIES_INTERCEPT= + +_LD_THREAD_LIBRARY= +when ($OS_LINUX == "yes" || $OS_DARWIN == "yes") { + _LD_THREAD_LIBRARY=-lpthread +} + +_LD_USE_STDLIB= +when ($_BUILD_COVERAGE == "yes" || $GCOV_COVERAGE == "yes" || $CLANG_COVERAGE == "yes" || $_BUILD_SANITIZED == "yes") { + _LD_USE_STDLIB= +} +elsewhen ($OS_ANDROID == "yes") { + when ($_ANDROID_NDK_VERSION_LESS_THEN_23 == "yes") { + # Preserve old behaviour: specify runtime libs manually + _LD_USE_STDLIB=-nodefaultlibs + } + otherwise { + # Use toolchain defaults to link with libunwind/clang_rt.builtins + _LD_USE_STDLIB=-nostdlib++ + } +} +elsewhen ($OS_LINUX == "yes" || $OS_DARWIN == "yes" || $OS_IOS == "yes") { + _LD_USE_STDLIB=-nodefaultlibs +} + +_C_SYSTEM_LIBRARIES=$_LD_USE_STDLIB $_LD_THREAD_LIBRARY $_LD_SYS_LIB -lc +when ($MUSL == "yes") { + _C_SYSTEM_LIBRARIES=-nostdlib +} +C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES + +OBJADDE= + +LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG= +when ($OS_LINUX == "yes" || $OS_ANDROID == "yes") { + LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG=-rdynamic +} + +NO_EXPORT_DYNAMIC_SYMBOLS= +EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG +when ($EXPORTS_FILE) { + EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG -Wl,--version-script=${input:EXPORTS_FILE} +} +when ($NO_EXPORT_DYNAMIC_SYMBOLS == "yes") { + EXPORTS_VALUE= +} + +LINKER_SCRIPT_VALUE=${ext=.ld;pre=-T:SRCS_GLOBAL} + +_LINKER_TIME_TRACE_GRANULARITY=500 +when ($TIME_TRACE_GRANULARITY && $TIME_TRACE_GRANULARITY != "") { + _LINKER_TIME_TRACE_GRANULARITY=$TIME_TRACE_GRANULARITY +} + +_LINKER_TIME_TRACE_FLAG= +when (($TIME_TRACE == "yes" || $LINKER_TIME_TRACE == "yes") && $_DEFAULT_LINKER_ID == "lld") { + _LINKER_TIME_TRACE_FLAG=\ +-Wl,--time-trace \ +-Wl,--time-trace-granularity=$_LINKER_TIME_TRACE_GRANULARITY \ +-Wl,--time-trace-file=${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.time_trace.json:REALPRJNAME} +} + +_EXE_FLAGS=\ +$C_FLAGS_PLATFORM \ +$BEFORE_PEERS \ +$_START_GROUP \ +${rootrel:PEERS} \ +$_END_GROUP \ +$AFTER_PEERS \ +$EXPORTS_VALUE \ +$LINKER_SCRIPT_VALUE \ +$LDFLAGS \ +$LDFLAGS_GLOBAL \ +$OBJADDE \ +$OBJADDE_LIB \ +$C_LIBRARY_PATH \ +$C_SYSTEM_LIBRARIES_INTERCEPT \ +$C_SYSTEM_LIBRARIES \ +$STRIP_FLAG \ +$DCE_FLAG \ +$ICF_FLAG \ +$_LINKER_TIME_TRACE_FLAG + +_SONAME_FLAG=-Wl,$_SONAME_OPTION,$_SONAME +_SHARED_FLAG=-shared +_EXEC_SHARED_FLAG= +when ($OS_LINUX == "yes") { + _EXEC_SHARED_FLAG=-pie -fPIE -Wl,--unresolved-symbols=ignore-all -rdynamic +} + +_LD_ENV_STYLE=${cwd:ARCADIA_BUILD_ROOT} $TOOLCHAIN_ENV ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} + +# Program +GENERATE_MF_CMD=\ +$YMAKE_PYTHON ${input:"build/scripts/generate_mf.py"} \ +--build-root $ARCADIA_BUILD_ROOT \ +--module-name $REALPRJNAME \ +-o ${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.mf:REALPRJNAME} \ +-t $MODULE_TYPE \ +--ya-start-command-file \ +-Ya,lics $LICENSE_NAMES \ +-Ya,peers ${rootrel:PEERS} \ +-Ya,credits ${input:CREDITS_TEXTS_FILE} $CREDITS_FLAGS \ +--ya-end-command-file + +LINK_SCRIPT_EXE_FLAGS= + +REAL_LINK_EXE_CMDLINE =\ +$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"} \ +--source-root $ARCADIA_ROOT +REAL_LINK_EXE_CMDLINE+=$_LD_LINKER_OUTPUT +REAL_LINK_EXE_CMDLINE+=\ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +$_LD_ARCH_FLAG \ +$LINK_SCRIPT_EXE_FLAGS \ +$CXX_COMPILER \ +$_LD_SRCS_GLOBALS \ +$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ +$_EXE_FLAGS \ +$_LD_ENV_STYLE + +REAL_LINK_EXE_TIDY=\ +$YMAKE_PYTHON ${input:"build/scripts/clang_tidy_arch.py"} \ +--build-root $ARCADIA_BUILD_ROOT \ +--source-root $ARCADIA_ROOT \ +--output-file $TARGET \ +$AUTO_INPUT \ +$_LD_ENV_STYLE + +# Executable Shared Library + +REAL_LINK_EXEC_DYN_LIB_CMDLINE =\ +$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \ +--target $TARGET +REAL_LINK_EXEC_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT +REAL_LINK_EXEC_DYN_LIB_CMDLINE+=\ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +$_LD_ARCH_FLAG \ +$LINK_DYN_LIB_FLAGS \ +$CXX_COMPILER \ +$_LD_SRCS_GLOBALS \ +$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ +$_EXEC_SHARED_FLAG \ +$_SONAME_FLAG \ +$_EXE_FLAGS \ +$_LD_ENV_STYLE + +REAL_LINK_EXEC_DYN_LIB=$REAL_LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) + +# Shared Library + +LINK_DYN_LIB_FLAGS= + +REAL_LINK_DYN_LIB_CMDLINE =\ +$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \ +--target $TARGET +REAL_LINK_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT +REAL_LINK_DYN_LIB_CMDLINE+=\ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +$_LD_ARCH_FLAG \ +$LINK_DYN_LIB_FLAGS \ +$CXX_COMPILER \ +$_LD_SRCS_GLOBALS \ +$VCS_C_OBJ $AUTO_INPUT -o $TARGET \ +$_SHARED_FLAG \ +$_SONAME_FLAG \ +$_EXE_FLAGS \ +$_LD_ENV_STYLE + +REAL_LINK_DYN_LIB=$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) + +_DWARF_COMMAND= +when ($OS_DARWIN == "yes" && $NO_DEBUGINFO != "yes") { + _DWARF_COMMAND=$DWARF_TOOL $TARGET -o ${output;pre=$MODULE_PREFIX$REALPRJNAME.dSYM/Contents/Resources/DWARF/$MODULE_PREFIX:REALPRJNAME} $_LD_ENV_STYLE +} +DWARF_COMMAND=$_DWARF_COMMAND + +_REAL_LINK_EXE=$REAL_LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) +_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_EXE && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND && $PACK_IOS_CMD +_LINK_DYN_LIB=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND +when ($TIDY == "yes") { + _REAL_LINK_EXE=$REAL_LINK_EXE_TIDY + _LINK_EXE=$REAL_LINK_EXE + _LINK_DYN_LIB=$REAL_LINK_EXE +} +REAL_LINK_EXE=$_REAL_LINK_EXE +LINK_EXE=$_LINK_EXE +LINK_DYN_LIB=$_LINK_DYN_LIB + +LINK_EXEC_DYN_LIB=\ +$GENERATE_MF && \ +$GENERATE_VCS_C_INFO_NODEP && \ +$REAL_LINK_EXEC_DYN_LIB && \ +$DWARF_COMMAND && \ +$LINK_ADDITIONAL_SECTIONS_COMMAND + +SWIG_DLL_JAR_CMD=\ +$GENERATE_MF && \ +$GENERATE_VCS_C_INFO_NODEP && \ +$REAL_SWIG_DLL_JAR_CMD && \ +$DWARF_COMMAND + +_LD_TAIL_LINK_LIB=$AUTO_INPUT ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p AR"} $TOOLCHAIN_ENV ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} +_LD_ARCHIVER=$YMAKE_PYTHON ${input:"build/scripts/link_lib.py"} ${quo:AR_TOOL} $AR_TYPE $_LD_LLVM_AR_FORMAT $ARCADIA_BUILD_ROOT $_LD_AR_PLUGIN +_LD_LIB_GENERATE_MF=$GENERATE_MF && +when ($TIDY == "yes") { + _LD_ARCHIVER=$YMAKE_PYTHON ${input:"build/scripts/clang_tidy_arch.py"} --source-root $ARCADIA_ROOT --build-root $ARCADIA_BUILD_ROOT --output-file + _LD_LIB_GENERATE_MF= +} +LINK_LIB=$_LD_LIB_GENERATE_MF $_LD_ARCHIVER $TARGET $_LD_TAIL_LINK_LIB +GLOBAL_LINK_LIB=$_LD_ARCHIVER $GLOBAL_TARGET $_LD_TAIL_LINK_LIB + +# "Fat Object" : pre-linked global objects and static library with all dependencies +_LD_LINK_FAT_PREFIX=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $YMAKE_PYTHON ${input:"build/scripts/link_fat_obj.py"} --build-root $ARCADIA_BUILD_ROOT +_LD_LINK_FAT_SRCS_GLOBALS_WA=$_LD_SRCS_GLOBALS +_LD_LINK_FAT_SRCS_GLOBALS_NO_WA=${rootrel;ext=.a:SRCS_GLOBAL} ${rootrel;ext=.o:SRCS_GLOBAL} + +_LD_LINK_FAT_SUFFIX1=$_LD_ARCH_FLAG \ +-Ya,input $AUTO_INPUT $VCS_C_OBJ \ +-Ya,global_srcs + +_LD_LINK_FAT_SUFFIX2=-Ya,peers $PEERS \ +-Ya,linker $CXX_COMPILER \ +$LDFLAGS_GLOBAL $C_FLAGS_PLATFORM $LD_SDK_VERSION \ +-Ya,archiver $_LD_ARCHIVER \ +$TOOLCHAIN_ENV ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} + +LINK_FAT_OBJECT=\ +$_LD_LINK_FAT_PREFIX \ +--obj=$TARGET --lib=${output:REALPRJNAME.a} \ +$_LD_LINK_FAT_SUFFIX1 \ +$_LD_LINK_FAT_SRCS_GLOBALS_WA \ +$_LD_LINK_FAT_SUFFIX2 + +LINK_RECURSIVE_LIBRARY=\ +$_LD_LINK_FAT_PREFIX \ +--lib=$TARGET --with-own-obj --with-global-srcs \ +$_LD_LINK_FAT_SUFFIX1 \ +$_LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ +$_LD_LINK_FAT_SUFFIX2 + +LINK_FAT_OBJECT_LIBRARY=\ +$_LD_LINK_FAT_PREFIX \ +--lib=$TARGET $FAT_OBJECT_ARGS $FAT_OBJECT_OUTS \ +$_LD_LINK_FAT_SUFFIX1 \ +$_LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ +$_LD_LINK_FAT_SUFFIX2 + +LIBRT=-lrt +MD5LIB=-lcrypt +LIBRESOLV= +when ($OS_LINUX || $OS_DARWIN || $OS_ANDROID) { + LIBRESOLV=-lresolv +} +PROFFLAG=-pg diff --git a/build/conf/linkers/msvc_linker.conf b/build/conf/linkers/msvc_linker.conf index e905024bda..c956fbab97 100644 --- a/build/conf/linkers/msvc_linker.conf +++ b/build/conf/linkers/msvc_linker.conf @@ -1,271 +1,271 @@ -_MSVC_ARCH= -when ($ARCH_I386 == "yes" || $ARCH_I686 == "yes") { - _MSVC_ARCH=x86 -} -elsewhen ($ARCH_X86_64 == "yes") { - _MSVC_ARCH=x64 -} -elsewhen ($ARCH_ARM == "yes") { - _MSVC_ARCH=arm -} - -_FLAGS_MACHINE=/MACHINE:${toupper:_MSVC_ARCH} - -_FLAGS_IGNORE=/IGNORE:4221 - -_FLAGS_COMMON_IDE_MSVS= -when ($IDE_MSVS == "yes") { - _FLAGS_COMMON_IDE_MSVS=/INCREMENTAL -} -otherwise { - _FLAGS_COMMON_IDE_MSVS=/INCREMENTAL:NO -} - -# TODO(nslus): DEVTOOLS-1868 remove restriction. -_FLAGS_DEBUG_ONLY_DEBUG= -_FLAGS_RELEASE_ONLY_DEBUG= -_FLAGS_COMMON_DEBUG= -when (!$NO_DEBUGINFO || $NO_DEBUGINFO == "no" || $NO_DEBUGINFO == "0") { - when ($IDE_MSVS == "yes") { - when ($CLANG_CL == "yes") { - _FLAGS_DEBUG_ONLY_DEBUG=/DEBUG - } - otherwise { - _FLAGS_DEBUG_ONLY_DEBUG=/DEBUG:FASTLINK - } - _FLAGS_RELEASE_ONLY_DEBUG=/DEBUG - } - otherwise { - _FLAGS_COMMON_DEBUG=/DEBUG - } -} - -_FLAGS_COMMON_LIBPATHS= -when ($IDE_MSVS != "yes") { - _FLAGS_COMMON_LIBPATHS=\ -/LIBPATH:"$_MSVC_TC_KIT_LIBS/um/$_MSVC_ARCH" \ -/LIBPATH:"$_MSVC_TC_KIT_LIBS/ucrt/$_MSVC_ARCH" \ -/LIBPATH:"$_MSVC_TC_VC_ROOT/lib/$_MSVC_ARCH" -} - -_FLAGS_COMMON =/NOLOGO /ERRORREPORT:PROMPT /SUBSYSTEM:CONSOLE /TLBID:1 $MSVC_DYNAMICBASE /NXCOMPAT -_FLAGS_COMMON+=$_FLAGS_IGNORE -_FLAGS_COMMON+=$_FLAGS_MACHINE -_FLAGS_COMMON+=$_FLAGS_COMMON_IDE_MSVS -_FLAGS_COMMON+=$_FLAGS_COMMON_DEBUG -_FLAGS_COMMON+=$_FLAGS_COMMON_LIBPATHS - -_FLAGS_DEBUG_ONLY_CLANG_CL= -when ($CLANG_CL == "yes") { - _FLAGS_DEBUG_ONLY_CLANG_CL=/STACK:4194304 -} - -_FLAGS_DEBUG_ONLY =$_FLAGS_DEBUG_ONLY_CLANG_CL -_FLAGS_DEBUG_ONLY+=$_FLAGS_DEBUG_ONLY_DEBUG -_FLAGS_RELEASE_ONLY =$_FLAGS_RELEASE_ONLY_DEBUG - -LINK_EXE_FLAGS_DEBUG =$_FLAGS_COMMON -LINK_EXE_FLAGS_DEBUG+=$_FLAGS_DEBUG_ONLY - -LINK_EXE_FLAGS_RELEASE =$_FLAGS_COMMON -LINK_EXE_FLAGS_RELEASE+=$_FLAGS_RELEASE_ONLY - -LINK_LIB_FLAGS=$_FLAGS_IGNORE $_FLAGS_MACHINE - -LINK_STDLIBS=\ -advapi32.lib \ -comdlg32.lib \ -crypt32.lib \ -dnsapi.lib \ -gdi32.lib \ -iphlpapi.lib \ -kernel32.lib \ -mswsock.lib \ -ole32.lib \ -oleaut32.lib \ -psapi.lib \ -rpcrt4.lib \ -secur32.lib \ -shell32.lib \ -shlwapi.lib \ -user32.lib \ -userenv.lib \ -uuid.lib \ -version.lib \ -winmm.lib \ -winspool.lib \ -ws2_32.lib - -LDFLAGS_GLOBAL= -LDFLAGS= -OBJADDE= - -LINK_EXE_FLAGS=$LINK_EXE_FLAGS_PER_TYPE - -LINK_IMPLIB=/IMPLIB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.lib} -_LINK_EXTRA_OUTPUT= -when (!$NO_DEBUGINFO || $NO_DEBUGINFO == "no" || $NO_DEBUGINFO == "0") { - _LINK_EXTRA_OUTPUT=/PDB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.pdb} -} -LINK_EXTRA_OUTPUT=$_LINK_EXTRA_OUTPUT - -LIB_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} lib -LINK_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} link -when ($_UNDER_WINE == "yes") { - LIB_WRAPPER= - LINK_WRAPPER= -} - -LINK_WRAPPER_DYNLIB=${YMAKE_PYTHON} ${input:"build/scripts/link_dyn_lib.py"} --arch WINDOWS --target $TARGET - -EXPORTS_VALUE= -LINK_IMPLIB_VALUE= -when ($EXPORTS_FILE) { - LINK_IMPLIB_VALUE=$LINK_IMPLIB - EXPORTS_VALUE=/DEF:${input:EXPORTS_FILE} -} - -GENERATE_MF_CMD=\ -$YMAKE_PYTHON ${input:"build/scripts/generate_mf.py"} \ ---build-root $ARCADIA_BUILD_ROOT \ ---module-name $REALPRJNAME \ --o ${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.mf:REALPRJNAME} \ --t $MODULE_TYPE \ ---ya-start-command-file \ --Ya,lics $LICENSE_NAMES \ --Ya,peers ${rootrel:PEERS} \ --Ya,credits ${input:CREDITS_TEXTS_FILE} $CREDITS_FLAGS \ ---ya-end-command-file - -# we split srcs_global into two groups: libs and objs -# # each group can be in its own command file -# first group need /WHOLEARCHIVE: prefix which will be added in fix_msvc_output.py or run_msvc_wine.py -# the tail of link commands will be added in the third command file -_MSVC_SRCS_GLOBALS=\ ---start-wa --ya-start-command-file ${qe;rootrel;ext=.lib:SRCS_GLOBAL} --ya-end-command-file --end-wa \ ---ya-start-command-file ${qe;rootrel;ext=.obj:SRCS_GLOBAL} --ya-end-command-file - -REAL_LINK_DYN_LIB_CMDLINE=\ -${TOOLCHAIN_ENV} \ -${cwd:ARCADIA_BUILD_ROOT} \ -${LINK_WRAPPER} \ -${LINK_WRAPPER_DYNLIB} \ -${LINK_EXE_CMD} \ -${LINK_IMPLIB_VALUE} \ -/DLL \ -/OUT:${qe;rootrel:TARGET} \ -${LINK_EXTRA_OUTPUT} \ -${EXPORTS_VALUE} \ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -$_MSVC_SRCS_GLOBALS \ ---ya-start-command-file \ -${VCS_C_OBJ_RR} \ -${qe;rootrel:AUTO_INPUT} \ -${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ -$LINK_EXE_FLAGS \ -$LINK_STDLIBS $LDFLAGS \ -$LDFLAGS_GLOBAL \ -$OBJADDE \ ---ya-end-command-file - -REAL_LINK_DYN_LIB=$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) - -SWIG_DLL_JAR_CMD=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_SWIG_DLL_JAR_CMD - -_MSVC_HEAD_LINK_LIB=${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LIB_WRAPPER} ${LINK_LIB_CMD} -_MSVC_TAIL_LINK_LIB=\ ---ya-start-command-file \ -${qe;rootrel:AUTO_INPUT} \ -$LINK_LIB_FLAGS \ ---ya-end-command-file \ -${requirements;hide:LIB_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p AR"} ${hide;kv:"pc light-red"} - -LINK_LIB=${GENERATE_MF} && $_MSVC_HEAD_LINK_LIB /OUT:${qe;rootrel:TARGET} $_MSVC_TAIL_LINK_LIB -GLOBAL_LINK_LIB=$_MSVC_HEAD_LINK_LIB /OUT:${qe;rootrel:GLOBAL_TARGET} $_MSVC_TAIL_LINK_LIB - -LINK_EXE_CMDLINE=\ -${GENERATE_MF} && \ -$GENERATE_VCS_C_INFO_NODEP && \ -${TOOLCHAIN_ENV} \ -${cwd:ARCADIA_BUILD_ROOT} \ -${LINK_WRAPPER} \ -${LINK_EXE_CMD} \ -/OUT:${qe;rootrel:TARGET} \ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -${LINK_EXTRA_OUTPUT} \ -$_MSVC_SRCS_GLOBALS \ ---ya-start-command-file \ -${VCS_C_OBJ_RR} \ -${qe;rootrel:AUTO_INPUT} \ -$LINK_EXE_FLAGS \ -$LINK_STDLIBS \ -$LDFLAGS \ -$LDFLAGS_GLOBAL \ -$OBJADDE \ -${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ ---ya-end-command-file \ -${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} - -LINK_EXE=$LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) - -LINK_DYN_LIB=${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB ${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} - -LINK_EXEC_DYN_LIB_CMDLINE=\ -${GENERATE_MF} && \ -$GENERATE_VCS_C_INFO_NODEP && \ -${TOOLCHAIN_ENV} \ -${cwd:ARCADIA_BUILD_ROOT} \ -${LINK_WRAPPER} \ -${LINK_WRAPPER_DYNLIB} \ -${LINK_EXE_CMD} \ -/OUT:${qe;rootrel:TARGET} \ -${LINK_EXTRA_OUTPUT} \ -${EXPORTS_VALUE} \ -${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ -${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ -$_MSVC_SRCS_GLOBALS \ -'--ya-start-command-file \ -${VCS_C_OBJ_RR} \ -${qe;rootrel:AUTO_INPUT} \ -${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ -$LINK_EXE_FLAGS \ -$LINK_STDLIBS \ -$LDFLAGS $LDFLAGS_GLOBAL \ -$OBJADDE \ ---ya-end-command-file \ -${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} - -LINK_EXEC_DYN_LIB=$LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) - -LINK_GLOBAL_FAT_OBJECT=\ -${TOOLCHAIN_ENV} \ -${cwd:ARCADIA_BUILD_ROOT} \ -${LIB_WRAPPER} \ -${LINK_LIB_CMD} \ -/OUT:${qe;rootrel:TARGET} \ ---ya-start-command-file \ -${qe;rootrel;ext=.lib:SRCS_GLOBAL} \ -${qe;rootrel;ext=.obj:SRCS_GLOBAL} \ -${qe;rootrel:AUTO_INPUT} \ -$LINK_LIB_FLAGS \ ---ya-end-command-file - -LINK_PEERS_FAT_OBJECT=\ -${TOOLCHAIN_ENV} \ -${cwd:ARCADIA_BUILD_ROOT} \ -${LIB_WRAPPER} \ -${LINK_LIB_CMD} \ -/OUT:${qe;rootrel;output:REALPRJNAME.lib} \ ---ya-start-command-file \ -${qe;rootrel:PEERS} \ -$LINK_LIB_FLAGS \ ---ya-end-command-file - -LINK_FAT_OBJECT=\ -${GENERATE_MF} && \ -$GENERATE_VCS_C_INFO_NODEP && \ -$LINK_GLOBAL_FAT_OBJECT && \ -$LINK_PEERS_FAT_OBJECT \ -${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} +_MSVC_ARCH= +when ($ARCH_I386 == "yes" || $ARCH_I686 == "yes") { + _MSVC_ARCH=x86 +} +elsewhen ($ARCH_X86_64 == "yes") { + _MSVC_ARCH=x64 +} +elsewhen ($ARCH_ARM == "yes") { + _MSVC_ARCH=arm +} + +_FLAGS_MACHINE=/MACHINE:${toupper:_MSVC_ARCH} + +_FLAGS_IGNORE=/IGNORE:4221 + +_FLAGS_COMMON_IDE_MSVS= +when ($IDE_MSVS == "yes") { + _FLAGS_COMMON_IDE_MSVS=/INCREMENTAL +} +otherwise { + _FLAGS_COMMON_IDE_MSVS=/INCREMENTAL:NO +} + +# TODO(nslus): DEVTOOLS-1868 remove restriction. +_FLAGS_DEBUG_ONLY_DEBUG= +_FLAGS_RELEASE_ONLY_DEBUG= +_FLAGS_COMMON_DEBUG= +when (!$NO_DEBUGINFO || $NO_DEBUGINFO == "no" || $NO_DEBUGINFO == "0") { + when ($IDE_MSVS == "yes") { + when ($CLANG_CL == "yes") { + _FLAGS_DEBUG_ONLY_DEBUG=/DEBUG + } + otherwise { + _FLAGS_DEBUG_ONLY_DEBUG=/DEBUG:FASTLINK + } + _FLAGS_RELEASE_ONLY_DEBUG=/DEBUG + } + otherwise { + _FLAGS_COMMON_DEBUG=/DEBUG + } +} + +_FLAGS_COMMON_LIBPATHS= +when ($IDE_MSVS != "yes") { + _FLAGS_COMMON_LIBPATHS=\ +/LIBPATH:"$_MSVC_TC_KIT_LIBS/um/$_MSVC_ARCH" \ +/LIBPATH:"$_MSVC_TC_KIT_LIBS/ucrt/$_MSVC_ARCH" \ +/LIBPATH:"$_MSVC_TC_VC_ROOT/lib/$_MSVC_ARCH" +} + +_FLAGS_COMMON =/NOLOGO /ERRORREPORT:PROMPT /SUBSYSTEM:CONSOLE /TLBID:1 $MSVC_DYNAMICBASE /NXCOMPAT +_FLAGS_COMMON+=$_FLAGS_IGNORE +_FLAGS_COMMON+=$_FLAGS_MACHINE +_FLAGS_COMMON+=$_FLAGS_COMMON_IDE_MSVS +_FLAGS_COMMON+=$_FLAGS_COMMON_DEBUG +_FLAGS_COMMON+=$_FLAGS_COMMON_LIBPATHS + +_FLAGS_DEBUG_ONLY_CLANG_CL= +when ($CLANG_CL == "yes") { + _FLAGS_DEBUG_ONLY_CLANG_CL=/STACK:4194304 +} + +_FLAGS_DEBUG_ONLY =$_FLAGS_DEBUG_ONLY_CLANG_CL +_FLAGS_DEBUG_ONLY+=$_FLAGS_DEBUG_ONLY_DEBUG +_FLAGS_RELEASE_ONLY =$_FLAGS_RELEASE_ONLY_DEBUG + +LINK_EXE_FLAGS_DEBUG =$_FLAGS_COMMON +LINK_EXE_FLAGS_DEBUG+=$_FLAGS_DEBUG_ONLY + +LINK_EXE_FLAGS_RELEASE =$_FLAGS_COMMON +LINK_EXE_FLAGS_RELEASE+=$_FLAGS_RELEASE_ONLY + +LINK_LIB_FLAGS=$_FLAGS_IGNORE $_FLAGS_MACHINE + +LINK_STDLIBS=\ +advapi32.lib \ +comdlg32.lib \ +crypt32.lib \ +dnsapi.lib \ +gdi32.lib \ +iphlpapi.lib \ +kernel32.lib \ +mswsock.lib \ +ole32.lib \ +oleaut32.lib \ +psapi.lib \ +rpcrt4.lib \ +secur32.lib \ +shell32.lib \ +shlwapi.lib \ +user32.lib \ +userenv.lib \ +uuid.lib \ +version.lib \ +winmm.lib \ +winspool.lib \ +ws2_32.lib + +LDFLAGS_GLOBAL= +LDFLAGS= +OBJADDE= + +LINK_EXE_FLAGS=$LINK_EXE_FLAGS_PER_TYPE + +LINK_IMPLIB=/IMPLIB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.lib} +_LINK_EXTRA_OUTPUT= +when (!$NO_DEBUGINFO || $NO_DEBUGINFO == "no" || $NO_DEBUGINFO == "0") { + _LINK_EXTRA_OUTPUT=/PDB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.pdb} +} +LINK_EXTRA_OUTPUT=$_LINK_EXTRA_OUTPUT + +LIB_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} lib +LINK_WRAPPER=${YMAKE_PYTHON} ${input:"build/scripts/fix_msvc_output.py"} link +when ($_UNDER_WINE == "yes") { + LIB_WRAPPER= + LINK_WRAPPER= +} + +LINK_WRAPPER_DYNLIB=${YMAKE_PYTHON} ${input:"build/scripts/link_dyn_lib.py"} --arch WINDOWS --target $TARGET + +EXPORTS_VALUE= +LINK_IMPLIB_VALUE= +when ($EXPORTS_FILE) { + LINK_IMPLIB_VALUE=$LINK_IMPLIB + EXPORTS_VALUE=/DEF:${input:EXPORTS_FILE} +} + +GENERATE_MF_CMD=\ +$YMAKE_PYTHON ${input:"build/scripts/generate_mf.py"} \ +--build-root $ARCADIA_BUILD_ROOT \ +--module-name $REALPRJNAME \ +-o ${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.mf:REALPRJNAME} \ +-t $MODULE_TYPE \ +--ya-start-command-file \ +-Ya,lics $LICENSE_NAMES \ +-Ya,peers ${rootrel:PEERS} \ +-Ya,credits ${input:CREDITS_TEXTS_FILE} $CREDITS_FLAGS \ +--ya-end-command-file + +# we split srcs_global into two groups: libs and objs +# # each group can be in its own command file +# first group need /WHOLEARCHIVE: prefix which will be added in fix_msvc_output.py or run_msvc_wine.py +# the tail of link commands will be added in the third command file +_MSVC_SRCS_GLOBALS=\ +--start-wa --ya-start-command-file ${qe;rootrel;ext=.lib:SRCS_GLOBAL} --ya-end-command-file --end-wa \ +--ya-start-command-file ${qe;rootrel;ext=.obj:SRCS_GLOBAL} --ya-end-command-file + +REAL_LINK_DYN_LIB_CMDLINE=\ +${TOOLCHAIN_ENV} \ +${cwd:ARCADIA_BUILD_ROOT} \ +${LINK_WRAPPER} \ +${LINK_WRAPPER_DYNLIB} \ +${LINK_EXE_CMD} \ +${LINK_IMPLIB_VALUE} \ +/DLL \ +/OUT:${qe;rootrel:TARGET} \ +${LINK_EXTRA_OUTPUT} \ +${EXPORTS_VALUE} \ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +$_MSVC_SRCS_GLOBALS \ +--ya-start-command-file \ +${VCS_C_OBJ_RR} \ +${qe;rootrel:AUTO_INPUT} \ +${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ +$LINK_EXE_FLAGS \ +$LINK_STDLIBS $LDFLAGS \ +$LDFLAGS_GLOBAL \ +$OBJADDE \ +--ya-end-command-file + +REAL_LINK_DYN_LIB=$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) + +SWIG_DLL_JAR_CMD=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_SWIG_DLL_JAR_CMD + +_MSVC_HEAD_LINK_LIB=${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LIB_WRAPPER} ${LINK_LIB_CMD} +_MSVC_TAIL_LINK_LIB=\ +--ya-start-command-file \ +${qe;rootrel:AUTO_INPUT} \ +$LINK_LIB_FLAGS \ +--ya-end-command-file \ +${requirements;hide:LIB_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p AR"} ${hide;kv:"pc light-red"} + +LINK_LIB=${GENERATE_MF} && $_MSVC_HEAD_LINK_LIB /OUT:${qe;rootrel:TARGET} $_MSVC_TAIL_LINK_LIB +GLOBAL_LINK_LIB=$_MSVC_HEAD_LINK_LIB /OUT:${qe;rootrel:GLOBAL_TARGET} $_MSVC_TAIL_LINK_LIB + +LINK_EXE_CMDLINE=\ +${GENERATE_MF} && \ +$GENERATE_VCS_C_INFO_NODEP && \ +${TOOLCHAIN_ENV} \ +${cwd:ARCADIA_BUILD_ROOT} \ +${LINK_WRAPPER} \ +${LINK_EXE_CMD} \ +/OUT:${qe;rootrel:TARGET} \ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +${LINK_EXTRA_OUTPUT} \ +$_MSVC_SRCS_GLOBALS \ +--ya-start-command-file \ +${VCS_C_OBJ_RR} \ +${qe;rootrel:AUTO_INPUT} \ +$LINK_EXE_FLAGS \ +$LINK_STDLIBS \ +$LDFLAGS \ +$LDFLAGS_GLOBAL \ +$OBJADDE \ +${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ +--ya-end-command-file \ +${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} + +LINK_EXE=$LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) + +LINK_DYN_LIB=${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB ${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} + +LINK_EXEC_DYN_LIB_CMDLINE=\ +${GENERATE_MF} && \ +$GENERATE_VCS_C_INFO_NODEP && \ +${TOOLCHAIN_ENV} \ +${cwd:ARCADIA_BUILD_ROOT} \ +${LINK_WRAPPER} \ +${LINK_WRAPPER_DYNLIB} \ +${LINK_EXE_CMD} \ +/OUT:${qe;rootrel:TARGET} \ +${LINK_EXTRA_OUTPUT} \ +${EXPORTS_VALUE} \ +${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ +${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} \ +$_MSVC_SRCS_GLOBALS \ +'--ya-start-command-file \ +${VCS_C_OBJ_RR} \ +${qe;rootrel:AUTO_INPUT} \ +${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ +$LINK_EXE_FLAGS \ +$LINK_STDLIBS \ +$LDFLAGS $LDFLAGS_GLOBAL \ +$OBJADDE \ +--ya-end-command-file \ +${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"} + +LINK_EXEC_DYN_LIB=$LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE) + +LINK_GLOBAL_FAT_OBJECT=\ +${TOOLCHAIN_ENV} \ +${cwd:ARCADIA_BUILD_ROOT} \ +${LIB_WRAPPER} \ +${LINK_LIB_CMD} \ +/OUT:${qe;rootrel:TARGET} \ +--ya-start-command-file \ +${qe;rootrel;ext=.lib:SRCS_GLOBAL} \ +${qe;rootrel;ext=.obj:SRCS_GLOBAL} \ +${qe;rootrel:AUTO_INPUT} \ +$LINK_LIB_FLAGS \ +--ya-end-command-file + +LINK_PEERS_FAT_OBJECT=\ +${TOOLCHAIN_ENV} \ +${cwd:ARCADIA_BUILD_ROOT} \ +${LIB_WRAPPER} \ +${LINK_LIB_CMD} \ +/OUT:${qe;rootrel;output:REALPRJNAME.lib} \ +--ya-start-command-file \ +${qe;rootrel:PEERS} \ +$LINK_LIB_FLAGS \ +--ya-end-command-file + +LINK_FAT_OBJECT=\ +${GENERATE_MF} && \ +$GENERATE_VCS_C_INFO_NODEP && \ +$LINK_GLOBAL_FAT_OBJECT && \ +$LINK_PEERS_FAT_OBJECT \ +${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} diff --git a/build/conf/project_specific/maps/mapkit.conf b/build/conf/project_specific/maps/mapkit.conf index d64b41f72a..be4b1002ac 100644 --- a/build/conf/project_specific/maps/mapkit.conf +++ b/build/conf/project_specific/maps/mapkit.conf @@ -17,7 +17,7 @@ macro MAPS_IDL_ADDINCL(Dirs...) { macro _MAPKITIDL_PROXY(Args...) { MAPKITIDL($Args) ENABLE(USE_YMAKE_RESOURCE) - SET_APPEND(_MAKEFILE_INCLUDE_LIKE_TEXT_DEPS ${ext=idl:Args}) + SET_APPEND(_MAKEFILE_INCLUDE_LIKE_TEXT_DEPS ${ext=idl:Args}) } MAPS_IDL_FILTER= diff --git a/build/conf/settings.conf b/build/conf/settings.conf index 4329f3233a..0e9c754b64 100644 --- a/build/conf/settings.conf +++ b/build/conf/settings.conf @@ -2,154 +2,154 @@ GLOBAL_SRCS_IN_RESULTS=yes JSON_CACHE_IS_ATTACHED=yes USE_ADDINCL_WITHOUT_FOR_AS_ADDINCL_FOR_C=yes LANGS_REQUIRE_BUILD_AND_SRC_ROOTS=c asm cython proto flatc swig ydl nlg - -# NOTE! Only foldable vars should be listed here -_FOLDABLE_VARS_=\ - CL_WRAPPER \ - END_WHOLE_ARCHIVE_VALUE \ - LD_SDK_VERSION \ - LD_STRIP_FLAG \ - LIB_WRAPPER \ - LINK_EXE_FLAGS_DEBUG \ - LINK_EXE_FLAGS_RELEASE \ - LINK_IMPLIB \ - LINK_LIB_FLAGS \ - LINK_STDLIBS \ - LINK_WRAPPER \ - LINK_WRAPPER_DYNLIB \ - ML_WRAPPER \ - START_WHOLE_ARCHIVE_VALUE \ - _CFLAGS_ARCH_I386 \ - _CFLAGS_UCRT_VC_INCLUDES \ - _COMPILER_TIME_TRACE_FLAGS \ - _COMPILER_TIME_TRACE_GRANULARITY \ - _COMPILER_TIME_TRACE_POSTPROCESS \ - _CPP_ARGS \ - _CROSS_SUFFIX \ - _CXX_DEFINES \ - _CXX_FLAGS \ - _CXX_STD \ - _CXX_WARNINGS \ - _CXX_WARNINGS_CLANG \ - _CXX_WARNINGS_CLANG_CL \ - _CXX_WARNINGS_CLANG_CL_2019 \ - _CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS \ - _CXX_WARNINGS_GCC_7 \ - _C_ARGS \ - _C_CPP_KV_STYLE \ - _C_DEFINES \ - _C_DEFINES_ANDROID \ - _C_DEFINES_ANDROID_OTHERWISE \ - _C_DEFINES_CLANG_LINUX_X86_64 \ - _C_DEFINES_GNU_SOURCE \ - _C_DEFINES_IOS \ - _C_DEFINES_NDEBUG \ - _C_DEFINES_WITH_VALGRIND \ - _C_FLAGS \ - _C_FLAGS_ARCH \ - _C_FLAGS_ARCH_OPT \ - _C_FLAGS_FAST_DEBUG \ - _C_FLAGS_PROFILER \ - _C_FLAGS_RELEASE \ - _C_FOPTIONS \ - _C_FOPTIONS_ALIGNED_ALLOCATION \ - _C_FOPTIONS_CLANG_10 \ - _C_FOPTIONS_CLANG_10_LINUX \ - _C_FOPTIONS_COLOR \ - _C_FOPTIONS_COVERAGE \ - _C_FOPTIONS_DEBUG \ - _C_FOPTIONS_GCC \ - _C_FOPTIONS_INIT_ARRAY \ - _C_FOPTIONS_IOS \ - _C_FOPTIONS_MAPSMOBI_ARM \ - _C_FOPTIONS_PROFILER \ - _C_FOPTIONS_RELEASE \ - _C_SYSTEM_LIBRARIES \ - _C_WARNINGS \ - _C_WARNINGS_CLANG \ - _C_WARNINGS_CLANG_CL \ - _DEBUG_INFO_FLAGS \ - _DEFINES_ARCH \ - _DEFINES_UNICODE \ - _DEFINES_WIN32_WINNT \ - _DWARF_COMMAND \ - _END_GROUP \ - _EXEC_SHARED_FLAG \ - _EXE_FLAGS \ - _FLAGS_COMMON \ - _FLAGS_COMMON_DEBUG \ - _FLAGS_COMMON_IDE_MSVS \ - _FLAGS_COMMON_LIBPATHS \ - _FLAGS_C_ONLY \ - _FLAGS_DEBUG_ONLY \ - _FLAGS_DEBUG_ONLY_CLANG_CL \ - _FLAGS_DEBUG_ONLY_DEBUG \ - _FLAGS_DEBUG_RUNTIME \ - _FLAGS_IGNORE \ - _FLAGS_MACHINE \ - _FLAGS_MSVS_ONLY \ - _FLAGS_RELEASE_ONLY \ - _FLAGS_RELEASE_ONLY_DEBUG \ - _FLAGS_RELEASE_RUNTIME \ - _LD_ARCHIVER \ - _LD_ARCH_FLAG \ - _LD_AR_PLUGIN \ - _LD_DCE_FLAG_GC_SECTIONS \ - _LD_DCE_FLAG_PRINT_SECTIONS \ - _LD_ENV_STYLE \ - _LD_FLAGS \ - _LD_FLAGS_1 \ - _LD_FLAGS_2 \ - _LD_FLAGS_COVERAGE \ - _LD_FLAGS_IOS_MAPSMOBI_ARM \ - _LD_FLAGS_PROFILER_TYPE \ - _LD_FLAGS_SIZE_OPTIMIZED \ - _LD_ICF_FLAG \ - _LD_ICF_FLAG_PRINT_SECTIONS \ - _LD_LIB_GENERATE_MF \ - _LD_LINKER_OUTPUT\ - _LD_LINKER_OUTPUT_FLAG \ - _LD_LINK_FAT_PREFIX \ - _LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ - _LD_LINK_FAT_SRCS_GLOBALS_WA \ - _LD_LINK_FAT_SUFFIX1 \ - _LD_LINK_FAT_SUFFIX2 \ - _LD_LLVM_AR_FORMAT \ - _LD_SRCS_GLOBALS \ - _LD_SYS_LIB \ - _LD_TAIL_LINK_LIB \ - _LD_THREAD_LIBRARY \ - _LD_USE_STDLIB \ - _LINKER_TIME_TRACE_FLAG \ - _LINKER_TIME_TRACE_GRANULARITY \ - _LINK_EXTRA_OUTPUT \ - _MASM_IO \ - _MSVC_ARCH \ - _MSVC_FLAGS \ - _MSVC_FLAGS_ARCH_OPT \ - _MSVC_FLAGS_CLANG \ - _MSVC_FLAGS_CLANG_ARCH \ - _MSVC_FLAGS_CLANG_EQ_2019 \ - _MSVC_FLAGS_CLANG_NO_WARNINGS \ - _MSVC_FLAGS_INCLUDE \ - _MSVC_HEAD_LINK_LIB \ - _MSVC_MACRO \ - _MSVC_SRCS_GLOBALS \ - _MSVC_TAIL_LINK_LIB \ - _MSVC_TC_KIT_LIBS \ - _MSVC_TC_VC_ROOT \ - _MSVC_WARNS_AS_ERRORS \ - _MSVC_WARNS_DISABLED \ - _MSVC_WARNS_ENABLED \ - _MSVC_WINDOWS7 \ - _MSVC_WINDOWS8 \ - _OPTIMIZE_RELEASE \ - _SFDL_FLAGS \ - _SHARED_FLAG \ - _SONAME_FLAG \ - _SONAME_OPTION \ - _START_GROUP \ - _STD_CXX \ - _WINAPI_UNICODE \ - -# end of _FOLDABLE_VARS list + +# NOTE! Only foldable vars should be listed here +_FOLDABLE_VARS_=\ + CL_WRAPPER \ + END_WHOLE_ARCHIVE_VALUE \ + LD_SDK_VERSION \ + LD_STRIP_FLAG \ + LIB_WRAPPER \ + LINK_EXE_FLAGS_DEBUG \ + LINK_EXE_FLAGS_RELEASE \ + LINK_IMPLIB \ + LINK_LIB_FLAGS \ + LINK_STDLIBS \ + LINK_WRAPPER \ + LINK_WRAPPER_DYNLIB \ + ML_WRAPPER \ + START_WHOLE_ARCHIVE_VALUE \ + _CFLAGS_ARCH_I386 \ + _CFLAGS_UCRT_VC_INCLUDES \ + _COMPILER_TIME_TRACE_FLAGS \ + _COMPILER_TIME_TRACE_GRANULARITY \ + _COMPILER_TIME_TRACE_POSTPROCESS \ + _CPP_ARGS \ + _CROSS_SUFFIX \ + _CXX_DEFINES \ + _CXX_FLAGS \ + _CXX_STD \ + _CXX_WARNINGS \ + _CXX_WARNINGS_CLANG \ + _CXX_WARNINGS_CLANG_CL \ + _CXX_WARNINGS_CLANG_CL_2019 \ + _CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS \ + _CXX_WARNINGS_GCC_7 \ + _C_ARGS \ + _C_CPP_KV_STYLE \ + _C_DEFINES \ + _C_DEFINES_ANDROID \ + _C_DEFINES_ANDROID_OTHERWISE \ + _C_DEFINES_CLANG_LINUX_X86_64 \ + _C_DEFINES_GNU_SOURCE \ + _C_DEFINES_IOS \ + _C_DEFINES_NDEBUG \ + _C_DEFINES_WITH_VALGRIND \ + _C_FLAGS \ + _C_FLAGS_ARCH \ + _C_FLAGS_ARCH_OPT \ + _C_FLAGS_FAST_DEBUG \ + _C_FLAGS_PROFILER \ + _C_FLAGS_RELEASE \ + _C_FOPTIONS \ + _C_FOPTIONS_ALIGNED_ALLOCATION \ + _C_FOPTIONS_CLANG_10 \ + _C_FOPTIONS_CLANG_10_LINUX \ + _C_FOPTIONS_COLOR \ + _C_FOPTIONS_COVERAGE \ + _C_FOPTIONS_DEBUG \ + _C_FOPTIONS_GCC \ + _C_FOPTIONS_INIT_ARRAY \ + _C_FOPTIONS_IOS \ + _C_FOPTIONS_MAPSMOBI_ARM \ + _C_FOPTIONS_PROFILER \ + _C_FOPTIONS_RELEASE \ + _C_SYSTEM_LIBRARIES \ + _C_WARNINGS \ + _C_WARNINGS_CLANG \ + _C_WARNINGS_CLANG_CL \ + _DEBUG_INFO_FLAGS \ + _DEFINES_ARCH \ + _DEFINES_UNICODE \ + _DEFINES_WIN32_WINNT \ + _DWARF_COMMAND \ + _END_GROUP \ + _EXEC_SHARED_FLAG \ + _EXE_FLAGS \ + _FLAGS_COMMON \ + _FLAGS_COMMON_DEBUG \ + _FLAGS_COMMON_IDE_MSVS \ + _FLAGS_COMMON_LIBPATHS \ + _FLAGS_C_ONLY \ + _FLAGS_DEBUG_ONLY \ + _FLAGS_DEBUG_ONLY_CLANG_CL \ + _FLAGS_DEBUG_ONLY_DEBUG \ + _FLAGS_DEBUG_RUNTIME \ + _FLAGS_IGNORE \ + _FLAGS_MACHINE \ + _FLAGS_MSVS_ONLY \ + _FLAGS_RELEASE_ONLY \ + _FLAGS_RELEASE_ONLY_DEBUG \ + _FLAGS_RELEASE_RUNTIME \ + _LD_ARCHIVER \ + _LD_ARCH_FLAG \ + _LD_AR_PLUGIN \ + _LD_DCE_FLAG_GC_SECTIONS \ + _LD_DCE_FLAG_PRINT_SECTIONS \ + _LD_ENV_STYLE \ + _LD_FLAGS \ + _LD_FLAGS_1 \ + _LD_FLAGS_2 \ + _LD_FLAGS_COVERAGE \ + _LD_FLAGS_IOS_MAPSMOBI_ARM \ + _LD_FLAGS_PROFILER_TYPE \ + _LD_FLAGS_SIZE_OPTIMIZED \ + _LD_ICF_FLAG \ + _LD_ICF_FLAG_PRINT_SECTIONS \ + _LD_LIB_GENERATE_MF \ + _LD_LINKER_OUTPUT\ + _LD_LINKER_OUTPUT_FLAG \ + _LD_LINK_FAT_PREFIX \ + _LD_LINK_FAT_SRCS_GLOBALS_NO_WA \ + _LD_LINK_FAT_SRCS_GLOBALS_WA \ + _LD_LINK_FAT_SUFFIX1 \ + _LD_LINK_FAT_SUFFIX2 \ + _LD_LLVM_AR_FORMAT \ + _LD_SRCS_GLOBALS \ + _LD_SYS_LIB \ + _LD_TAIL_LINK_LIB \ + _LD_THREAD_LIBRARY \ + _LD_USE_STDLIB \ + _LINKER_TIME_TRACE_FLAG \ + _LINKER_TIME_TRACE_GRANULARITY \ + _LINK_EXTRA_OUTPUT \ + _MASM_IO \ + _MSVC_ARCH \ + _MSVC_FLAGS \ + _MSVC_FLAGS_ARCH_OPT \ + _MSVC_FLAGS_CLANG \ + _MSVC_FLAGS_CLANG_ARCH \ + _MSVC_FLAGS_CLANG_EQ_2019 \ + _MSVC_FLAGS_CLANG_NO_WARNINGS \ + _MSVC_FLAGS_INCLUDE \ + _MSVC_HEAD_LINK_LIB \ + _MSVC_MACRO \ + _MSVC_SRCS_GLOBALS \ + _MSVC_TAIL_LINK_LIB \ + _MSVC_TC_KIT_LIBS \ + _MSVC_TC_VC_ROOT \ + _MSVC_WARNS_AS_ERRORS \ + _MSVC_WARNS_DISABLED \ + _MSVC_WARNS_ENABLED \ + _MSVC_WINDOWS7 \ + _MSVC_WINDOWS8 \ + _OPTIMIZE_RELEASE \ + _SFDL_FLAGS \ + _SHARED_FLAG \ + _SONAME_FLAG \ + _SONAME_OPTION \ + _START_GROUP \ + _STD_CXX \ + _WINAPI_UNICODE \ + +# end of _FOLDABLE_VARS list diff --git a/build/conf/toolchains/msvc_toolchain.conf b/build/conf/toolchains/msvc_toolchain.conf index 6b4d6b5c45..794c056776 100644 --- a/build/conf/toolchains/msvc_toolchain.conf +++ b/build/conf/toolchains/msvc_toolchain.conf @@ -1,7 +1,7 @@ -# TODO(somov): Заглушка для тех мест, где C_FLAGS_PLATFORM используется -# для любых платформ. Нужно унифицировать с GnuToolchain. -C_FLAGS_PLATFORM= - -when ($_UNDER_WINE == "yes") { - WINE_ENV=${env:"WINEPREFIX_SUFFIX=4.0"} -} +# TODO(somov): Заглушка для тех мест, где C_FLAGS_PLATFORM используется +# для любых платформ. Нужно унифицировать с GnuToolchain. +C_FLAGS_PLATFORM= + +when ($_UNDER_WINE == "yes") { + WINE_ENV=${env:"WINEPREFIX_SUFFIX=4.0"} +} diff --git a/build/external_resources/android_sdk/ya.make b/build/external_resources/android_sdk/ya.make index bc01c12523..537f871fd8 100644 --- a/build/external_resources/android_sdk/ya.make +++ b/build/external_resources/android_sdk/ya.make @@ -1,20 +1,20 @@ -RESOURCES_LIBRARY() - -OWNER(g:mapkit) - -IF (OS_ANDROID) +RESOURCES_LIBRARY() + +OWNER(g:mapkit) + +IF (OS_ANDROID) # Android SDK for linux and darwin: Build-Tools 30.0.3, Platform 30 - DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - ANDROID_SDK + DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + ANDROID_SDK sbr:2564045529 FOR LINUX sbr:2564523615 FOR DARWIN - ) - IF (NOT HOST_OS_LINUX AND NOT HOST_OS_DARWIN) - MESSAGE(FATAL_ERROR Unsupported platform for ANDROID_SDK) - ENDIF() + ) + IF (NOT HOST_OS_LINUX AND NOT HOST_OS_DARWIN) + MESSAGE(FATAL_ERROR Unsupported platform for ANDROID_SDK) + ENDIF() DECLARE_EXTERNAL_RESOURCE(ANDROID_AVD sbr:2563860055) -ELSE() - MESSAGE(FATAL_ERROR Unsupported platform) -ENDIF() - -END() +ELSE() + MESSAGE(FATAL_ERROR Unsupported platform) +ENDIF() + +END() diff --git a/build/external_resources/antlr3/ya.make b/build/external_resources/antlr3/ya.make index 59043418d7..8c3b0628e0 100644 --- a/build/external_resources/antlr3/ya.make +++ b/build/external_resources/antlr3/ya.make @@ -1,7 +1,7 @@ -RESOURCES_LIBRARY() - -OWNER(g:yatool) - -DECLARE_EXTERNAL_RESOURCE(ANTLR3 sbr:164589140) - -END() +RESOURCES_LIBRARY() + +OWNER(g:yatool) + +DECLARE_EXTERNAL_RESOURCE(ANTLR3 sbr:164589140) + +END() diff --git a/build/external_resources/antlr4/ya.make b/build/external_resources/antlr4/ya.make index 222d799d9c..b5766a092a 100644 --- a/build/external_resources/antlr4/ya.make +++ b/build/external_resources/antlr4/ya.make @@ -1,7 +1,7 @@ -RESOURCES_LIBRARY() - -OWNER(g:yatool) - +RESOURCES_LIBRARY() + +OWNER(g:yatool) + DECLARE_EXTERNAL_RESOURCE(ANTLR4 sbr:1861632725) - -END() + +END() diff --git a/build/external_resources/flake8_py2/ya.make b/build/external_resources/flake8_py2/ya.make index 412a014b9e..9521679d05 100644 --- a/build/external_resources/flake8_py2/ya.make +++ b/build/external_resources/flake8_py2/ya.make @@ -4,20 +4,20 @@ OWNER(g:yatool) IF (HOST_OS_DARWIN AND HOST_ARCH_ARM64 OR HOST_OS_DARWIN AND HOST_ARCH_X86_64 OR - HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR - HOST_OS_LINUX AND HOST_ARCH_X86_64 OR - HOST_OS_WINDOWS AND HOST_ARCH_X86_64) -ELSE() - MESSAGE(FATAL_ERROR Unsupported host platform for FLAKE8_PY2) + HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR + HOST_OS_LINUX AND HOST_ARCH_X86_64 OR + HOST_OS_WINDOWS AND HOST_ARCH_X86_64) +ELSE() + MESSAGE(FATAL_ERROR Unsupported host platform for FLAKE8_PY2) ENDIF() -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - FLAKE8_PY2 +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + FLAKE8_PY2 sbr:2488549842 FOR DARWIN-ARM64 sbr:2488553184 FOR DARWIN sbr:2488550572 FOR LINUX-PPC64LE sbr:2488555532 FOR LINUX sbr:2488554786 FOR WIN32 -) - +) + END() diff --git a/build/external_resources/flake8_py3/ya.make b/build/external_resources/flake8_py3/ya.make index c2192b2df6..4ab62d62fb 100644 --- a/build/external_resources/flake8_py3/ya.make +++ b/build/external_resources/flake8_py3/ya.make @@ -4,20 +4,20 @@ OWNER(g:yatool) IF (HOST_OS_DARWIN AND HOST_ARCH_ARM64 OR HOST_OS_DARWIN AND HOST_ARCH_X86_64 OR - HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR - HOST_OS_LINUX AND HOST_ARCH_X86_64 OR - HOST_OS_WINDOWS AND HOST_ARCH_X86_64) -ELSE() - MESSAGE(FATAL_ERROR Unsupported host platform for FLAKE8_PY3) + HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR + HOST_OS_LINUX AND HOST_ARCH_X86_64 OR + HOST_OS_WINDOWS AND HOST_ARCH_X86_64) +ELSE() + MESSAGE(FATAL_ERROR Unsupported host platform for FLAKE8_PY3) ENDIF() -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - FLAKE8_PY3 +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + FLAKE8_PY3 sbr:2617984240 FOR DARWIN-ARM64 sbr:2617985759 FOR DARWIN sbr:2617984621 FOR LINUX-PPC64LE sbr:2617987339 FOR LINUX sbr:2617986064 FOR WIN32 -) - +) + END() diff --git a/build/external_resources/go_fake_xcrun/ya.make b/build/external_resources/go_fake_xcrun/ya.make index f82b5e750a..b645b6bc45 100644 --- a/build/external_resources/go_fake_xcrun/ya.make +++ b/build/external_resources/go_fake_xcrun/ya.make @@ -1,17 +1,17 @@ -OWNER(g:ymake) - -RESOURCES_LIBRARY() - -IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) - MESSAGE(FATAL_ERROR Unsupported host platform for GO_FAKE_XCRUN) -ELSE() - DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - GO_FAKE_XCRUN +OWNER(g:ymake) + +RESOURCES_LIBRARY() + +IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) + MESSAGE(FATAL_ERROR Unsupported host platform for GO_FAKE_XCRUN) +ELSE() + DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + GO_FAKE_XCRUN sbr:2000736487 FOR DARWIN-ARM64 - sbr:2000736487 FOR DARWIN - sbr:2000736769 FOR LINUX - sbr:2000736617 FOR WIN32 - ) -ENDIF() - -END() + sbr:2000736487 FOR DARWIN + sbr:2000736769 FOR LINUX + sbr:2000736617 FOR WIN32 + ) +ENDIF() + +END() diff --git a/build/external_resources/go_tools/ya.make b/build/external_resources/go_tools/ya.make index ff3f8f7f2a..fe94f46701 100644 --- a/build/external_resources/go_tools/ya.make +++ b/build/external_resources/go_tools/ya.make @@ -1,27 +1,27 @@ -OWNER(g:ymake) - -RESOURCES_LIBRARY() - -IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) - MESSAGE(FATAL_ERROR Unsupported host platform for GO_TOOLS) -ELSEIF(GOSTD_VERSION == 1.17.6) - DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - GO_TOOLS - sbr:2685555388 FOR DARWIN-ARM64 - sbr:2685554692 FOR DARWIN - sbr:2685556023 FOR LINUX - sbr:2685556796 FOR WIN32 - ) -ELSEIF(GOSTD_VERSION == 1.18beta2) - DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - GO_TOOLS - sbr:2764476653 FOR DARWIN-ARM64 - sbr:2764475951 FOR DARWIN - sbr:2764477456 FOR LINUX - sbr:2764478136 FOR WIN32 - ) -ELSE() - MESSAGE(FATAL_ERROR Unsupported version [${GOSTD_VERSION}] of Go Standard Library) -ENDIF() - -END() +OWNER(g:ymake) + +RESOURCES_LIBRARY() + +IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) + MESSAGE(FATAL_ERROR Unsupported host platform for GO_TOOLS) +ELSEIF(GOSTD_VERSION == 1.17.6) + DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + GO_TOOLS + sbr:2685555388 FOR DARWIN-ARM64 + sbr:2685554692 FOR DARWIN + sbr:2685556023 FOR LINUX + sbr:2685556796 FOR WIN32 + ) +ELSEIF(GOSTD_VERSION == 1.18beta2) + DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + GO_TOOLS + sbr:2764476653 FOR DARWIN-ARM64 + sbr:2764475951 FOR DARWIN + sbr:2764477456 FOR LINUX + sbr:2764478136 FOR WIN32 + ) +ELSE() + MESSAGE(FATAL_ERROR Unsupported version [${GOSTD_VERSION}] of Go Standard Library) +ENDIF() + +END() diff --git a/build/external_resources/goyndexer/ya.make b/build/external_resources/goyndexer/ya.make index 8f0adef54a..c7dc441e8f 100644 --- a/build/external_resources/goyndexer/ya.make +++ b/build/external_resources/goyndexer/ya.make @@ -1,16 +1,16 @@ -OWNER(g:ymake) - -RESOURCES_LIBRARY() - -IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) - MESSAGE(FATAL_ERROR Unsupported host platform for goyndexer) -ENDIF() - -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - GOYNDEXER - sbr:2051948481 FOR DARWIN - sbr:2051949278 FOR LINUX - sbr:2051948796 FOR WIN32 -) - -END() +OWNER(g:ymake) + +RESOURCES_LIBRARY() + +IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) + MESSAGE(FATAL_ERROR Unsupported host platform for goyndexer) +ENDIF() + +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + GOYNDEXER + sbr:2051948481 FOR DARWIN + sbr:2051949278 FOR LINUX + sbr:2051948796 FOR WIN32 +) + +END() diff --git a/build/external_resources/gradle/ya.make b/build/external_resources/gradle/ya.make index 579d41e50e..170ba99d4e 100644 --- a/build/external_resources/gradle/ya.make +++ b/build/external_resources/gradle/ya.make @@ -1,11 +1,11 @@ -RESOURCES_LIBRARY() - -OWNER(g:mapkit) - +RESOURCES_LIBRARY() + +OWNER(g:mapkit) + # Gradle 6.1.1 # Build time: 2020-01-24 22:30:24 UTC # Revision: a8c3750babb99d1894378073499d6716a1a1fa5d DECLARE_EXTERNAL_RESOURCE(GRADLE sbr:2566840956) -DECLARE_EXTERNAL_RESOURCE(GRADLE_DEBUG_STORE sbr:1192738881) - -END() +DECLARE_EXTERNAL_RESOURCE(GRADLE_DEBUG_STORE sbr:1192738881) + +END() diff --git a/build/external_resources/mapsmobi_maven_repo/ya.make b/build/external_resources/mapsmobi_maven_repo/ya.make index 2487263d6b..23cba7d581 100644 --- a/build/external_resources/mapsmobi_maven_repo/ya.make +++ b/build/external_resources/mapsmobi_maven_repo/ya.make @@ -1,11 +1,11 @@ -RESOURCES_LIBRARY() - -OWNER(g:mapkit) - -IF (OS_ANDROID) +RESOURCES_LIBRARY() + +OWNER(g:mapkit) + +IF (OS_ANDROID) DECLARE_EXTERNAL_RESOURCE(MAPSMOBI_MAVEN_REPO sbr:2586526945) -ELSE() - MESSAGE(FATAL_ERROR Unsupported platform) -ENDIF() - -END() +ELSE() + MESSAGE(FATAL_ERROR Unsupported platform) +ENDIF() + +END() diff --git a/build/external_resources/maven/ya.make b/build/external_resources/maven/ya.make index 44c39b6dd9..18a97a0675 100644 --- a/build/external_resources/maven/ya.make +++ b/build/external_resources/maven/ya.make @@ -1,8 +1,8 @@ -RESOURCES_LIBRARY() - -OWNER(g:mapkit) - -# Apache Maven: version 3.6.1 -DECLARE_EXTERNAL_RESOURCE(MAVEN sbr:1231330972) - -END() +RESOURCES_LIBRARY() + +OWNER(g:mapkit) + +# Apache Maven: version 3.6.1 +DECLARE_EXTERNAL_RESOURCE(MAVEN sbr:1231330972) + +END() diff --git a/build/external_resources/ya.make b/build/external_resources/ya.make index ba2ae38588..346a3e42eb 100644 --- a/build/external_resources/ya.make +++ b/build/external_resources/ya.make @@ -1,42 +1,42 @@ -OWNER(g:ymake) - -RECURSE( - antlr3 - antlr4 - gradle - maven +OWNER(g:ymake) + +RECURSE( + antlr3 + antlr4 + gradle + maven swift-demangle -) - -IF (OS_ANDROID) - RECURSE( - android_sdk - mapsmobi_maven_repo - ) -ENDIF() - -IF (OS_IOS) - RECURSE( - mapsmobi_ios_pods - ) -ENDIF() - -IF (OS_LINUX) - RECURSE( - codenavigation - ) -ENDIF() - -IF (OS_DARWIN OR OS_LINUX OR OS_WINDOWS) - RECURSE( - flake8_py2 - flake8_py3 - go_fake_xcrun - go_tools - goyndexer +) + +IF (OS_ANDROID) + RECURSE( + android_sdk + mapsmobi_maven_repo + ) +ENDIF() + +IF (OS_IOS) + RECURSE( + mapsmobi_ios_pods + ) +ENDIF() + +IF (OS_LINUX) + RECURSE( + codenavigation + ) +ENDIF() + +IF (OS_DARWIN OR OS_LINUX OR OS_WINDOWS) + RECURSE( + flake8_py2 + flake8_py3 + go_fake_xcrun + go_tools + goyndexer pnpm typescript - ymake - yolint - ) -ENDIF() + ymake + yolint + ) +ENDIF() diff --git a/build/external_resources/ymake/ya.make b/build/external_resources/ymake/ya.make index 7e0fc1023b..5017a55c4b 100644 --- a/build/external_resources/ymake/ya.make +++ b/build/external_resources/ymake/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -RESOURCES_LIBRARY() - -INCLUDE(${ARCADIA_ROOT}/build/external_resources/ymake/ya.make.inc) - -END() +OWNER(g:ymake) + +RESOURCES_LIBRARY() + +INCLUDE(${ARCADIA_ROOT}/build/external_resources/ymake/ya.make.inc) + +END() diff --git a/build/external_resources/ymake/ya.make.inc b/build/external_resources/ymake/ya.make.inc index b88f36c4db..3cd127b35a 100644 --- a/build/external_resources/ymake/ya.make.inc +++ b/build/external_resources/ymake/ya.make.inc @@ -1,13 +1,13 @@ -IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64 OR HOST_OS_DARWIN AND HOST_ARCH_ARM64 OR HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR HOST_OS_LINUX AND HOST_ARCH_X86_64 OR HOST_OS_WINDOWS AND HOST_ARCH_X86_64) +IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64 OR HOST_OS_DARWIN AND HOST_ARCH_ARM64 OR HOST_OS_LINUX AND HOST_ARCH_PPC64LE OR HOST_OS_LINUX AND HOST_ARCH_X86_64 OR HOST_OS_WINDOWS AND HOST_ARCH_X86_64) ELSE() - MESSAGE(FATAL_ERROR Unsupported host platform for YMAKE) -ENDIF() - -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - YMAKE + MESSAGE(FATAL_ERROR Unsupported host platform for YMAKE) +ENDIF() + +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + YMAKE sbr:2763560807 FOR DARWIN sbr:2763561138 FOR DARWIN-ARM64 sbr:2763560653 FOR LINUX-PPC64LE sbr:2763560979 FOR LINUX sbr:2763560492 FOR WIN32 -) +) diff --git a/build/external_resources/yolint/ya.make b/build/external_resources/yolint/ya.make index b19b80375d..4731dc10a8 100644 --- a/build/external_resources/yolint/ya.make +++ b/build/external_resources/yolint/ya.make @@ -1,25 +1,25 @@ -RESOURCES_LIBRARY() - -OWNER(g:ymake) - -IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) - MESSAGE(FATAL_ERROR Unsupported host platform for yolint) -ENDIF() - -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - YOLINT +RESOURCES_LIBRARY() + +OWNER(g:ymake) + +IF (NOT HOST_OS_DARWIN AND NOT HOST_OS_LINUX AND NOT HOST_OS_WINDOWS) + MESSAGE(FATAL_ERROR Unsupported host platform for yolint) +ENDIF() + +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + YOLINT sbr:2661110873 FOR DARWIN-ARM64 sbr:2661110873 FOR DARWIN sbr:2661111772 FOR LINUX sbr:2661111243 FOR WIN32 -) - -DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - YOLINT_NEXT +) + +DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( + YOLINT_NEXT sbr:2661110873 FOR DARWIN-ARM64 sbr:2661110873 FOR DARWIN sbr:2661111772 FOR LINUX sbr:2661111243 FOR WIN32 -) - -END() +) + +END() diff --git a/build/platform/bfd/ya.make b/build/platform/bfd/ya.make index 67501f665f..65f10dbd3c 100644 --- a/build/platform/bfd/ya.make +++ b/build/platform/bfd/ya.make @@ -4,6 +4,6 @@ OWNER(somov) INCLUDE(${ARCADIA_ROOT}/build/platform/binutils/binutils.resource) -LDFLAGS(-fuse-ld=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/ld.bfd) +LDFLAGS(-fuse-ld=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/ld.bfd) END() diff --git a/build/platform/cuda/ya.make b/build/platform/cuda/ya.make index 3615f682cd..def63ead0b 100644 --- a/build/platform/cuda/ya.make +++ b/build/platform/cuda/ya.make @@ -38,18 +38,18 @@ IF (USE_ARCADIA_CUDA) ENABLE(CUDA_NOT_FOUND) ENDIF() - ELSEIF (HOST_OS_LINUX AND HOST_ARCH_PPC64LE) - IF (OS_LINUX AND ARCH_PPC64LE) + ELSEIF (HOST_OS_LINUX AND HOST_ARCH_PPC64LE) + IF (OS_LINUX AND ARCH_PPC64LE) IF (CUDA_VERSION == "10.1") - DECLARE_EXTERNAL_RESOURCE(CUDA sbr:1586537264) # CUDA Toolkit 10.1.168 for Linux ppc64le - ELSE() - ENABLE(CUDA_NOT_FOUND) - ENDIF() - - ELSE() - ENABLE(CUDA_NOT_FOUND) - ENDIF() - + DECLARE_EXTERNAL_RESOURCE(CUDA sbr:1586537264) # CUDA Toolkit 10.1.168 for Linux ppc64le + ELSE() + ENABLE(CUDA_NOT_FOUND) + ENDIF() + + ELSE() + ENABLE(CUDA_NOT_FOUND) + ENDIF() + ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_X86_64) IF (OS_DARWIN AND ARCH_X86_64) IF (CUDA_VERSION == "10.1") @@ -95,18 +95,18 @@ IF (USE_ARCADIA_CUDA_HOST_COMPILER) ENABLE(CUDA_HOST_COMPILER_NOT_FOUND) ENDIF() - ELSEIF (HOST_OS_LINUX AND HOST_ARCH_PPC64LE) - IF (OS_LINUX AND ARCH_PPC64LE) + ELSEIF (HOST_OS_LINUX AND HOST_ARCH_PPC64LE) + IF (OS_LINUX AND ARCH_PPC64LE) IF (CUDA_VERSION == "10.1") - DECLARE_EXTERNAL_RESOURCE(CUDA_HOST_TOOLCHAIN sbr:1566513994) # Clang 7.0 for Linux ppc64le (not latest) - ELSE() - ENABLE(CUDA_HOST_COMPILER_NOT_FOUND) - ENDIF() - - ELSE() - ENABLE(CUDA_HOST_COMPILER_NOT_FOUND) - ENDIF() - + DECLARE_EXTERNAL_RESOURCE(CUDA_HOST_TOOLCHAIN sbr:1566513994) # Clang 7.0 for Linux ppc64le (not latest) + ELSE() + ENABLE(CUDA_HOST_COMPILER_NOT_FOUND) + ENDIF() + + ELSE() + ENABLE(CUDA_HOST_COMPILER_NOT_FOUND) + ENDIF() + ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_X86_64) IF (OS_DARWIN AND ARCH_X86_64) SET(__XCODE_RESOURCE_NAME CUDA_HOST_TOOLCHAIN) diff --git a/build/platform/gold/ya.make b/build/platform/gold/ya.make index 91f01602f7..7669471ce0 100644 --- a/build/platform/gold/ya.make +++ b/build/platform/gold/ya.make @@ -4,7 +4,7 @@ OWNER(somov) INCLUDE(${ARCADIA_ROOT}/build/platform/binutils/binutils.resource) -LDFLAGS( +LDFLAGS( -fuse-ld=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/ld.gold -Wl,-z,noexecstack ) diff --git a/build/platform/linux_sdk/ya.make b/build/platform/linux_sdk/ya.make index add74eee9e..78ec009ae8 100644 --- a/build/platform/linux_sdk/ya.make +++ b/build/platform/linux_sdk/ya.make @@ -32,11 +32,11 @@ ELSEIF (ARCH_AARCH64) ENDIF() ELSEIF (ARCH_PPC64LE) IF (OS_SDK == "ubuntu-14") - IF (HOST_ARCH_PPC64LE) - DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:1570528338) - ELSE() - DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:233217651) - ENDIF() + IF (HOST_ARCH_PPC64LE) + DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:1570528338) + ELSE() + DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:233217651) + ENDIF() ELSE() MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for PPC64LE") ENDIF() diff --git a/build/platform/lld/ya.make b/build/platform/lld/ya.make index c046e89098..65b9f80caf 100644 --- a/build/platform/lld/ya.make +++ b/build/platform/lld/ya.make @@ -54,7 +54,7 @@ ELSE() ELSE() DECLARE_EXTERNAL_RESOURCE(LLD_ROOT sbr:2283429958) ENDIF() - ENDIF() + ENDIF() LDFLAGS("-fuse-ld=$LLD_ROOT_RESOURCE_GLOBAL/ld" "-Wl,--no-rosegment") ENDIF() diff --git a/build/platform/python/ldflags/ya.make b/build/platform/python/ldflags/ya.make index d81ec31876..d44be05017 100644 --- a/build/platform/python/ldflags/ya.make +++ b/build/platform/python/ldflags/ya.make @@ -11,7 +11,7 @@ IF (USE_SYSTEM_PYTHON) LDFLAGS("/LIBPATH:$EXTERNAL_PYTHON_RESOURCE_GLOBAL/python/libs") ENDIF() ELSEIF (NOT USE_ARCADIA_PYTHON) - LDFLAGS($PYTHON_LDFLAGS $PYTHON_LIBRARIES) + LDFLAGS($PYTHON_LDFLAGS $PYTHON_LIBRARIES) ENDIF() END() diff --git a/build/platform/python/ya.make b/build/platform/python/ya.make index 247e65f4c9..a6f58e0487 100644 --- a/build/platform/python/ya.make +++ b/build/platform/python/ya.make @@ -125,7 +125,7 @@ IF (USE_SYSTEM_PYTHON) ELSEIF (NOT USE_ARCADIA_PYTHON) CFLAGS(GLOBAL $PYTHON_FLAGS) IF (OS_WINDOWS) - LDFLAGS($PYTHON_LDFLAGS $PYTHON_LIBRARIES) + LDFLAGS($PYTHON_LDFLAGS $PYTHON_LIBRARIES) ENDIF() ENDIF() diff --git a/build/plugins/copy_files_to_build_prefix.py b/build/plugins/copy_files_to_build_prefix.py index c8a6e07511..6b041ae797 100644 --- a/build/plugins/copy_files_to_build_prefix.py +++ b/build/plugins/copy_files_to_build_prefix.py @@ -1,36 +1,36 @@ -from _common import sort_by_keywords - - -SOURCE_ROOT = '${ARCADIA_ROOT}/' -BUILD_ROOT = '${ARCADIA_BUILD_ROOT}/' -CURDIR = '${CURDIR}/' -BINDIR = '${BINDIR}/' - - -def oncopy_files_to_build_prefix(unit, *args): - keywords = {'PREFIX': 1, 'GLOBAL': 0} - # NB! keyword 'GLOBAL' is a way to skip this word from the list of files - - flat_args, spec_args = sort_by_keywords(keywords, args) - prefix = spec_args['PREFIX'][0] if 'PREFIX' in spec_args else '' - - if len(prefix) > 0: - build_prefix = '/'.join([BUILD_ROOT, prefix]) - else: - build_prefix = BUILD_ROOT - - for arg in flat_args: - if arg.startswith(build_prefix): - # nothing to do - pass - elif len(prefix) > 0 and arg.startswith(BUILD_ROOT): - unit.oncopy_file([arg, '{}/{}'.format(build_prefix, arg[len(BUILD_ROOT):])]) - elif arg.startswith(SOURCE_ROOT): - unit.oncopy_file([arg, '{}/{}'.format(build_prefix, arg[len(SOURCE_ROOT):])]) - else: - offset = 0 - if arg.startswith(BINDIR): - offset = len(BINDIR) - elif arg.startswith(CURDIR): - offset = len(CURDIR) - unit.oncopy_file([arg, '{}/{}/{}'.format(build_prefix, unit.get(['MODDIR']), arg[offset:])]) +from _common import sort_by_keywords + + +SOURCE_ROOT = '${ARCADIA_ROOT}/' +BUILD_ROOT = '${ARCADIA_BUILD_ROOT}/' +CURDIR = '${CURDIR}/' +BINDIR = '${BINDIR}/' + + +def oncopy_files_to_build_prefix(unit, *args): + keywords = {'PREFIX': 1, 'GLOBAL': 0} + # NB! keyword 'GLOBAL' is a way to skip this word from the list of files + + flat_args, spec_args = sort_by_keywords(keywords, args) + prefix = spec_args['PREFIX'][0] if 'PREFIX' in spec_args else '' + + if len(prefix) > 0: + build_prefix = '/'.join([BUILD_ROOT, prefix]) + else: + build_prefix = BUILD_ROOT + + for arg in flat_args: + if arg.startswith(build_prefix): + # nothing to do + pass + elif len(prefix) > 0 and arg.startswith(BUILD_ROOT): + unit.oncopy_file([arg, '{}/{}'.format(build_prefix, arg[len(BUILD_ROOT):])]) + elif arg.startswith(SOURCE_ROOT): + unit.oncopy_file([arg, '{}/{}'.format(build_prefix, arg[len(SOURCE_ROOT):])]) + else: + offset = 0 + if arg.startswith(BINDIR): + offset = len(BINDIR) + elif arg.startswith(CURDIR): + offset = len(CURDIR) + unit.oncopy_file([arg, '{}/{}/{}'.format(build_prefix, unit.get(['MODDIR']), arg[offset:])]) diff --git a/build/plugins/docs.py b/build/plugins/docs.py index 760fe3af7f..d656ec876d 100644 --- a/build/plugins/docs.py +++ b/build/plugins/docs.py @@ -24,21 +24,21 @@ def macro_calls_to_dict(unit, calls): def onprocess_docs(unit, *args): - build_tool = unit.get('_DOCS_BUILDER_VALUE') - if build_tool: - if build_tool not in ['mkdocs', 'yfm']: - unit.message(['error', 'Unsupported build tool {}'.format(build_tool)]) + build_tool = unit.get('_DOCS_BUILDER_VALUE') + if build_tool: + if build_tool not in ['mkdocs', 'yfm']: + unit.message(['error', 'Unsupported build tool {}'.format(build_tool)]) else: - build_tool = 'yfm' - unit.ondocs_builder([build_tool]) - if build_tool == 'yfm' and unit.enabled('_DOCS_USE_PLANTUML'): - unit.on_docs_yfm_use_plantuml([]) - orig_variables = macro_calls_to_dict(unit, extract_macro_calls(unit, '_DOCS_VARS_VALUE')) - variables = {k: unit.get(k) or v for k, v in orig_variables.items()} - if variables: - if build_tool == 'mkdocs': - unit.set(['_DOCS_VARS_FLAG', ' '.join(['--var {}={}'.format(k, v) for k, v in variables.items()])]) - elif build_tool == 'yfm': - unit.set(['_DOCS_VARS_FLAG', '--vars {}'.format(json.dumps(json.dumps(variables, sort_keys=True)))]) - else: - assert False, 'Unexpected build_tool value: [{}]'.format(build_tool) + build_tool = 'yfm' + unit.ondocs_builder([build_tool]) + if build_tool == 'yfm' and unit.enabled('_DOCS_USE_PLANTUML'): + unit.on_docs_yfm_use_plantuml([]) + orig_variables = macro_calls_to_dict(unit, extract_macro_calls(unit, '_DOCS_VARS_VALUE')) + variables = {k: unit.get(k) or v for k, v in orig_variables.items()} + if variables: + if build_tool == 'mkdocs': + unit.set(['_DOCS_VARS_FLAG', ' '.join(['--var {}={}'.format(k, v) for k, v in variables.items()])]) + elif build_tool == 'yfm': + unit.set(['_DOCS_VARS_FLAG', '--vars {}'.format(json.dumps(json.dumps(variables, sort_keys=True)))]) + else: + assert False, 'Unexpected build_tool value: [{}]'.format(build_tool) diff --git a/build/plugins/gobuild.py b/build/plugins/gobuild.py index 8df96ebc55..3085eb8a5e 100644 --- a/build/plugins/gobuild.py +++ b/build/plugins/gobuild.py @@ -1,277 +1,277 @@ -import base64 -import itertools -import md5 -import os -from _common import rootrel_arc_src, tobuilddir -import ymake - - -runtime_cgo_path = os.path.join('runtime', 'cgo') -runtime_msan_path = os.path.join('runtime', 'msan') -runtime_race_path = os.path.join('runtime', 'race') -arc_project_prefix = 'a.yandex-team.ru/' -import_runtime_cgo_false = { - 'norace': (runtime_cgo_path, runtime_msan_path, runtime_race_path), - 'race': (runtime_cgo_path, runtime_msan_path), -} -import_syscall_false = { - 'norace': (runtime_cgo_path), - 'race': (runtime_cgo_path, runtime_race_path), -} - - -def get_import_path(unit): - # std_lib_prefix = unit.get('GO_STD_LIB_PREFIX') - # unit.get() doesn't evalutate the value of variable, so the line above doesn't really work - std_lib_prefix = unit.get('GOSTD') + '/' - arc_project_prefix = unit.get('GO_ARCADIA_PROJECT_PREFIX') - vendor_prefix = unit.get('GO_CONTRIB_PROJECT_PREFIX') - - module_path = rootrel_arc_src(unit.path(), unit) - assert len(module_path) > 0 - import_path = module_path.replace('\\', '/') - if import_path.startswith(std_lib_prefix): - import_path = import_path[len(std_lib_prefix):] - elif import_path.startswith(vendor_prefix): - import_path = import_path[len(vendor_prefix):] - else: - import_path = arc_project_prefix + import_path - assert len(import_path) > 0 - return import_path - - -def get_appended_values(unit, key): - value = [] - raw_value = unit.get(key) - if raw_value: - value = filter(lambda x: len(x) > 0, raw_value.split(' ')) - assert len(value) == 0 or value[0] == '$' + key - return value[1:] if len(value) > 0 else value - - -def compare_versions(version1, version2): - def last_index(version): - index = version.find('beta') - return len(version) if index < 0 else index - - v1 = tuple(x.zfill(8) for x in version1[:last_index(version1)].split('.')) - v2 = tuple(x.zfill(8) for x in version2[:last_index(version2)].split('.')) - if v1 == v2: - return 0 - return 1 if v1 < v2 else -1 - - -def need_compiling_runtime(import_path, gostd_version): - return import_path in ('runtime', 'reflect', 'syscall') or \ - import_path.startswith('runtime/internal/') or \ - compare_versions('1.17', gostd_version) >= 0 and import_path == 'internal/bytealg' - - -def go_package_name(unit): - name = unit.get('GO_PACKAGE_VALUE') - if not name: - name = unit.get('GO_TEST_IMPORT_PATH') - if name: - name = os.path.basename(os.path.normpath(name)) - elif unit.get('MODULE_TYPE') == 'PROGRAM': - name = 'main' - else: - name = unit.get('REALPRJNAME') - return name - - -def need_lint(path): - return not path.startswith('$S/vendor/') and not path.startswith('$S/contrib/') - - -def on_go_process_srcs(unit): - """ - _GO_PROCESS_SRCS() macro processes only 'CGO' files. All remaining *.go files - and other input files are currently processed by a link command of the - GO module (GO_LIBRARY, GO_PROGRAM) - """ - - srcs_files = get_appended_values(unit, '_GO_SRCS_VALUE') - - asm_files = [] - c_files = [] - cxx_files = [] - ev_files = [] - fbs_files = [] - go_files = [] - in_files = [] - proto_files = [] - s_files = [] - syso_files = [] - - classifed_files = { - '.c': c_files, - '.cc': cxx_files, - '.cpp': cxx_files, - '.cxx': cxx_files, - '.ev': ev_files, - '.fbs': fbs_files, - '.go': go_files, - '.in': in_files, - '.proto': proto_files, - '.s': asm_files, - '.syso': syso_files, - '.C': cxx_files, - '.S': s_files, - } - - # Classify files specifed in _GO_SRCS() macro by extension and process CGO_EXPORT keyword - # which can preceed C/C++ files only - is_cgo_export = False - for f in srcs_files: - _, ext = os.path.splitext(f) - ext_files = classifed_files.get(ext) - if ext_files is not None: - if is_cgo_export: - is_cgo_export = False - if ext in ('.c', '.cc', '.cpp', '.cxx', '.C'): - unit.oncopy_file_with_context([f, f, 'OUTPUT_INCLUDES', '${BINDIR}/_cgo_export.h']) - f = '${BINDIR}/' + f - else: - ymake.report_configure_error('Unmatched CGO_EXPORT keyword in SRCS() macro') - ext_files.append(f) - elif f == 'CGO_EXPORT': - is_cgo_export = True - else: - # FIXME(snermolaev): We can report an unsupported files for _GO_SRCS here - pass - if is_cgo_export: - ymake.report_configure_error('Unmatched CGO_EXPORT keyword in SRCS() macro') - - for f in go_files: - if f.endswith('_test.go'): - ymake.report_configure_error('file {} must be listed in GO_TEST_SRCS() or GO_XTEST_SRCS() macros'.format(f)) - go_test_files = get_appended_values(unit, '_GO_TEST_SRCS_VALUE') - go_xtest_files = get_appended_values(unit, '_GO_XTEST_SRCS_VALUE') - for f in go_test_files + go_xtest_files: - if not f.endswith('_test.go'): - ymake.report_configure_error('file {} should not be listed in GO_TEST_SRCS() or GO_XTEST_SRCS() macros'.format(f)) - - is_test_module = unit.enabled('GO_TEST_MODULE') - - # Add gofmt style checks - if unit.enabled('_GO_FMT_ADD_CHECK'): - resolved_go_files = [] - go_source_files = [] if is_test_module and unit.get(['GO_TEST_FOR_DIR']) else go_files - for path in itertools.chain(go_source_files, go_test_files, go_xtest_files): - if path.endswith('.go'): - resolved = unit.resolve_arc_path([path]) - if resolved != path and need_lint(resolved): - resolved_go_files.append(resolved) - if resolved_go_files: - basedirs = {} - for f in resolved_go_files: - basedir = os.path.dirname(f) - if basedir not in basedirs: - basedirs[basedir] = [] - basedirs[basedir].append(f) - for basedir in basedirs: - unit.onadd_check(['gofmt'] + basedirs[basedir]) - - # Go coverage instrumentation (NOTE! go_files list is modified here) - if is_test_module and unit.enabled('GO_TEST_COVER'): - cover_info = [] - - for f in go_files: - if f.endswith('_test.go'): - continue - cover_var = 'GoCover' + base64.b32encode(f).rstrip('=') - cover_file = unit.resolve_arc_path(f) - unit.on_go_gen_cover_go([cover_file, cover_var]) - if cover_file.startswith('$S/'): - cover_file = arc_project_prefix + cover_file[3:] - cover_info.append('{}:{}'.format(cover_var, cover_file)) - - # go_files should be empty now since the initial list shouldn't contain - # any non-go or go test file. The value of go_files list will be used later - # to update the value of _GO_SRCS_VALUE - go_files = [] - unit.set(['GO_COVER_INFO_VALUE', ' '.join(cover_info)]) - - # We have cleaned up the list of files from _GO_SRCS_VALUE var and we have to update - # the value since it is used in module command line - unit.set(['_GO_SRCS_VALUE', ' '.join(itertools.chain(go_files, asm_files, syso_files))]) - - unit_path = unit.path() - - # Add go vet check - if unit.enabled('_GO_VET_ADD_CHECK') and need_lint(unit_path): - vet_report_file_name = os.path.join(unit_path, '{}{}'.format(unit.filename(), unit.get('GO_VET_REPORT_EXT'))) - unit.onadd_check(["govet", '$(BUILD_ROOT)/' + tobuilddir(vet_report_file_name)[3:]]) - - for f in ev_files: - ev_proto_file = '{}.proto'.format(f) - unit.oncopy_file_with_context([f, ev_proto_file]) - proto_files.append(ev_proto_file) - - # Process .proto files - for f in proto_files: - unit.on_go_proto_cmd(f) - - # Process .fbs files - for f in fbs_files: - unit.on_go_flatc_cmd([f, go_package_name(unit)]) - - # Process .in files - for f in in_files: - unit.onsrc(f) - - # Generate .symabis for .s files (starting from 1.12 version) - if len(asm_files) > 0: - symabis_flags = [] - gostd_version = unit.get('GOSTD_VERSION') - if compare_versions('1.16', gostd_version) >= 0: - import_path = get_import_path(unit) - symabis_flags.extend(['FLAGS', '-p', import_path]) - if need_compiling_runtime(import_path, gostd_version): - symabis_flags.append('-compiling-runtime') - unit.on_go_compile_symabis(asm_files + symabis_flags) - - # Process cgo files - cgo_files = get_appended_values(unit, '_CGO_SRCS_VALUE') - - cgo_cflags = [] - if len(c_files) + len(cxx_files) + len(s_files) + len(cgo_files) > 0: - if is_test_module: - go_test_for_dir = unit.get('GO_TEST_FOR_DIR') - if go_test_for_dir and go_test_for_dir.startswith('$S/'): - unit.onaddincl(['FOR', 'c', go_test_for_dir[3:]]) - unit.onaddincl(['FOR', 'c', unit.get('MODDIR')]) - cgo_cflags = get_appended_values(unit, 'CGO_CFLAGS_VALUE') - - for f in itertools.chain(c_files, cxx_files, s_files): - unit.onsrc([f] + cgo_cflags) - - if len(cgo_files) > 0: - if not unit.enabled('CGO_ENABLED'): - ymake.report_configure_error('trying to build with CGO (CGO_SRCS is non-empty) when CGO is disabled') - import_path = get_import_path(unit) - if import_path != runtime_cgo_path: - go_std_root = unit.get('GOSTD') - unit.onpeerdir(os.path.join(go_std_root, runtime_cgo_path)) - race_mode = 'race' if unit.enabled('RACE') else 'norace' - import_runtime_cgo = 'false' if import_path in import_runtime_cgo_false[race_mode] else 'true' - import_syscall = 'false' if import_path in import_syscall_false[race_mode] else 'true' - args = [import_path] + cgo_files + ['FLAGS', '-import_runtime_cgo=' + import_runtime_cgo, '-import_syscall=' + import_syscall] +import base64 +import itertools +import md5 +import os +from _common import rootrel_arc_src, tobuilddir +import ymake + + +runtime_cgo_path = os.path.join('runtime', 'cgo') +runtime_msan_path = os.path.join('runtime', 'msan') +runtime_race_path = os.path.join('runtime', 'race') +arc_project_prefix = 'a.yandex-team.ru/' +import_runtime_cgo_false = { + 'norace': (runtime_cgo_path, runtime_msan_path, runtime_race_path), + 'race': (runtime_cgo_path, runtime_msan_path), +} +import_syscall_false = { + 'norace': (runtime_cgo_path), + 'race': (runtime_cgo_path, runtime_race_path), +} + + +def get_import_path(unit): + # std_lib_prefix = unit.get('GO_STD_LIB_PREFIX') + # unit.get() doesn't evalutate the value of variable, so the line above doesn't really work + std_lib_prefix = unit.get('GOSTD') + '/' + arc_project_prefix = unit.get('GO_ARCADIA_PROJECT_PREFIX') + vendor_prefix = unit.get('GO_CONTRIB_PROJECT_PREFIX') + + module_path = rootrel_arc_src(unit.path(), unit) + assert len(module_path) > 0 + import_path = module_path.replace('\\', '/') + if import_path.startswith(std_lib_prefix): + import_path = import_path[len(std_lib_prefix):] + elif import_path.startswith(vendor_prefix): + import_path = import_path[len(vendor_prefix):] + else: + import_path = arc_project_prefix + import_path + assert len(import_path) > 0 + return import_path + + +def get_appended_values(unit, key): + value = [] + raw_value = unit.get(key) + if raw_value: + value = filter(lambda x: len(x) > 0, raw_value.split(' ')) + assert len(value) == 0 or value[0] == '$' + key + return value[1:] if len(value) > 0 else value + + +def compare_versions(version1, version2): + def last_index(version): + index = version.find('beta') + return len(version) if index < 0 else index + + v1 = tuple(x.zfill(8) for x in version1[:last_index(version1)].split('.')) + v2 = tuple(x.zfill(8) for x in version2[:last_index(version2)].split('.')) + if v1 == v2: + return 0 + return 1 if v1 < v2 else -1 + + +def need_compiling_runtime(import_path, gostd_version): + return import_path in ('runtime', 'reflect', 'syscall') or \ + import_path.startswith('runtime/internal/') or \ + compare_versions('1.17', gostd_version) >= 0 and import_path == 'internal/bytealg' + + +def go_package_name(unit): + name = unit.get('GO_PACKAGE_VALUE') + if not name: + name = unit.get('GO_TEST_IMPORT_PATH') + if name: + name = os.path.basename(os.path.normpath(name)) + elif unit.get('MODULE_TYPE') == 'PROGRAM': + name = 'main' + else: + name = unit.get('REALPRJNAME') + return name + + +def need_lint(path): + return not path.startswith('$S/vendor/') and not path.startswith('$S/contrib/') + + +def on_go_process_srcs(unit): + """ + _GO_PROCESS_SRCS() macro processes only 'CGO' files. All remaining *.go files + and other input files are currently processed by a link command of the + GO module (GO_LIBRARY, GO_PROGRAM) + """ + + srcs_files = get_appended_values(unit, '_GO_SRCS_VALUE') + + asm_files = [] + c_files = [] + cxx_files = [] + ev_files = [] + fbs_files = [] + go_files = [] + in_files = [] + proto_files = [] + s_files = [] + syso_files = [] + + classifed_files = { + '.c': c_files, + '.cc': cxx_files, + '.cpp': cxx_files, + '.cxx': cxx_files, + '.ev': ev_files, + '.fbs': fbs_files, + '.go': go_files, + '.in': in_files, + '.proto': proto_files, + '.s': asm_files, + '.syso': syso_files, + '.C': cxx_files, + '.S': s_files, + } + + # Classify files specifed in _GO_SRCS() macro by extension and process CGO_EXPORT keyword + # which can preceed C/C++ files only + is_cgo_export = False + for f in srcs_files: + _, ext = os.path.splitext(f) + ext_files = classifed_files.get(ext) + if ext_files is not None: + if is_cgo_export: + is_cgo_export = False + if ext in ('.c', '.cc', '.cpp', '.cxx', '.C'): + unit.oncopy_file_with_context([f, f, 'OUTPUT_INCLUDES', '${BINDIR}/_cgo_export.h']) + f = '${BINDIR}/' + f + else: + ymake.report_configure_error('Unmatched CGO_EXPORT keyword in SRCS() macro') + ext_files.append(f) + elif f == 'CGO_EXPORT': + is_cgo_export = True + else: + # FIXME(snermolaev): We can report an unsupported files for _GO_SRCS here + pass + if is_cgo_export: + ymake.report_configure_error('Unmatched CGO_EXPORT keyword in SRCS() macro') + + for f in go_files: + if f.endswith('_test.go'): + ymake.report_configure_error('file {} must be listed in GO_TEST_SRCS() or GO_XTEST_SRCS() macros'.format(f)) + go_test_files = get_appended_values(unit, '_GO_TEST_SRCS_VALUE') + go_xtest_files = get_appended_values(unit, '_GO_XTEST_SRCS_VALUE') + for f in go_test_files + go_xtest_files: + if not f.endswith('_test.go'): + ymake.report_configure_error('file {} should not be listed in GO_TEST_SRCS() or GO_XTEST_SRCS() macros'.format(f)) + + is_test_module = unit.enabled('GO_TEST_MODULE') + + # Add gofmt style checks + if unit.enabled('_GO_FMT_ADD_CHECK'): + resolved_go_files = [] + go_source_files = [] if is_test_module and unit.get(['GO_TEST_FOR_DIR']) else go_files + for path in itertools.chain(go_source_files, go_test_files, go_xtest_files): + if path.endswith('.go'): + resolved = unit.resolve_arc_path([path]) + if resolved != path and need_lint(resolved): + resolved_go_files.append(resolved) + if resolved_go_files: + basedirs = {} + for f in resolved_go_files: + basedir = os.path.dirname(f) + if basedir not in basedirs: + basedirs[basedir] = [] + basedirs[basedir].append(f) + for basedir in basedirs: + unit.onadd_check(['gofmt'] + basedirs[basedir]) + + # Go coverage instrumentation (NOTE! go_files list is modified here) + if is_test_module and unit.enabled('GO_TEST_COVER'): + cover_info = [] + + for f in go_files: + if f.endswith('_test.go'): + continue + cover_var = 'GoCover' + base64.b32encode(f).rstrip('=') + cover_file = unit.resolve_arc_path(f) + unit.on_go_gen_cover_go([cover_file, cover_var]) + if cover_file.startswith('$S/'): + cover_file = arc_project_prefix + cover_file[3:] + cover_info.append('{}:{}'.format(cover_var, cover_file)) + + # go_files should be empty now since the initial list shouldn't contain + # any non-go or go test file. The value of go_files list will be used later + # to update the value of _GO_SRCS_VALUE + go_files = [] + unit.set(['GO_COVER_INFO_VALUE', ' '.join(cover_info)]) + + # We have cleaned up the list of files from _GO_SRCS_VALUE var and we have to update + # the value since it is used in module command line + unit.set(['_GO_SRCS_VALUE', ' '.join(itertools.chain(go_files, asm_files, syso_files))]) + + unit_path = unit.path() + + # Add go vet check + if unit.enabled('_GO_VET_ADD_CHECK') and need_lint(unit_path): + vet_report_file_name = os.path.join(unit_path, '{}{}'.format(unit.filename(), unit.get('GO_VET_REPORT_EXT'))) + unit.onadd_check(["govet", '$(BUILD_ROOT)/' + tobuilddir(vet_report_file_name)[3:]]) + + for f in ev_files: + ev_proto_file = '{}.proto'.format(f) + unit.oncopy_file_with_context([f, ev_proto_file]) + proto_files.append(ev_proto_file) + + # Process .proto files + for f in proto_files: + unit.on_go_proto_cmd(f) + + # Process .fbs files + for f in fbs_files: + unit.on_go_flatc_cmd([f, go_package_name(unit)]) + + # Process .in files + for f in in_files: + unit.onsrc(f) + + # Generate .symabis for .s files (starting from 1.12 version) + if len(asm_files) > 0: + symabis_flags = [] + gostd_version = unit.get('GOSTD_VERSION') + if compare_versions('1.16', gostd_version) >= 0: + import_path = get_import_path(unit) + symabis_flags.extend(['FLAGS', '-p', import_path]) + if need_compiling_runtime(import_path, gostd_version): + symabis_flags.append('-compiling-runtime') + unit.on_go_compile_symabis(asm_files + symabis_flags) + + # Process cgo files + cgo_files = get_appended_values(unit, '_CGO_SRCS_VALUE') + + cgo_cflags = [] + if len(c_files) + len(cxx_files) + len(s_files) + len(cgo_files) > 0: + if is_test_module: + go_test_for_dir = unit.get('GO_TEST_FOR_DIR') + if go_test_for_dir and go_test_for_dir.startswith('$S/'): + unit.onaddincl(['FOR', 'c', go_test_for_dir[3:]]) + unit.onaddincl(['FOR', 'c', unit.get('MODDIR')]) + cgo_cflags = get_appended_values(unit, 'CGO_CFLAGS_VALUE') + + for f in itertools.chain(c_files, cxx_files, s_files): + unit.onsrc([f] + cgo_cflags) + + if len(cgo_files) > 0: + if not unit.enabled('CGO_ENABLED'): + ymake.report_configure_error('trying to build with CGO (CGO_SRCS is non-empty) when CGO is disabled') + import_path = get_import_path(unit) + if import_path != runtime_cgo_path: + go_std_root = unit.get('GOSTD') + unit.onpeerdir(os.path.join(go_std_root, runtime_cgo_path)) + race_mode = 'race' if unit.enabled('RACE') else 'norace' + import_runtime_cgo = 'false' if import_path in import_runtime_cgo_false[race_mode] else 'true' + import_syscall = 'false' if import_path in import_syscall_false[race_mode] else 'true' + args = [import_path] + cgo_files + ['FLAGS', '-import_runtime_cgo=' + import_runtime_cgo, '-import_syscall=' + import_syscall] unit.on_go_compile_cgo1(args) - cgo2_cflags = get_appended_values(unit, 'CGO2_CFLAGS_VALUE') - for f in cgo_files: - if f.endswith('.go'): - unit.onsrc([f[:-2] + 'cgo2.c'] + cgo_cflags + cgo2_cflags) - else: - ymake.report_configure_error('file {} should not be listed in CGO_SRCS() macros'.format(f)) + cgo2_cflags = get_appended_values(unit, 'CGO2_CFLAGS_VALUE') + for f in cgo_files: + if f.endswith('.go'): + unit.onsrc([f[:-2] + 'cgo2.c'] + cgo_cflags + cgo2_cflags) + else: + ymake.report_configure_error('file {} should not be listed in CGO_SRCS() macros'.format(f)) args = [go_package_name(unit)] + cgo_files - if len(c_files) > 0: - args += ['C_FILES'] + c_files - if len(s_files) > 0: - args += ['S_FILES'] + s_files - if len(syso_files) > 0: - args += ['OBJ_FILES'] + syso_files + if len(c_files) > 0: + args += ['C_FILES'] + c_files + if len(s_files) > 0: + args += ['S_FILES'] + s_files + if len(syso_files) > 0: + args += ['OBJ_FILES'] + syso_files unit.on_go_compile_cgo2(args) @@ -279,8 +279,8 @@ def on_go_resource(unit, *args): args = list(args) files = args[::2] keys = args[1::2] - suffix_md5 = md5.new('@'.join(args)).hexdigest() - resource_go = os.path.join("resource.{}.res.go".format(suffix_md5)) + suffix_md5 = md5.new('@'.join(args)).hexdigest() + resource_go = os.path.join("resource.{}.res.go".format(suffix_md5)) unit.onpeerdir(["library/go/core/resource"]) diff --git a/build/plugins/nots.py b/build/plugins/nots.py index 5018256ddc..7c4478c454 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -27,7 +27,7 @@ def onnode_modules(unit): pm = _create_pm(unit) unit.onpeerdir(pm.get_peer_paths_from_package_json()) ins, outs = pm.calc_node_modules_inouts() - unit.on_node_modules(["IN"] + sorted(ins) + ["OUT"] + sorted(outs)) + unit.on_node_modules(["IN"] + sorted(ins) + ["OUT"] + sorted(outs)) def on_ts_configure(unit, tsconfig_path): diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index f32a2d39a0..457a9a8231 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -197,9 +197,9 @@ def onpy_srcs(unit, *args): py_main_only = unit.get('PROCESS_PY_MAIN_ONLY') with_py = not unit.get('PYBUILD_NO_PY') with_pyc = not unit.get('PYBUILD_NO_PYC') - in_proto_library = unit.get('PY_PROTO') or unit.get('PY3_PROTO') + in_proto_library = unit.get('PY_PROTO') or unit.get('PY3_PROTO') venv = unit.get(YA_IDE_VENV_VAR) - need_gazetteer_peerdir = False + need_gazetteer_peerdir = False trim = 0 if not upath.startswith('contrib/tools/python') and not upath.startswith('library/python/runtime') and unit.get('NO_PYTHON_INCLS') != 'yes': @@ -234,7 +234,7 @@ def onpy_srcs(unit, *args): pys = [] protos = [] evs = [] - fbss = [] + fbss = [] py_namespaces = {} dump_dir = unit.get('PYTHON_BUILD_DUMP_DIR') @@ -272,7 +272,7 @@ def onpy_srcs(unit, *args): elif arg == 'SWIG_CPP': swigs = swigs_cpp # Unsupported but legal PROTO_LIBRARY arguments. - elif arg == 'GLOBAL' or not in_proto_library and arg.endswith('.gztproto'): + elif arg == 'GLOBAL' or not in_proto_library and arg.endswith('.gztproto'): pass elif arg == '_MR': # GLOB support: convert arcadia-root-relative paths to module-relative @@ -290,11 +290,11 @@ def onpy_srcs(unit, *args): else: if trim: arg = arg[trim:] - if arg.endswith('.gztproto'): - need_gazetteer_peerdir = True - path = '{}.proto'.format(arg[:-9]) - else: - path = arg + if arg.endswith('.gztproto'): + need_gazetteer_peerdir = True + path = '{}.proto'.format(arg[:-9]) + else: + path = arg main_py = (path == '__main__.py' or path.endswith('/__main__.py')) if not py3 and unit_needs_main and main_py: mod = '__main__' @@ -344,8 +344,8 @@ def onpy_srcs(unit, *args): # Allow pyi files in PY_SRCS for autocomplete in IDE, but skip it during building elif path.endswith('.pyi'): pass - elif path.endswith('.fbs'): - fbss.append(pathmod) + elif path.endswith('.fbs'): + fbss.append(pathmod) else: ymake.report_configure_error('in PY_SRCS: unrecognized arg {!r}'.format(path)) @@ -464,7 +464,7 @@ def onpy_srcs(unit, *args): unit.onresource(ns_res) unit.onresource_files(res) - add_python_lint_checks(unit, 3, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()) + add_python_lint_checks(unit, 3, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()) else: for path, mod in pys: root_rel_path = rootrel_arc_src(path, unit) @@ -481,7 +481,7 @@ def onpy_srcs(unit, *args): res += [dst + '.yapyc', '/py_code/' + mod] unit.onresource(res) - add_python_lint_checks(unit, 2, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()) + add_python_lint_checks(unit, 2, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()) use_vanilla_protoc = unit.get('USE_VANILLA_PROTOC') == 'yes' if use_vanilla_protoc: @@ -515,13 +515,13 @@ def onpy_srcs(unit, *args): unit.on_generate_py_evs_internal([path for path, mod in evs]) unit.onpy_srcs([ev_arg(path, mod, unit) for path, mod in evs]) - if fbss: - unit.onpeerdir(unit.get('_PY_FBS_DEPS').split()) - pysrc_base_name = listid(fbss) - unit.onfbs_to_pysrc([pysrc_base_name] + [path for path, _ in fbss]) - unit.onsrcs(['GLOBAL', '{}.fbs.pysrc'.format(pysrc_base_name)]) - + if fbss: + unit.onpeerdir(unit.get('_PY_FBS_DEPS').split()) + pysrc_base_name = listid(fbss) + unit.onfbs_to_pysrc([pysrc_base_name] + [path for path, _ in fbss]) + unit.onsrcs(['GLOBAL', '{}.fbs.pysrc'.format(pysrc_base_name)]) + def _check_test_srcs(*args): used = set(args) & {"NAMESPACE", "TOP_LEVEL", "__main__.py"} if used: diff --git a/build/plugins/res.py b/build/plugins/res.py index a937caba81..baeec9e6eb 100644 --- a/build/plugins/res.py +++ b/build/plugins/res.py @@ -100,7 +100,7 @@ def onresource_files(unit, *args): src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit)) res += ['-', src, path, key] - if unit.enabled('_GO_MODULE'): - unit.on_go_resource(res) - else: - unit.onresource(res) + if unit.enabled('_GO_MODULE'): + unit.on_go_resource(res) + else: + unit.onresource(res) diff --git a/build/plugins/rodata.py b/build/plugins/rodata.py index 3ecb0f9a83..ffb31be093 100644 --- a/build/plugins/rodata.py +++ b/build/plugins/rodata.py @@ -21,13 +21,13 @@ class ROData(iw.CustomCommand): if flags: self.parse_flags(path, unit, collections.deque(flags.split(' '))) - if unit.enabled('DARWIN') or unit.enabled('IOS'): + if unit.enabled('DARWIN') or unit.enabled('IOS'): self._platform = ['DARWIN', 'UNIX'] self._fmt = 'macho' - elif unit.enabled('WIN64') or unit.enabled('CYGWIN'): + elif unit.enabled('WIN64') or unit.enabled('CYGWIN'): self._platform = ['WIN64'] self._fmt = 'win' - elif unit.enabled('WIN32'): + elif unit.enabled('WIN32'): self._platform = ['WIN32'] self._fmt = 'win' else: @@ -37,10 +37,10 @@ class ROData(iw.CustomCommand): if 'elf' in self._fmt: self._flags += ['-g', 'dwarf2'] - self._fmt += unit.get('HARDWARE_ARCH') - self._type = unit.get('HARDWARE_TYPE') + self._fmt += unit.get('HARDWARE_ARCH') + self._type = unit.get('HARDWARE_TYPE') - if unit.enabled('DARWIN') or unit.enabled('IOS') or (unit.enabled('WINDOWS') and unit.enabled('ARCH_TYPE_32')): + if unit.enabled('DARWIN') or unit.enabled('IOS') or (unit.enabled('WINDOWS') and unit.enabled('ARCH_TYPE_32')): self._prefix = '_' else: self._prefix = '' diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py index 8970837f0f..35fd151dcf 100644 --- a/build/plugins/ytest.py +++ b/build/plugins/ytest.py @@ -814,7 +814,7 @@ def onjava_test(unit, *args): test_data = get_norm_paths(unit, 'TEST_DATA_VALUE') test_data.append('arcadia/build/scripts/run_junit.py') - test_data.append('arcadia/build/scripts/unpacking_jtest_runner.py') + test_data.append('arcadia/build/scripts/unpacking_jtest_runner.py') data, data_files = get_canonical_test_resources(unit) test_data += data diff --git a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make index 6c588a1b09..74fe3d2ad0 100644 --- a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make +++ b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt uca9dump tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt uca9dump tool) +ENDIF() diff --git a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.prebuilt b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.prebuilt index 907121ce31..091452eda1 100644 --- a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.prebuilt +++ b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(UCA9DUMP sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${UCA9DUMP_RESOURCE_GLOBAL}/uca9dump${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(UCA9DUMP sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${UCA9DUMP_RESOURCE_GLOBAL}/uca9dump${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.resource b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.resource index d72d47b803..c2dc926f7e 100644 --- a/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.resource +++ b/build/prebuilt/contrib/libs/libmysql_r/strings/uca9dump/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623743666) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623751939) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623746337) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623743666) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623751939) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623746337) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make index 7f1e2d135f..15226b13f8 100644 --- a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make +++ b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt mypy-protobuf tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt mypy-protobuf tool) +ENDIF() diff --git a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.prebuilt b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.prebuilt index 607ec865b4..2cdd9b5831 100644 --- a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.prebuilt +++ b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - -IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - +INCLUDE(ya.make.resource) + +IF (SANDBOX_RESOURCE_ID != "") + ENABLE(PREBUILT) + PREBUILT_PROGRAM(protoc-gen-mypy) - - DECLARE_EXTERNAL_RESOURCE(MYPY_PROTOBUF sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${MYPY_PROTOBUF_RESOURCE_GLOBAL}/protoc-gen-mypy${MODULE_SUFFIX}) - - END() -ENDIF() + + DECLARE_EXTERNAL_RESOURCE(MYPY_PROTOBUF sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${MYPY_PROTOBUF_RESOURCE_GLOBAL}/protoc-gen-mypy${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.resource b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.resource index 8edf2e5d4a..d43042e753 100644 --- a/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.resource +++ b/build/prebuilt/contrib/python/mypy-protobuf/bin/protoc-gen-mypy/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2433625017) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2433625425) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2433624379) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc/ya.make b/build/prebuilt/contrib/tools/flatc/ya.make index b8bf0fa869..f5666c7ffe 100644 --- a/build/prebuilt/contrib/tools/flatc/ya.make +++ b/build/prebuilt/contrib/tools/flatc/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt flatc tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt flatc tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc/ya.make.induced_deps b/build/prebuilt/contrib/tools/flatc/ya.make.induced_deps index 9dbdb62e07..f38c78ddd7 100644 --- a/build/prebuilt/contrib/tools/flatc/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/flatc/ya.make.induced_deps @@ -1,4 +1,4 @@ -INDUCED_DEPS(h - ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers.h - ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers_iter.h -) +INDUCED_DEPS(h + ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers.h + ${ARCADIA_ROOT}/contrib/libs/flatbuffers/include/flatbuffers/flatbuffers_iter.h +) diff --git a/build/prebuilt/contrib/tools/flatc/ya.make.prebuilt b/build/prebuilt/contrib/tools/flatc/ya.make.prebuilt index 029dbb9a3e..cfdefcb0c4 100644 --- a/build/prebuilt/contrib/tools/flatc/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/flatc/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(FLATC sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${FLATC_RESOURCE_GLOBAL}/flatc${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(FLATC sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${FLATC_RESOURCE_GLOBAL}/flatc${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc/ya.make.resource b/build/prebuilt/contrib/tools/flatc/ya.make.resource index 9be11f95f2..54d2d896cc 100644 --- a/build/prebuilt/contrib/tools/flatc/ya.make.resource +++ b/build/prebuilt/contrib/tools/flatc/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266417119) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266417608) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266416624) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc64/ya.make b/build/prebuilt/contrib/tools/flatc64/ya.make index 2cac72a3f1..3fb19ef4ff 100644 --- a/build/prebuilt/contrib/tools/flatc64/ya.make +++ b/build/prebuilt/contrib/tools/flatc64/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt flatc64 tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt flatc64 tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc64/ya.make.induced_deps b/build/prebuilt/contrib/tools/flatc64/ya.make.induced_deps index 444da5bfaa..a161997e29 100644 --- a/build/prebuilt/contrib/tools/flatc64/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/flatc64/ya.make.induced_deps @@ -1,3 +1,3 @@ -INDUCED_DEPS(h - ${ARCADIA_ROOT}/contrib/libs/flatbuffers64/include/flatbuffers/flatbuffers.h -) +INDUCED_DEPS(h + ${ARCADIA_ROOT}/contrib/libs/flatbuffers64/include/flatbuffers/flatbuffers.h +) diff --git a/build/prebuilt/contrib/tools/flatc64/ya.make.prebuilt b/build/prebuilt/contrib/tools/flatc64/ya.make.prebuilt index fbd09edcd1..d318115db9 100644 --- a/build/prebuilt/contrib/tools/flatc64/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/flatc64/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(FLATC64 sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${FLATC64_RESOURCE_GLOBAL}/flatc64${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(FLATC64 sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${FLATC64_RESOURCE_GLOBAL}/flatc64${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/flatc64/ya.make.resource b/build/prebuilt/contrib/tools/flatc64/ya.make.resource index 49e1fe8cf5..e606c6816e 100644 --- a/build/prebuilt/contrib/tools/flatc64/ya.make.resource +++ b/build/prebuilt/contrib/tools/flatc64/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266401575) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266402127) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2266400964) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make index a829e49648..71e88d126e 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make +++ b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF(NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt cpp_styleguide tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF(NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt cpp_styleguide tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.induced_deps b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.induced_deps index af24c0aa4d..6bdb98c82d 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.induced_deps @@ -1,6 +1,6 @@ -INDUCED_DEPS(cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/messagext.h -) -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/json_util.h -) +INDUCED_DEPS(cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/messagext.h +) +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/json_util.h +) diff --git a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.prebuilt index e853626aea..d761105024 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(CPP_STYLEGUIDE sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${CPP_STYLEGUIDE_RESOURCE_GLOBAL}/cpp_styleguide${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(CPP_STYLEGUIDE sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${CPP_STYLEGUIDE_RESOURCE_GLOBAL}/cpp_styleguide${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.resource index 48d9ac46cb..319195bcfd 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc/plugins/cpp_styleguide/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2340617812) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2340619844) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2340616765) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make index 1e9e0eaa87..d10c1f932c 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_cpp tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_cpp tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.induced_deps b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.induced_deps index c08ef9b905..d36a864e0a 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.induced_deps @@ -1,29 +1,29 @@ -INDUCED_DEPS(cpp - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_stream.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_unary_call.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/channel_interface.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/client_unary_call.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/method_handler_impl.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/rpc_service_method.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/service_type.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/sync_stream.h -) -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_stream.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_unary_call.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/method_handler_impl.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/proto_utils.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/rpc_method.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/service_type.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/status.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/stub_options.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/sync_stream.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h - ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h -) +INDUCED_DEPS(cpp + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_stream.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_unary_call.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/channel_interface.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/client_unary_call.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/method_handler_impl.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/rpc_service_method.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/service_type.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/sync_stream.h +) +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_stream.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/async_unary_call.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/method_handler_impl.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/proto_utils.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/rpc_method.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/service_type.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/status.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/stub_options.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpc++/impl/codegen/sync_stream.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h + ${ARCADIA_ROOT}/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h +) diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.prebuilt index 3b18d1c192..35df975b33 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(GRPC_CPP sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${GRPC_CPP_RESOURCE_GLOBAL}/grpc_cpp${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(GRPC_CPP sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${GRPC_CPP_RESOURCE_GLOBAL}/grpc_cpp${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource index abdf7a9a1a..ff237b965c 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584304489) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584305537) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584303873) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make index 7f2c29c699..d1596e48d2 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_java tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_java tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt index 4636c8594c..a1557f1fb0 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(GRPC_JAVA sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${GRPC_JAVA_RESOURCE_GLOBAL}/grpc_java${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(GRPC_JAVA sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${GRPC_JAVA_RESOURCE_GLOBAL}/grpc_java${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource index ae75538a60..b5f75de51f 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584508133) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584508870) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584507401) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make index 1ff11262eb..cbd50b5417 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_python tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_python tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.prebuilt index 81fccbc086..eef80c7414 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(GRPC_PYTHON sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${GRPC_PYTHON_RESOURCE_GLOBAL}/grpc_python${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(GRPC_PYTHON sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${GRPC_PYTHON_RESOURCE_GLOBAL}/grpc_python${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource index c8b0b04166..246331a802 100644 --- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584497118) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584497759) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2584496517) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/ya.make b/build/prebuilt/contrib/tools/protoc/ya.make index 65d08147a7..a59bcb8d94 100644 --- a/build/prebuilt/contrib/tools/protoc/ya.make +++ b/build/prebuilt/contrib/tools/protoc/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/ya.make.induced_deps b/build/prebuilt/contrib/tools/protoc/ya.make.induced_deps index fe5a21c374..db1441e46a 100644 --- a/build/prebuilt/contrib/tools/protoc/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/protoc/ya.make.induced_deps @@ -1,29 +1,29 @@ -INDUCED_DEPS(cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/descriptor.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_reflection.h +INDUCED_DEPS(cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/descriptor.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_reflection.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/reflection_ops.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/reflection_ops.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/common.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/once.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/port.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/wire_format.h -) -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/arena.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/arenastring.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/wire_format.h +) +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/arena.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/arenastring.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/extension_set.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_enum_reflection.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_table_driven.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_util.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_table_driven.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/generated_message_util.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/coded_stream.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map_entry.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map_field_inl.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map_entry.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/map_field_inl.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/message.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/metadata_lite.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/port_def.inc ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/port_undef.inc ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/repeated_field.h ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/common.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/unknown_field_set.h -) + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/unknown_field_set.h +) diff --git a/build/prebuilt/contrib/tools/protoc/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc/ya.make.prebuilt index f3500a0e13..ab9d6e7e83 100644 --- a/build/prebuilt/contrib/tools/protoc/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(PROTOC sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${PROTOC_RESOURCE_GLOBAL}/protoc${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(PROTOC sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${PROTOC_RESOURCE_GLOBAL}/protoc${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc/ya.make.resource b/build/prebuilt/contrib/tools/protoc/ya.make.resource index dea93b0d30..5bf1e9272f 100644 --- a/build/prebuilt/contrib/tools/protoc/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2318808466) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2318809046) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2318807898) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc_std/ya.make b/build/prebuilt/contrib/tools/protoc_std/ya.make index 5118243498..8e9eed1e9d 100644 --- a/build/prebuilt/contrib/tools/protoc_std/ya.make +++ b/build/prebuilt/contrib/tools/protoc_std/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc_std tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc_std tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc_std/ya.make.induced_deps b/build/prebuilt/contrib/tools/protoc_std/ya.make.induced_deps index 6b33b300bb..84d7422fdc 100644 --- a/build/prebuilt/contrib/tools/protoc_std/ya.make.induced_deps +++ b/build/prebuilt/contrib/tools/protoc_std/ya.make.induced_deps @@ -1,24 +1,24 @@ -INDUCED_DEPS(cpp +INDUCED_DEPS(cpp ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/extension_set.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/io/coded_stream.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/io/zero_copy_stream_impl_lite.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_def.inc - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_undef.inc + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/io/coded_stream.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/io/zero_copy_stream_impl_lite.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_def.inc + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_undef.inc ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/reflection_ops.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/wire_format.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/wire_format_lite.h -) -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/arena.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/arenastring.h +) +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/arena.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/arenastring.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/extension_set.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/generated_enum_util.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/generated_message_table_driven.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/generated_message_util.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/generated_message_table_driven.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/generated_message_util.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/io/coded_stream.h ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/message_lite.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/metadata_lite.h - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_def.inc - ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_undef.inc + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/metadata_lite.h + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_def.inc + ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/port_undef.inc ${ARCADIA_ROOT}/contrib/libs/protobuf_std/src/google/protobuf/repeated_field.h -) +) diff --git a/build/prebuilt/contrib/tools/protoc_std/ya.make.prebuilt b/build/prebuilt/contrib/tools/protoc_std/ya.make.prebuilt index b0706a1100..2b1812503f 100644 --- a/build/prebuilt/contrib/tools/protoc_std/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/protoc_std/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM(protoc) - - DECLARE_EXTERNAL_RESOURCE(PROTOC_STD sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${PROTOC_STD_RESOURCE_GLOBAL}/protoc${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM(protoc) + + DECLARE_EXTERNAL_RESOURCE(PROTOC_STD sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${PROTOC_STD_RESOURCE_GLOBAL}/protoc${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/protoc_std/ya.make.resource b/build/prebuilt/contrib/tools/protoc_std/ya.make.resource index 738c7da7ec..9fe47a736a 100644 --- a/build/prebuilt/contrib/tools/protoc_std/ya.make.resource +++ b/build/prebuilt/contrib/tools/protoc_std/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1714771857) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1714772118) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1714771351) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/python/bootstrap/ya.make b/build/prebuilt/contrib/tools/python/bootstrap/ya.make index e2b736b1ca..9e473d24d6 100644 --- a/build/prebuilt/contrib/tools/python/bootstrap/ya.make +++ b/build/prebuilt/contrib/tools/python/bootstrap/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt python bootstrap tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt python bootstrap tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/python/bootstrap/ya.make.prebuilt b/build/prebuilt/contrib/tools/python/bootstrap/ya.make.prebuilt index b913fc767a..749920fe38 100644 --- a/build/prebuilt/contrib/tools/python/bootstrap/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/python/bootstrap/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(PYTHON_BOOTSTRAP sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${PYTHON_BOOTSTRAP_RESOURCE_GLOBAL}/bootstrap${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(PYTHON_BOOTSTRAP sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${PYTHON_BOOTSTRAP_RESOURCE_GLOBAL}/bootstrap${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/python/bootstrap/ya.make.resource b/build/prebuilt/contrib/tools/python/bootstrap/ya.make.resource index 0d93faef4c..4acc151dd5 100644 --- a/build/prebuilt/contrib/tools/python/bootstrap/ya.make.resource +++ b/build/prebuilt/contrib/tools/python/bootstrap/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623751539) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623751959) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623751763) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623751539) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623751959) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623751763) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/python3/pycc/ya.make b/build/prebuilt/contrib/tools/python3/pycc/ya.make index 02359db517..e0f9b4139f 100644 --- a/build/prebuilt/contrib/tools/python3/pycc/ya.make +++ b/build/prebuilt/contrib/tools/python3/pycc/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt python3 pycc tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt python3 pycc tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/python3/pycc/ya.make.prebuilt b/build/prebuilt/contrib/tools/python3/pycc/ya.make.prebuilt index 94be584928..b2942408fe 100644 --- a/build/prebuilt/contrib/tools/python3/pycc/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/python3/pycc/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(PYTHON3_PYCC sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${PYTHON3_PYCC_RESOURCE_GLOBAL}/pycc${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(PYTHON3_PYCC sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${PYTHON3_PYCC_RESOURCE_GLOBAL}/pycc${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/python3/pycc/ya.make.resource b/build/prebuilt/contrib/tools/python3/pycc/ya.make.resource index 86fb31e84f..4d15d51ced 100644 --- a/build/prebuilt/contrib/tools/python3/pycc/ya.make.resource +++ b/build/prebuilt/contrib/tools/python3/pycc/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1980692765) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1980693356) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1980693002) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/ragel6/ya.make b/build/prebuilt/contrib/tools/ragel6/ya.make index 09718e2927..aa77458b16 100644 --- a/build/prebuilt/contrib/tools/ragel6/ya.make +++ b/build/prebuilt/contrib/tools/ragel6/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt ragel6 tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt ragel6 tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt b/build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt index 51ee82f82e..bab6b8552c 100644 --- a/build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(RAGEL6 sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${RAGEL6_RESOURCE_GLOBAL}/ragel6${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(RAGEL6 sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${RAGEL6_RESOURCE_GLOBAL}/ragel6${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/ragel6/ya.make.resource b/build/prebuilt/contrib/tools/ragel6/ya.make.resource index e37012f682..897abaebc3 100644 --- a/build/prebuilt/contrib/tools/ragel6/ya.make.resource +++ b/build/prebuilt/contrib/tools/ragel6/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1959624378) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1969915297) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 1959624268) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/contrib/tools/yasm/ya.make b/build/prebuilt/contrib/tools/yasm/ya.make index 244e9a343b..7300364ca3 100644 --- a/build/prebuilt/contrib/tools/yasm/ya.make +++ b/build/prebuilt/contrib/tools/yasm/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt yasm tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt yasm tool) +ENDIF() diff --git a/build/prebuilt/contrib/tools/yasm/ya.make.prebuilt b/build/prebuilt/contrib/tools/yasm/ya.make.prebuilt index 7bb58bd669..712fa55f49 100644 --- a/build/prebuilt/contrib/tools/yasm/ya.make.prebuilt +++ b/build/prebuilt/contrib/tools/yasm/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(YASM sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${YASM_RESOURCE_GLOBAL}/yasm${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(YASM sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${YASM_RESOURCE_GLOBAL}/yasm${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/contrib/tools/yasm/ya.make.resource b/build/prebuilt/contrib/tools/yasm/ya.make.resource index 0a4e958b20..e144734a89 100644 --- a/build/prebuilt/contrib/tools/yasm/ya.make.resource +++ b/build/prebuilt/contrib/tools/yasm/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601295306) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601295551) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601295437) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601295306) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601295551) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601295437) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/enum_parser/enum_parser/ya.make b/build/prebuilt/tools/enum_parser/enum_parser/ya.make index 2962c10036..ba1a04f42d 100644 --- a/build/prebuilt/tools/enum_parser/enum_parser/ya.make +++ b/build/prebuilt/tools/enum_parser/enum_parser/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt enum_parser tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt enum_parser tool) +ENDIF() diff --git a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.induced_deps b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.induced_deps index d91f30d835..c4f038b68a 100644 --- a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.induced_deps +++ b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.induced_deps @@ -1,16 +1,16 @@ -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/util/generic/typetraits.h - ${ARCADIA_ROOT}/util/generic/singleton.h - ${ARCADIA_ROOT}/util/generic/string.h - ${ARCADIA_ROOT}/util/generic/vector.h - ${ARCADIA_ROOT}/util/generic/map.h - ${ARCADIA_ROOT}/util/string/cast.h - ${ARCADIA_ROOT}/util/stream/output.h - ${ARCADIA_ROOT}/tools/enum_parser/enum_serialization_runtime/enum_runtime.h - ${ARCADIA_ROOT}/tools/enum_parser/enum_parser/stdlib_deps.h -) - -INDUCED_DEPS(h - ${ARCADIA_ROOT}/util/generic/serialized_enum.h -) - +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/util/generic/typetraits.h + ${ARCADIA_ROOT}/util/generic/singleton.h + ${ARCADIA_ROOT}/util/generic/string.h + ${ARCADIA_ROOT}/util/generic/vector.h + ${ARCADIA_ROOT}/util/generic/map.h + ${ARCADIA_ROOT}/util/string/cast.h + ${ARCADIA_ROOT}/util/stream/output.h + ${ARCADIA_ROOT}/tools/enum_parser/enum_serialization_runtime/enum_runtime.h + ${ARCADIA_ROOT}/tools/enum_parser/enum_parser/stdlib_deps.h +) + +INDUCED_DEPS(h + ${ARCADIA_ROOT}/util/generic/serialized_enum.h +) + diff --git a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.prebuilt b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.prebuilt index 1a027f4421..edd30353b0 100644 --- a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.prebuilt +++ b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(ENUM_PARSER sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${ENUM_PARSER_RESOURCE_GLOBAL}/enum_parser${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(ENUM_PARSER sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${ENUM_PARSER_RESOURCE_GLOBAL}/enum_parser${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource index f4ba3bbfae..840c2b13c6 100644 --- a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource +++ b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2265845868) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2265846387) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2265845307) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/event2cpp/ya.make b/build/prebuilt/tools/event2cpp/ya.make index 8c54c21a12..b0ac6c2b2b 100644 --- a/build/prebuilt/tools/event2cpp/ya.make +++ b/build/prebuilt/tools/event2cpp/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt event2cpp tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt event2cpp tool) +ENDIF() diff --git a/build/prebuilt/tools/event2cpp/ya.make.induced_deps b/build/prebuilt/tools/event2cpp/ya.make.induced_deps index b7359d240c..d7283b83e1 100644 --- a/build/prebuilt/tools/event2cpp/ya.make.induced_deps +++ b/build/prebuilt/tools/event2cpp/ya.make.induced_deps @@ -1,8 +1,8 @@ -INDUCED_DEPS(h+cpp - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/printer.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h - ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/strutil.h - ${ARCADIA_ROOT}/library/cpp/eventlog/events_extension.h - ${ARCADIA_ROOT}/util/generic/cast.h - ${ARCADIA_ROOT}/util/stream/output.h -) +INDUCED_DEPS(h+cpp + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/printer.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h + ${ARCADIA_ROOT}/contrib/libs/protobuf/src/google/protobuf/stubs/strutil.h + ${ARCADIA_ROOT}/library/cpp/eventlog/events_extension.h + ${ARCADIA_ROOT}/util/generic/cast.h + ${ARCADIA_ROOT}/util/stream/output.h +) diff --git a/build/prebuilt/tools/event2cpp/ya.make.prebuilt b/build/prebuilt/tools/event2cpp/ya.make.prebuilt index 038cad6f79..b0155f7ba2 100644 --- a/build/prebuilt/tools/event2cpp/ya.make.prebuilt +++ b/build/prebuilt/tools/event2cpp/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(EVENT2CPP sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${EVENT2CPP_RESOURCE_GLOBAL}/event2cpp${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(EVENT2CPP sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${EVENT2CPP_RESOURCE_GLOBAL}/event2cpp${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/tools/event2cpp/ya.make.resource b/build/prebuilt/tools/event2cpp/ya.make.resource index d5fac1e52c..de22ba009e 100644 --- a/build/prebuilt/tools/event2cpp/ya.make.resource +++ b/build/prebuilt/tools/event2cpp/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2313657675) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2313658137) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2313657255) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/fix_elf/ya.make b/build/prebuilt/tools/fix_elf/ya.make index 2fefcce7df..73cdfcc3ba 100644 --- a/build/prebuilt/tools/fix_elf/ya.make +++ b/build/prebuilt/tools/fix_elf/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt fix_elf tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt fix_elf tool) +ENDIF() diff --git a/build/prebuilt/tools/fix_elf/ya.make.prebuilt b/build/prebuilt/tools/fix_elf/ya.make.prebuilt index c12328f97e..6b894f45a7 100644 --- a/build/prebuilt/tools/fix_elf/ya.make.prebuilt +++ b/build/prebuilt/tools/fix_elf/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(FIX_ELF sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${FIX_ELF_RESOURCE_GLOBAL}/fix_elf${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(FIX_ELF sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${FIX_ELF_RESOURCE_GLOBAL}/fix_elf${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/tools/fix_elf/ya.make.resource b/build/prebuilt/tools/fix_elf/ya.make.resource index f5b1f3828d..e8e567bbe2 100644 --- a/build/prebuilt/tools/fix_elf/ya.make.resource +++ b/build/prebuilt/tools/fix_elf/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623376503) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623378373) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1623377172) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623376503) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623378373) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1623377172) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/rescompiler/ya.make b/build/prebuilt/tools/rescompiler/ya.make index c30ff970c8..326a8416b9 100644 --- a/build/prebuilt/tools/rescompiler/ya.make +++ b/build/prebuilt/tools/rescompiler/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rescompiler tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rescompiler tool) +ENDIF() diff --git a/build/prebuilt/tools/rescompiler/ya.make.induced_deps b/build/prebuilt/tools/rescompiler/ya.make.induced_deps index a1957cd783..4f71d43143 100644 --- a/build/prebuilt/tools/rescompiler/ya.make.induced_deps +++ b/build/prebuilt/tools/rescompiler/ya.make.induced_deps @@ -1 +1 @@ -INDUCED_DEPS(cpp ${ARCADIA_ROOT}/library/cpp/resource/registry.h ${ARCADIA_ROOT}/library/cpp/resource/resource.h) +INDUCED_DEPS(cpp ${ARCADIA_ROOT}/library/cpp/resource/registry.h ${ARCADIA_ROOT}/library/cpp/resource/resource.h) diff --git a/build/prebuilt/tools/rescompiler/ya.make.prebuilt b/build/prebuilt/tools/rescompiler/ya.make.prebuilt index 23fa86ce01..4ec282d662 100644 --- a/build/prebuilt/tools/rescompiler/ya.make.prebuilt +++ b/build/prebuilt/tools/rescompiler/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(RESCOMPILER sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${RESCOMPILER_RESOURCE_GLOBAL}/rescompiler${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(RESCOMPILER sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${RESCOMPILER_RESOURCE_GLOBAL}/rescompiler${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/tools/rescompiler/ya.make.resource b/build/prebuilt/tools/rescompiler/ya.make.resource index 64fa9cd5e6..790d3b4e82 100644 --- a/build/prebuilt/tools/rescompiler/ya.make.resource +++ b/build/prebuilt/tools/rescompiler/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601443458) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601443719) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601443586) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601443458) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601443719) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601443586) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/rescompressor/ya.make b/build/prebuilt/tools/rescompressor/ya.make index 0751407e12..e39b2a9fda 100644 --- a/build/prebuilt/tools/rescompressor/ya.make +++ b/build/prebuilt/tools/rescompressor/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rescompressor tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rescompressor tool) +ENDIF() diff --git a/build/prebuilt/tools/rescompressor/ya.make.prebuilt b/build/prebuilt/tools/rescompressor/ya.make.prebuilt index 0b522fdc0d..8a3f67ec34 100644 --- a/build/prebuilt/tools/rescompressor/ya.make.prebuilt +++ b/build/prebuilt/tools/rescompressor/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(RESCOMPRESSOR sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${RESCOMPRESSOR_RESOURCE_GLOBAL}/rescompressor${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(RESCOMPRESSOR sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${RESCOMPRESSOR_RESOURCE_GLOBAL}/rescompressor${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/tools/rescompressor/ya.make.resource b/build/prebuilt/tools/rescompressor/ya.make.resource index e6922444dd..b0947a00cb 100644 --- a/build/prebuilt/tools/rescompressor/ya.make.resource +++ b/build/prebuilt/tools/rescompressor/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601276031) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601276198) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601276119) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601276031) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601276198) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601276119) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/tools/rorescompiler/ya.make b/build/prebuilt/tools/rorescompiler/ya.make index 2b1798c435..9b31715198 100644 --- a/build/prebuilt/tools/rorescompiler/ya.make +++ b/build/prebuilt/tools/rorescompiler/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rorescompiler tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt rorescompiler tool) +ENDIF() diff --git a/build/prebuilt/tools/rorescompiler/ya.make.induced_deps b/build/prebuilt/tools/rorescompiler/ya.make.induced_deps index af569a0520..d224726e95 100644 --- a/build/prebuilt/tools/rorescompiler/ya.make.induced_deps +++ b/build/prebuilt/tools/rorescompiler/ya.make.induced_deps @@ -1 +1 @@ -INDUCED_DEPS(cpp ${ARCADIA_ROOT}/library/cpp/resource/registry.h) +INDUCED_DEPS(cpp ${ARCADIA_ROOT}/library/cpp/resource/registry.h) diff --git a/build/prebuilt/tools/rorescompiler/ya.make.prebuilt b/build/prebuilt/tools/rorescompiler/ya.make.prebuilt index 208d7a0338..9812d242f9 100644 --- a/build/prebuilt/tools/rorescompiler/ya.make.prebuilt +++ b/build/prebuilt/tools/rorescompiler/ya.make.prebuilt @@ -1,15 +1,15 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(RORESCOMPILER sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${RORESCOMPILER_RESOURCE_GLOBAL}/rorescompiler${MODULE_SUFFIX}) - - INCLUDE(ya.make.induced_deps) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(RORESCOMPILER sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${RORESCOMPILER_RESOURCE_GLOBAL}/rorescompiler${MODULE_SUFFIX}) + + INCLUDE(ya.make.induced_deps) + + END() +ENDIF() diff --git a/build/prebuilt/tools/rorescompiler/ya.make.resource b/build/prebuilt/tools/rorescompiler/ya.make.resource index a3d4d8c4e9..fc522f8fd9 100644 --- a/build/prebuilt/tools/rorescompiler/ya.make.resource +++ b/build/prebuilt/tools/rorescompiler/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601277222) -ELSEIF (OS_LINUX AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601277445) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) - SET(SANDBOX_RESOURCE_ID 1601277334) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +IF (OS_DARWIN AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601277222) +ELSEIF (OS_LINUX AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601277445) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) + SET(SANDBOX_RESOURCE_ID 1601277334) +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make index 71685173c2..d9fb4efe9e 100644 --- a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make +++ b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make @@ -1,7 +1,7 @@ -OWNER(g:ymake) - -INCLUDE(ya.make.prebuilt) - -IF (NOT PREBUILT) - MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc-gen-go tool) -ENDIF() +OWNER(g:ymake) + +INCLUDE(ya.make.prebuilt) + +IF (NOT PREBUILT) + MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt protoc-gen-go tool) +ENDIF() diff --git a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.prebuilt b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.prebuilt index 49eea1305e..fea31af0fe 100644 --- a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.prebuilt +++ b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.prebuilt @@ -1,13 +1,13 @@ -INCLUDE(ya.make.resource) - +INCLUDE(ya.make.resource) + IF (SANDBOX_RESOURCE_ID != "") - ENABLE(PREBUILT) - - PREBUILT_PROGRAM() - - DECLARE_EXTERNAL_RESOURCE(PROTOC_GEN_GO sbr:${SANDBOX_RESOURCE_ID}) - - PRIMARY_OUTPUT(${PROTOC_GEN_GO_RESOURCE_GLOBAL}/protoc-gen-go${MODULE_SUFFIX}) - - END() -ENDIF() + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(PROTOC_GEN_GO sbr:${SANDBOX_RESOURCE_ID}) + + PRIMARY_OUTPUT(${PROTOC_GEN_GO_RESOURCE_GLOBAL}/protoc-gen-go${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.resource b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.resource index 05fcd0cbd5..6d683373b2 100644 --- a/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.resource +++ b/build/prebuilt/vendor/github.com/golang/protobuf/protoc-gen-go/ya.make.resource @@ -1,9 +1,9 @@ -IF (OS_DARWIN AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2297961019) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2297961241) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64) SET(SANDBOX_RESOURCE_ID 2297960716) -ELSE() - SET(SANDBOX_RESOURCE_ID) -ENDIF() +ELSE() + SET(SANDBOX_RESOURCE_ID) +ENDIF() diff --git a/build/prebuilt/ya.make b/build/prebuilt/ya.make index 5246e5ec04..0437f827c2 100644 --- a/build/prebuilt/ya.make +++ b/build/prebuilt/ya.make @@ -1,25 +1,25 @@ -OWNER(g:ymake) - -RECURSE( - contrib/libs/libmysql_r/strings/uca9dump +OWNER(g:ymake) + +RECURSE( + contrib/libs/libmysql_r/strings/uca9dump contrib/python/mypy-protobuf/bin/protoc-gen-mypy - contrib/tools/flatc64 - contrib/tools/flatc - contrib/tools/protoc/plugins/cpp_styleguide - contrib/tools/protoc/plugins/grpc_cpp - contrib/tools/protoc/plugins/grpc_java - contrib/tools/protoc/plugins/grpc_python - contrib/tools/protoc_std - contrib/tools/protoc - contrib/tools/python3/pycc - contrib/tools/python/bootstrap - contrib/tools/ragel6 - contrib/tools/yasm - tools/enum_parser/enum_parser - tools/event2cpp - tools/fix_elf - tools/rescompiler - tools/rescompressor - tools/rorescompiler - vendor/github.com/golang/protobuf/protoc-gen-go -) + contrib/tools/flatc64 + contrib/tools/flatc + contrib/tools/protoc/plugins/cpp_styleguide + contrib/tools/protoc/plugins/grpc_cpp + contrib/tools/protoc/plugins/grpc_java + contrib/tools/protoc/plugins/grpc_python + contrib/tools/protoc_std + contrib/tools/protoc + contrib/tools/python3/pycc + contrib/tools/python/bootstrap + contrib/tools/ragel6 + contrib/tools/yasm + tools/enum_parser/enum_parser + tools/event2cpp + tools/fix_elf + tools/rescompiler + tools/rescompressor + tools/rorescompiler + vendor/github.com/golang/protobuf/protoc-gen-go +) diff --git a/build/rules/autocheck.blacklist b/build/rules/autocheck.blacklist index 8711560ed3..1553117117 100644 --- a/build/rules/autocheck.blacklist +++ b/build/rules/autocheck.blacklist @@ -1,4 +1,4 @@ -# Atocheck blacklist +# Atocheck blacklist # The list of directories excluded from autocheck (with all subdirs) browser/frontend data-ui/abc @@ -10,9 +10,9 @@ direct/frontend/services direct/frontend/packages drive/pyback fintech/frontend -frontend +frontend games/frontend -junk +junk kinopoisk/frontend kinopoisk/analytics maps/front diff --git a/build/rules/go/vendor.policy b/build/rules/go/vendor.policy index 3e9c0acada..09b01c9b89 100644 --- a/build/rules/go/vendor.policy +++ b/build/rules/go/vendor.policy @@ -486,12 +486,12 @@ ALLOW .* -> vendor/github.com/shirou/gopsutil/v3 # Go Imagick is a Go bind to ImageMagick's MagickWand C API ALLOW .* -> vendor/gopkg.in/gographics/imagick.v2 -# fixed-size thread safe LRU cache -ALLOW .* -> vendor/github.com/hashicorp/golang-lru - -# A wrapper around os/exec.Cmd to run external commands asynchronously (for Linux and macOS) +# fixed-size thread safe LRU cache +ALLOW .* -> vendor/github.com/hashicorp/golang-lru + +# A wrapper around os/exec.Cmd to run external commands asynchronously (for Linux and macOS) ALLOW .* -> vendor/github.com/go-cmd/cmd - + # NVIDIA Management Library (NVML) is a C-based API for monitoring and managing NVIDIA GPU devices (for Linux only) ALLOW .* -> vendor/github.com/NVIDIA/gpu-monitoring-tools/bindings/go diff --git a/build/rules/local.blacklist b/build/rules/local.blacklist index 46d8cff894..de78c0b4c0 100644 --- a/build/rules/local.blacklist +++ b/build/rules/local.blacklist @@ -1,3 +1,3 @@ -# Local blacklist -# The list of top level directories excluded from local build +# Local blacklist +# The list of top level directories excluded from local build mobile diff --git a/build/rules/maps/maps.policy b/build/rules/maps/maps.policy index 8abf3fbbd7..29fcb9876d 100644 --- a/build/rules/maps/maps.policy +++ b/build/rules/maps/maps.policy @@ -149,12 +149,12 @@ ALLOW taxi/tools/dorblu/aggregator -> maps/libs/log8 ALLOW taxi/tools/dorblu/lib -> maps/libs/http ALLOW yql/udfs/taxi/graph -> maps/libs/leptidea -ALLOW maps/ -> maps/ -ALLOW sandbox/projects/maps -> maps/ -ALLOW sandbox/projects/mapsearch -> maps/ -ALLOW sandbox/projects/masstransit -> maps/ +ALLOW maps/ -> maps/ +ALLOW sandbox/projects/maps -> maps/ +ALLOW sandbox/projects/mapsearch -> maps/ +ALLOW sandbox/projects/masstransit -> maps/ ALLOW sprav/altay/panorama -> maps/streetview/libs -ALLOW yql/udfs/maps -> maps/ +ALLOW yql/udfs/maps -> maps/ # maps_adv will be split into maps and smb ALLOW maps_adv/ -> maps/ @@ -176,4 +176,4 @@ ALLOW toloka -> maps/wikimap/mapspro/services/mrc/libs/ ALLOW devtools/contrib -> maps/infra/yacare # Do not allow PEERDIRs into maps unless such PEERDIRs have be explicitly allowed above -DENY .* -> maps/ +DENY .* -> maps/ diff --git a/build/scripts/build_java_with_error_prone.py b/build/scripts/build_java_with_error_prone.py index 910443552e..108ed7bf2a 100644 --- a/build/scripts/build_java_with_error_prone.py +++ b/build/scripts/build_java_with_error_prone.py @@ -22,7 +22,7 @@ def just_do_it(argv): java, error_prone_tool, javac_cmd = argv[0], argv[1], argv[2:] if java.endswith('javac') or java.endswith('javac.exe'): for f in javac_cmd: - if f.startswith('-Xep'): + if f.startswith('-Xep'): ERROR_PRONE_FLAGS.append(f) for f in ERROR_PRONE_FLAGS: if f in javac_cmd: diff --git a/build/scripts/build_java_with_error_prone2.py b/build/scripts/build_java_with_error_prone2.py index 4efc1e444a..9bdcfcd09c 100644 --- a/build/scripts/build_java_with_error_prone2.py +++ b/build/scripts/build_java_with_error_prone2.py @@ -18,7 +18,7 @@ JAVA10_EXPORTS = [ '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', '--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED', '--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', + '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', ] @@ -26,11 +26,11 @@ def get_java_version(exe): p = subprocess.Popen([exe, '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() for line in ((out or '').strip() + (err or '').strip()).split("\n"): - m = re.match(r'java version "(.+)"', line) + m = re.match(r'java version "(.+)"', line) if m: parts = m.groups()[0].split(".") return parts[1] if parts[0] == "1" else parts[0] - m = re.match(r'openjdk version "(\d+).*"', line) + m = re.match(r'openjdk version "(\d+).*"', line) if m: parts = m.groups()[0].split(".") return parts[0] @@ -65,7 +65,7 @@ def just_do_it(argv): raise Exception("Can't determine java version") if int(ver) >= 10: for f in javac_cmd: - if f.startswith('-Xep'): + if f.startswith('-Xep'): ERROR_PRONE_FLAGS.append(f) for f in ERROR_PRONE_FLAGS: if f in javac_cmd: diff --git a/build/scripts/cgo1_wrapper.py b/build/scripts/cgo1_wrapper.py index 986082f7e9..ab9eb1d7fe 100644 --- a/build/scripts/cgo1_wrapper.py +++ b/build/scripts/cgo1_wrapper.py @@ -1,45 +1,45 @@ -import argparse -import shutil -import subprocess -import sys - - -CGO1_SUFFIX='.cgo1.go' - - -def call(cmd, cwd, env=None): - # sys.stderr.write('{}\n'.format(' '.join(cmd))) - return subprocess.call(cmd, stdin=None, stderr=sys.stderr, stdout=sys.stdout, cwd=cwd, env=env) - - -def process_file(source_root, source_prefix, build_root, build_prefix, src_path, comment_prefix): - dst_path = '{}.tmp'.format(src_path) - with open(src_path, 'r') as src_file, open(dst_path, 'w') as dst_file: - for line in src_file: - if line.startswith(comment_prefix): - dst_file.write(line.replace(source_root, source_prefix).replace(build_root, build_prefix)) - else: - dst_file.write(line) - shutil.move(dst_path, src_path) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('--build-prefix', default='__ARCADIA_BUILD_ROOT_PREFIX__') - parser.add_argument('--build-root', required=True) - parser.add_argument('--cgo1-files', nargs='+', required=True) - parser.add_argument('--cgo2-files', nargs='+', required=True) - parser.add_argument('--source-prefix', default='__ARCADIA_SOURCE_ROOT_PREFIX__') - parser.add_argument('--source-root', required=True) - parser.add_argument('cgo1_cmd', nargs='*') - args = parser.parse_args() - - exit_code = call(args.cgo1_cmd, args.source_root) - if exit_code != 0: - sys.exit(exit_code) - - for src_path in args.cgo1_files: - process_file(args.source_root, args.source_prefix, args.build_root, args.build_prefix, src_path, '//') - - for src_path in args.cgo2_files: - process_file(args.source_root, args.source_prefix, args.build_root, args.build_prefix, src_path, '#line') +import argparse +import shutil +import subprocess +import sys + + +CGO1_SUFFIX='.cgo1.go' + + +def call(cmd, cwd, env=None): + # sys.stderr.write('{}\n'.format(' '.join(cmd))) + return subprocess.call(cmd, stdin=None, stderr=sys.stderr, stdout=sys.stdout, cwd=cwd, env=env) + + +def process_file(source_root, source_prefix, build_root, build_prefix, src_path, comment_prefix): + dst_path = '{}.tmp'.format(src_path) + with open(src_path, 'r') as src_file, open(dst_path, 'w') as dst_file: + for line in src_file: + if line.startswith(comment_prefix): + dst_file.write(line.replace(source_root, source_prefix).replace(build_root, build_prefix)) + else: + dst_file.write(line) + shutil.move(dst_path, src_path) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--build-prefix', default='__ARCADIA_BUILD_ROOT_PREFIX__') + parser.add_argument('--build-root', required=True) + parser.add_argument('--cgo1-files', nargs='+', required=True) + parser.add_argument('--cgo2-files', nargs='+', required=True) + parser.add_argument('--source-prefix', default='__ARCADIA_SOURCE_ROOT_PREFIX__') + parser.add_argument('--source-root', required=True) + parser.add_argument('cgo1_cmd', nargs='*') + args = parser.parse_args() + + exit_code = call(args.cgo1_cmd, args.source_root) + if exit_code != 0: + sys.exit(exit_code) + + for src_path in args.cgo1_files: + process_file(args.source_root, args.source_prefix, args.build_root, args.build_prefix, src_path, '//') + + for src_path in args.cgo2_files: + process_file(args.source_root, args.source_prefix, args.build_root, args.build_prefix, src_path, '#line') diff --git a/build/scripts/collect_java_srcs.py b/build/scripts/collect_java_srcs.py index 170002520a..d87e18569e 100644 --- a/build/scripts/collect_java_srcs.py +++ b/build/scripts/collect_java_srcs.py @@ -34,10 +34,10 @@ if __name__ == '__main__': ) else: - destdir = os.path.dirname(dst) - if destdir and not os.path.exists(destdir): - os.makedirs(destdir) - os.rename(src, dst) + destdir = os.path.dirname(dst) + if destdir and not os.path.exists(destdir): + os.makedirs(destdir) + os.rename(src, dst) elif src.endswith('.jsr'): with contextlib.closing(tarfile.open(src, 'r')) as tf: diff --git a/build/scripts/compile_cuda.py b/build/scripts/compile_cuda.py index c0bec50b2a..61bc5eec99 100644 --- a/build/scripts/compile_cuda.py +++ b/build/scripts/compile_cuda.py @@ -53,7 +53,7 @@ def main(): '/Zc:inline', # disable unreferenced functions (kernel registrators) remove '-Wno-c++17-extensions', '-flto', - '-faligned-allocation', + '-faligned-allocation', ] if skip_nocxxinc: diff --git a/build/scripts/compile_java.py b/build/scripts/compile_java.py index e95869e853..a8c46a5565 100644 --- a/build/scripts/compile_java.py +++ b/build/scripts/compile_java.py @@ -40,9 +40,9 @@ def main(): args, javac_opts, peers = cmd_parts opts, jsrcs = parse_args(args) - jsrcs += list(filter(lambda x: x.endswith('.jsrc'), peers)) - peers = list(filter(lambda x: not x.endswith('.jsrc'), peers)) - + jsrcs += list(filter(lambda x: x.endswith('.jsrc'), peers)) + peers = list(filter(lambda x: not x.endswith('.jsrc'), peers)) + sources_dir = 'src' mkdir_p(sources_dir) for s in jsrcs: diff --git a/build/scripts/compile_jsrc.py b/build/scripts/compile_jsrc.py index 8760e5eee9..b0923cfbaf 100644 --- a/build/scripts/compile_jsrc.py +++ b/build/scripts/compile_jsrc.py @@ -1,24 +1,24 @@ -import argparse -import os -import tarfile - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--input', nargs='*', required=True) - parser.add_argument('--output', required=True) - parser.add_argument('--prefix', required=True) - - return parser.parse_args() - - -def main(): - args = parse_args() - - with tarfile.open(args.output, 'w') as out: - for f in args.input: - out.add(f, arcname=os.path.relpath(f, args.prefix)) - - -if __name__ == '__main__': - main() +import argparse +import os +import tarfile + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--input', nargs='*', required=True) + parser.add_argument('--output', required=True) + parser.add_argument('--prefix', required=True) + + return parser.parse_args() + + +def main(): + args = parse_args() + + with tarfile.open(args.output, 'w') as out: + for f in args.input: + out.add(f, arcname=os.path.relpath(f, args.prefix)) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/compile_pysrc.py b/build/scripts/compile_pysrc.py index e3637e18e2..91107b530e 100644 --- a/build/scripts/compile_pysrc.py +++ b/build/scripts/compile_pysrc.py @@ -1,101 +1,101 @@ -import argparse -import os -import shutil -import subprocess -import tarfile - - -LIMIT = 6000 - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--input', required=True) - parser.add_argument('--output', required=True) - parser.add_argument('--rescompiler', required=True) - subparsers = parser.add_subparsers(dest='mode') - - parser_py2 = subparsers.add_parser('py2') - parser_py2.add_argument('--py_compile', required=True) - parser_py2.add_argument('--python', required=True) - - parser_py3 = subparsers.add_parser('py3') - parser_py3.add_argument('--pycc', required=True) - - return parser.parse_args() - - -def call(cmd, cwd=None, env=None): - return subprocess.check_output(cmd, stdin=None, stderr=subprocess.STDOUT, cwd=cwd, env=env) - - -def iterate_py2_resource_params(py_files): - for py in py_files: - mod = py[:-3].replace('/', '.') - key = '/py_modules/{}'.format(mod) - yield py, key - yield '-', 'resfs/src/{}={}'.format(key, py) - yield '{}.yapyc'.format(py), '/py_code/{}'.format(mod) - - -def iterate_py3_resource_params(py_files): - for py in py_files: - for ext in ('', '.yapyc3'): - path = '{}{}'.format(py, ext) - dest = 'py/{}'.format(path) - key = 'resfs/file/{}'.format(dest) - src = 'resfs/src/{}={}'.format(key, os.path.basename(path)) - yield '-', src - yield path, key - - -def main(): - args = parse_args() - - names = [] - with tarfile.open(args.input, 'r') as tar: - names = tar.getnames() - tar.extractall() - - if args.mode == 'py3': - pycc_cmd = [args.pycc] - pycc_ext = '.yapyc3' - iterate_resource_params = iterate_py3_resource_params - else: - pycc_cmd = [args.python, args.py_compile] - pycc_ext = '.yapyc' - iterate_resource_params = iterate_py2_resource_params - - py_files = sorted(names) - - for py in py_files: - cmd = pycc_cmd + ['{}-'.format(os.path.basename(py)), py, '{}{}'.format(py, pycc_ext)] - call(cmd) - - outputs = [] - cmd = [args.rescompiler, '{}.0'.format(args.output)] - size = 0 - for path, key in iterate_resource_params(py_files): - addendum = len(path) + len(key) - if size + addendum > LIMIT and len(cmd) > 2: - call(cmd) - outputs.append(cmd[1]) - cmd[1] = '{}.{}'.format(args.output, len(outputs)) - cmd = cmd[0:2] - size = 0 - cmd.extend([path, key]) - size += addendum - if len(outputs) == 0: - cmd[1] = args.output - call(cmd) - else: - call(cmd) - outputs.append(cmd[1]) - with open(args.output, 'w') as fout: - for fname in outputs: - with open(fname, 'r') as fin: - shutil.copyfileobj(fin, fout) - - -if __name__ == '__main__': - main() +import argparse +import os +import shutil +import subprocess +import tarfile + + +LIMIT = 6000 + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--input', required=True) + parser.add_argument('--output', required=True) + parser.add_argument('--rescompiler', required=True) + subparsers = parser.add_subparsers(dest='mode') + + parser_py2 = subparsers.add_parser('py2') + parser_py2.add_argument('--py_compile', required=True) + parser_py2.add_argument('--python', required=True) + + parser_py3 = subparsers.add_parser('py3') + parser_py3.add_argument('--pycc', required=True) + + return parser.parse_args() + + +def call(cmd, cwd=None, env=None): + return subprocess.check_output(cmd, stdin=None, stderr=subprocess.STDOUT, cwd=cwd, env=env) + + +def iterate_py2_resource_params(py_files): + for py in py_files: + mod = py[:-3].replace('/', '.') + key = '/py_modules/{}'.format(mod) + yield py, key + yield '-', 'resfs/src/{}={}'.format(key, py) + yield '{}.yapyc'.format(py), '/py_code/{}'.format(mod) + + +def iterate_py3_resource_params(py_files): + for py in py_files: + for ext in ('', '.yapyc3'): + path = '{}{}'.format(py, ext) + dest = 'py/{}'.format(path) + key = 'resfs/file/{}'.format(dest) + src = 'resfs/src/{}={}'.format(key, os.path.basename(path)) + yield '-', src + yield path, key + + +def main(): + args = parse_args() + + names = [] + with tarfile.open(args.input, 'r') as tar: + names = tar.getnames() + tar.extractall() + + if args.mode == 'py3': + pycc_cmd = [args.pycc] + pycc_ext = '.yapyc3' + iterate_resource_params = iterate_py3_resource_params + else: + pycc_cmd = [args.python, args.py_compile] + pycc_ext = '.yapyc' + iterate_resource_params = iterate_py2_resource_params + + py_files = sorted(names) + + for py in py_files: + cmd = pycc_cmd + ['{}-'.format(os.path.basename(py)), py, '{}{}'.format(py, pycc_ext)] + call(cmd) + + outputs = [] + cmd = [args.rescompiler, '{}.0'.format(args.output)] + size = 0 + for path, key in iterate_resource_params(py_files): + addendum = len(path) + len(key) + if size + addendum > LIMIT and len(cmd) > 2: + call(cmd) + outputs.append(cmd[1]) + cmd[1] = '{}.{}'.format(args.output, len(outputs)) + cmd = cmd[0:2] + size = 0 + cmd.extend([path, key]) + size += addendum + if len(outputs) == 0: + cmd[1] = args.output + call(cmd) + else: + call(cmd) + outputs.append(cmd[1]) + with open(args.output, 'w') as fout: + for fname in outputs: + with open(fname, 'r') as fin: + shutil.copyfileobj(fin, fout) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/copy_files_to_dir.py b/build/scripts/copy_files_to_dir.py index ead57ba16e..111c62167c 100644 --- a/build/scripts/copy_files_to_dir.py +++ b/build/scripts/copy_files_to_dir.py @@ -1,59 +1,59 @@ -import argparse -import errno -import os -import process_command_files as pcf -import shutil -import sys - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--dest-dir', required=True) - parser.add_argument('--existing', choices=('skip', 'overwrite'), default='overwrite') - parser.add_argument('--flat', action='store_true') - parser.add_argument('--skip-prefix', dest='skip_prefixes', action='append', default=[]) - parser.add_argument('files', nargs='*') - return parser.parse_args(pcf.get_args(sys.argv[1:])) - - -def makedirs(dirname): - try: - os.makedirs(dirname) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(dirname): - pass - else: - raise - - -def main(): - args = parse_args() - - dest_dir = os.path.normpath(args.dest_dir) + os.pathsep - makedirs(dest_dir) - - prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes] - - for src in args.files: - src = os.path.normpath(src) - assert os.path.isfile(src) - if args.flat: - rel_dst = os.path.basename(src) - else: - rel_dst = src - for prefix in prefixes: - if src.startswith(prefix): - rel_dst = src[len(prefix):] - break - assert not os.path.isabs(rel_dst) - dst = os.path.join(args.dest_dir, rel_dst) - if os.path.isfile(dst) and args.existing == 'skip': - break - - makedirs(os.path.dirname(dst)) - - shutil.copyfile(src, dst) - - -if __name__ == '__main__': - main() +import argparse +import errno +import os +import process_command_files as pcf +import shutil +import sys + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--dest-dir', required=True) + parser.add_argument('--existing', choices=('skip', 'overwrite'), default='overwrite') + parser.add_argument('--flat', action='store_true') + parser.add_argument('--skip-prefix', dest='skip_prefixes', action='append', default=[]) + parser.add_argument('files', nargs='*') + return parser.parse_args(pcf.get_args(sys.argv[1:])) + + +def makedirs(dirname): + try: + os.makedirs(dirname) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(dirname): + pass + else: + raise + + +def main(): + args = parse_args() + + dest_dir = os.path.normpath(args.dest_dir) + os.pathsep + makedirs(dest_dir) + + prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes] + + for src in args.files: + src = os.path.normpath(src) + assert os.path.isfile(src) + if args.flat: + rel_dst = os.path.basename(src) + else: + rel_dst = src + for prefix in prefixes: + if src.startswith(prefix): + rel_dst = src[len(prefix):] + break + assert not os.path.isabs(rel_dst) + dst = os.path.join(args.dest_dir, rel_dst) + if os.path.isfile(dst) and args.existing == 'skip': + break + + makedirs(os.path.dirname(dst)) + + shutil.copyfile(src, dst) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/cpp_flatc_wrapper.py b/build/scripts/cpp_flatc_wrapper.py index 78a20e0280..bae30e7d08 100644 --- a/build/scripts/cpp_flatc_wrapper.py +++ b/build/scripts/cpp_flatc_wrapper.py @@ -1,31 +1,31 @@ -import os -import subprocess -import sys - - -def main(): - cmd = sys.argv[1:] - h_file = None - try: - index = cmd.index('-o') - h_file = cmd[index+1] - cmd[index+1] = os.path.dirname(h_file) - except (ValueError, IndexError): - pass - p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - if p.returncode: - if out: - sys.stderr.write('stdout:\n{}\n'.format(out)) - if err: - sys.stderr.write('stderr:\n{}\n'.format(err)) - sys.exit(p.returncode) - if h_file and h_file.endswith(('.fbs.h', '.fbs64.h')): - cpp_file = '{}.cpp'.format(h_file[:-2]) - with open(cpp_file, 'w') as f: - f.write('#include "{}"\n'.format(os.path.basename(h_file))) - sys.exit(0) - - -if __name__ == '__main__': - main() +import os +import subprocess +import sys + + +def main(): + cmd = sys.argv[1:] + h_file = None + try: + index = cmd.index('-o') + h_file = cmd[index+1] + cmd[index+1] = os.path.dirname(h_file) + except (ValueError, IndexError): + pass + p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if p.returncode: + if out: + sys.stderr.write('stdout:\n{}\n'.format(out)) + if err: + sys.stderr.write('stderr:\n{}\n'.format(err)) + sys.exit(p.returncode) + if h_file and h_file.endswith(('.fbs.h', '.fbs64.h')): + cpp_file = '{}.cpp'.format(h_file[:-2]) + with open(cpp_file, 'w') as f: + f.write('#include "{}"\n'.format(os.path.basename(h_file))) + sys.exit(0) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/extract_asrc.py b/build/scripts/extract_asrc.py index 89892ddf2d..1649899a14 100644 --- a/build/scripts/extract_asrc.py +++ b/build/scripts/extract_asrc.py @@ -1,23 +1,23 @@ -import argparse -import os -import tarfile - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--input', nargs='*', required=True) - parser.add_argument('--output', required=True) - - return parser.parse_args() - - -def main(): - args = parse_args() - - for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.input): - with tarfile.open(asrc, 'r') as tar: - tar.extractall(path=args.output) - - -if __name__ == '__main__': - main() +import argparse +import os +import tarfile + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--input', nargs='*', required=True) + parser.add_argument('--output', required=True) + + return parser.parse_args() + + +def main(): + args = parse_args() + + for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.input): + with tarfile.open(asrc, 'r') as tar: + tar.extractall(path=args.output) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/extract_docs.py b/build/scripts/extract_docs.py index cdcf93105f..f42ce92b1f 100644 --- a/build/scripts/extract_docs.py +++ b/build/scripts/extract_docs.py @@ -1,36 +1,36 @@ -import argparse -import os -import process_command_files as pcf -import tarfile -import sys - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--dest-dir', required=True) - parser.add_argument('--skip-prefix', dest='skip_prefixes', action='append', default=[]) - parser.add_argument('docs', nargs='*') - return parser.parse_args(pcf.get_args(sys.argv[1:])) - - -def main(): - args = parse_args() - - prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes] - - for src in filter(lambda(p): os.path.basename(p) == 'preprocessed.tar.gz', args.docs): - rel_dst = os.path.dirname(os.path.normpath(src)) - for prefix in prefixes: - if src.startswith(prefix): - rel_dst = rel_dst[len(prefix):] - break - assert not os.path.isabs(rel_dst) - dest_dir = os.path.join(args.dest_dir, rel_dst) - if not os.path.exists(dest_dir): - os.makedirs(dest_dir) - with tarfile.open(src, 'r') as tar_file: - tar_file.extractall(dest_dir) - - -if __name__ == '__main__': - main() +import argparse +import os +import process_command_files as pcf +import tarfile +import sys + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--dest-dir', required=True) + parser.add_argument('--skip-prefix', dest='skip_prefixes', action='append', default=[]) + parser.add_argument('docs', nargs='*') + return parser.parse_args(pcf.get_args(sys.argv[1:])) + + +def main(): + args = parse_args() + + prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes] + + for src in filter(lambda(p): os.path.basename(p) == 'preprocessed.tar.gz', args.docs): + rel_dst = os.path.dirname(os.path.normpath(src)) + for prefix in prefixes: + if src.startswith(prefix): + rel_dst = rel_dst[len(prefix):] + break + assert not os.path.isabs(rel_dst) + dest_dir = os.path.join(args.dest_dir, rel_dst) + if not os.path.exists(dest_dir): + os.makedirs(dest_dir) + with tarfile.open(src, 'r') as tar_file: + tar_file.extractall(dest_dir) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/f2c.py b/build/scripts/f2c.py index 7021e1391f..4e1b8b3008 100644 --- a/build/scripts/f2c.py +++ b/build/scripts/f2c.py @@ -50,7 +50,7 @@ if __name__ == '__main__': sys.exit(ret) if 'Error' in stderr: - print >>sys.stderr, stderr + print >>sys.stderr, stderr with open(args.output, 'w') as f: f.write(header) diff --git a/build/scripts/fail_module_cmd.py b/build/scripts/fail_module_cmd.py index fa14c0d851..998f33ce87 100644 --- a/build/scripts/fail_module_cmd.py +++ b/build/scripts/fail_module_cmd.py @@ -1,7 +1,7 @@ -import sys - - -if __name__ == '__main__': - assert len(sys.argv) == 2, 'Unexpected number of arguments...' - sys.stderr.write('Error: module command for target [[bad]]{}[[rst]] was not executed due to build graph configuration errors...\n'.format(sys.argv[1])) - sys.exit(1) +import sys + + +if __name__ == '__main__': + assert len(sys.argv) == 2, 'Unexpected number of arguments...' + sys.stderr.write('Error: module command for target [[bad]]{}[[rst]] was not executed due to build graph configuration errors...\n'.format(sys.argv[1])) + sys.exit(1) diff --git a/build/scripts/filter_zip.py b/build/scripts/filter_zip.py index b2121b9c9e..edb6628d6f 100644 --- a/build/scripts/filter_zip.py +++ b/build/scripts/filter_zip.py @@ -6,15 +6,15 @@ import zipfile def pattern_to_regexp(p): - return re.compile( - '^' - + re.escape(p) - .replace(r'\*\*\/', '[_DIR_]') - .replace(r'\*', '[_FILE_]') - .replace('[_DIR_]', '(.*/)?') - .replace('[_FILE_]', '([^/]*)') - + '$' - ) + return re.compile( + '^' + + re.escape(p) + .replace(r'\*\*\/', '[_DIR_]') + .replace(r'\*', '[_FILE_]') + .replace('[_DIR_]', '(.*/)?') + .replace('[_FILE_]', '([^/]*)') + + '$' + ) def is_deathman(positive_filter, negative_filter, candidate): diff --git a/build/scripts/gen_aar_gradle_script.py b/build/scripts/gen_aar_gradle_script.py index 4594e67278..b95cc051c4 100644 --- a/build/scripts/gen_aar_gradle_script.py +++ b/build/scripts/gen_aar_gradle_script.py @@ -1,11 +1,11 @@ -import argparse -import os -import tarfile - -FLAT_DIRS_REPO_TEMPLATE='flatDir {{ dirs {dirs} }}\n' -MAVEN_REPO_TEMPLATE='maven {{ url "{repo}" }}\n' -KEYSTORE_TEMLATE='signingConfigs {{ debug {{ storeFile file("{keystore}") }} }}\n' - +import argparse +import os +import tarfile + +FLAT_DIRS_REPO_TEMPLATE='flatDir {{ dirs {dirs} }}\n' +MAVEN_REPO_TEMPLATE='maven {{ url "{repo}" }}\n' +KEYSTORE_TEMLATE='signingConfigs {{ debug {{ storeFile file("{keystore}") }} }}\n' + ENABLE_JAVADOC = 'tasks["bundle${suffix}Aar"].dependsOn packageJavadocTask' DO_NOT_STRIP = '''\ packagingOptions { @@ -16,35 +16,35 @@ DO_NOT_STRIP = '''\ } ''' -AAR_TEMPLATE = """\ -ext.jniLibsDirs = [ - {jni_libs_dirs} -] - -ext.resDirs = [ - {res_dirs} -] - -ext.assetsDirs = [ - {assets_dirs} -] - -ext.javaDirs = [ - {java_dirs} -] - -def aidlDirs = [ - {aidl_dirs} -] - -ext.bundles = [ - {bundles} -] - -ext.androidArs = [ - {aars} -] - +AAR_TEMPLATE = """\ +ext.jniLibsDirs = [ + {jni_libs_dirs} +] + +ext.resDirs = [ + {res_dirs} +] + +ext.assetsDirs = [ + {assets_dirs} +] + +ext.javaDirs = [ + {java_dirs} +] + +def aidlDirs = [ + {aidl_dirs} +] + +ext.bundles = [ + {bundles} +] + +ext.androidArs = [ + {aars} +] + ext.compileOnlyAndroidArs = [ {compile_only_aars} ] @@ -53,96 +53,96 @@ def minVersion = 21 def compileVersion = 30 def targetVersion = 30 def buildVersion = '30.0.3' - -import com.android.build.gradle.LibraryPlugin + +import com.android.build.gradle.LibraryPlugin import java.nio.file.Files import java.nio.file.Paths -import java.util.regex.Matcher -import java.util.regex.Pattern +import java.util.regex.Matcher +import java.util.regex.Pattern import java.util.zip.ZipFile - - -apply plugin: 'com.github.dcendents.android-maven' - -buildDir = "$projectDir/build" - -if (!ext.has("packageSuffix")) - ext.packageSuffix = "" - -buildscript {{ -// repositories {{ -// jcenter() -// mavenCentral() -// }} - - repositories {{ - {maven_repos} - }} - - dependencies {{ + + +apply plugin: 'com.github.dcendents.android-maven' + +buildDir = "$projectDir/build" + +if (!ext.has("packageSuffix")) + ext.packageSuffix = "" + +buildscript {{ +// repositories {{ +// jcenter() +// mavenCentral() +// }} + + repositories {{ + {maven_repos} + }} + + dependencies {{ classpath 'com.android.tools.build:gradle:4.0.2' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - }} -}} - -apply plugin: LibraryPlugin - -repositories {{ -// flatDir {{ -// dirs System.env.PKG_ROOT + '/bundle' -// }} -// maven {{ -// url "http://maven.google.com/" -// }} -// maven {{ -// url "http://artifactory.yandex.net/artifactory/public/" -// }} - - {flat_dirs_repo} - - {maven_repos} -}} - -android {{ - {keystore} - - compileSdkVersion compileVersion - buildToolsVersion buildVersion - - defaultConfig {{ - minSdkVersion minVersion - targetSdkVersion targetVersion - consumerProguardFiles '{proguard_rules}' - }} - - sourceSets {{ - main {{ - manifest.srcFile '{manifest}' - jniLibs.srcDirs = jniLibsDirs - res.srcDirs = resDirs - assets.srcDirs = assetsDirs - java.srcDirs = javaDirs - aidl.srcDirs = aidlDirs - }} - // We don't use this feature, so we set it to nonexisting directory - androidTest.setRoot('bundle/tests') - }} - + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + }} +}} + +apply plugin: LibraryPlugin + +repositories {{ +// flatDir {{ +// dirs System.env.PKG_ROOT + '/bundle' +// }} +// maven {{ +// url "http://maven.google.com/" +// }} +// maven {{ +// url "http://artifactory.yandex.net/artifactory/public/" +// }} + + {flat_dirs_repo} + + {maven_repos} +}} + +android {{ + {keystore} + + compileSdkVersion compileVersion + buildToolsVersion buildVersion + + defaultConfig {{ + minSdkVersion minVersion + targetSdkVersion targetVersion + consumerProguardFiles '{proguard_rules}' + }} + + sourceSets {{ + main {{ + manifest.srcFile '{manifest}' + jniLibs.srcDirs = jniLibsDirs + res.srcDirs = resDirs + assets.srcDirs = assetsDirs + java.srcDirs = javaDirs + aidl.srcDirs = aidlDirs + }} + // We don't use this feature, so we set it to nonexisting directory + androidTest.setRoot('bundle/tests') + }} + {do_not_strip} - dependencies {{ - for (bundle in bundles) + dependencies {{ + for (bundle in bundles) compile("$bundle") {{ - transitive = true - }} - for (bundle in androidArs) + transitive = true + }} + for (bundle in androidArs) compile(bundle) {{ - transitive = true - }} + transitive = true + }} for (bundle in compileOnlyAndroidArs) compileOnly(bundle) - }} - + }} + android.libraryVariants.all {{ variant -> def suffix = variant.buildType.name.capitalize() @@ -157,17 +157,17 @@ android {{ }} }} includeEmptyDirs = false - }} - + }} + def manifestFile = android.sourceSets.main.manifest.srcFile def manifestXml = new XmlParser().parse(manifestFile) - + def packageName = manifestXml['@package'] def groupName = packageName.tokenize('.')[0..-2].join('.') - + def androidNs = new groovy.xml.Namespace("http://schemas.android.com/apk/res/android") def packageVersion = manifestXml.attributes()[androidNs.versionName] - + def writePomTask = project.tasks.create(name: "writePom${{suffix}}") {{ pom {{ project {{ @@ -177,10 +177,10 @@ android {{ }} }}.writeTo("$buildDir/${{rootProject.name}}$packageSuffix-pom.xml") }} - + tasks["bundle${{suffix}}Aar"].dependsOn sourcesJarTask tasks["bundle${{suffix}}Aar"].dependsOn writePomTask - }} + }} android.libraryVariants.all {{ variant -> def capitalizedVariantName = variant.name.capitalize() @@ -245,7 +245,7 @@ android {{ {enable_javadoc} }} -}} +}} private def extractClassesJar(aarPath, outputPath) {{ if (!aarPath.exists()) {{ @@ -265,36 +265,36 @@ private def extractClassesJar(aarPath, outputPath) {{ zip.close() }} -""" - - -def gen_build_script(args): - - def wrap(items): - return ',\n '.join('"{}"'.format(x) for x in items) - - bundles = [] - bundles_dirs = set(args.flat_repos) - for bundle in args.bundles: - dir_name, base_name = os.path.split(bundle) - assert(len(dir_name) > 0 and len(base_name) > 0) - name, ext = os.path.splitext(base_name) - assert(len(name) > 0 and ext == '.aar') - bundles_dirs.add(dir_name) - bundles.append('com.yandex:{}@aar'.format(name)) - - if len(bundles_dirs) > 0: - flat_dirs_repo = FLAT_DIRS_REPO_TEMPLATE.format(dirs=wrap(bundles_dirs)) - else: - flat_dirs_repo = '' - - maven_repos = ''.join(MAVEN_REPO_TEMPLATE.format(repo=repo) for repo in args.maven_repos) - - if args.keystore: - keystore = KEYSTORE_TEMLATE.format(keystore=args.keystore) - else: - keystore = '' - +""" + + +def gen_build_script(args): + + def wrap(items): + return ',\n '.join('"{}"'.format(x) for x in items) + + bundles = [] + bundles_dirs = set(args.flat_repos) + for bundle in args.bundles: + dir_name, base_name = os.path.split(bundle) + assert(len(dir_name) > 0 and len(base_name) > 0) + name, ext = os.path.splitext(base_name) + assert(len(name) > 0 and ext == '.aar') + bundles_dirs.add(dir_name) + bundles.append('com.yandex:{}@aar'.format(name)) + + if len(bundles_dirs) > 0: + flat_dirs_repo = FLAT_DIRS_REPO_TEMPLATE.format(dirs=wrap(bundles_dirs)) + else: + flat_dirs_repo = '' + + maven_repos = ''.join(MAVEN_REPO_TEMPLATE.format(repo=repo) for repo in args.maven_repos) + + if args.keystore: + keystore = KEYSTORE_TEMLATE.format(keystore=args.keystore) + else: + keystore = '' + if args.generate_doc: enable_javadoc = ENABLE_JAVADOC else: @@ -305,7 +305,7 @@ def gen_build_script(args): else: do_not_strip = '' - return AAR_TEMPLATE.format( + return AAR_TEMPLATE.format( aars=wrap(args.aars), compile_only_aars=wrap(args.compile_only_aars), aidl_dirs=wrap(args.aidl_dirs), @@ -321,54 +321,54 @@ def gen_build_script(args): maven_repos=maven_repos, proguard_rules=args.proguard_rules, res_dirs=wrap(args.res_dirs), - ) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() + ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() parser.add_argument('--aars', nargs='*', default=[]) parser.add_argument('--compile-only-aars', nargs='*', default=[]) parser.add_argument('--aidl-dirs', nargs='*', default=[]) - parser.add_argument('--assets-dirs', nargs='*', default=[]) + parser.add_argument('--assets-dirs', nargs='*', default=[]) parser.add_argument('--bundle-name', nargs='?', default='default-bundle-name') - parser.add_argument('--bundles', nargs='*', default=[]) + parser.add_argument('--bundles', nargs='*', default=[]) parser.add_argument('--do-not-strip', action='store_true') parser.add_argument('--flat-repos', nargs='*', default=[]) parser.add_argument('--generate-doc', action='store_true') - parser.add_argument('--java-dirs', nargs='*', default=[]) - parser.add_argument('--jni-libs-dirs', nargs='*', default=[]) + parser.add_argument('--java-dirs', nargs='*', default=[]) + parser.add_argument('--jni-libs-dirs', nargs='*', default=[]) parser.add_argument('--keystore', default=None) - parser.add_argument('--manifest', required=True) - parser.add_argument('--maven-repos', nargs='*', default=[]) - parser.add_argument('--output-dir', required=True) + parser.add_argument('--manifest', required=True) + parser.add_argument('--maven-repos', nargs='*', default=[]) + parser.add_argument('--output-dir', required=True) parser.add_argument('--peers', nargs='*', default=[]) - parser.add_argument('--proguard-rules', nargs='?', default=None) - parser.add_argument('--res-dirs', nargs='*', default=[]) - args = parser.parse_args() - - if args.proguard_rules is None: - args.proguard_rules = os.path.join(args.output_dir, 'proguard-rules.txt') - with open(args.proguard_rules, 'w') as f: - pass - - for index, jsrc in enumerate(filter(lambda x: x.endswith('.jsrc'), args.peers)): - jsrc_dir = os.path.join(args.output_dir, 'jsrc_{}'.format(str(index))) - os.makedirs(jsrc_dir) - with tarfile.open(jsrc, 'r') as tar: - tar.extractall(path=jsrc_dir) - args.java_dirs.append(jsrc_dir) - - args.build_gradle = os.path.join(args.output_dir, 'build.gradle') - args.settings_gradle = os.path.join(args.output_dir, 'settings.gradle') + parser.add_argument('--proguard-rules', nargs='?', default=None) + parser.add_argument('--res-dirs', nargs='*', default=[]) + args = parser.parse_args() + + if args.proguard_rules is None: + args.proguard_rules = os.path.join(args.output_dir, 'proguard-rules.txt') + with open(args.proguard_rules, 'w') as f: + pass + + for index, jsrc in enumerate(filter(lambda x: x.endswith('.jsrc'), args.peers)): + jsrc_dir = os.path.join(args.output_dir, 'jsrc_{}'.format(str(index))) + os.makedirs(jsrc_dir) + with tarfile.open(jsrc, 'r') as tar: + tar.extractall(path=jsrc_dir) + args.java_dirs.append(jsrc_dir) + + args.build_gradle = os.path.join(args.output_dir, 'build.gradle') + args.settings_gradle = os.path.join(args.output_dir, 'settings.gradle') args.gradle_properties = os.path.join(args.output_dir, 'gradle.properties') - - content = gen_build_script(args) - with open(args.build_gradle, 'w') as f: - f.write(content) - + + content = gen_build_script(args) + with open(args.build_gradle, 'w') as f: + f.write(content) + with open(args.gradle_properties, 'w') as f: f.write('android.useAndroidX=true') - if args.bundle_name: - with open(args.settings_gradle, 'w') as f: - f.write('rootProject.name = "{}"'.format(args.bundle_name)) + if args.bundle_name: + with open(args.settings_gradle, 'w') as f: + f.write('rootProject.name = "{}"'.format(args.bundle_name)) diff --git a/build/scripts/gen_py_protos.py b/build/scripts/gen_py_protos.py index 08397472f9..04c9de2a9e 100644 --- a/build/scripts/gen_py_protos.py +++ b/build/scripts/gen_py_protos.py @@ -40,7 +40,7 @@ def main(): plugin_out_dirs_orig[plugin] = args[i][len(plugin_out_dir_arg):] assert plugin_out_dirs_orig[plugin] == out_dir_orig, 'Params "{0}" and "{1}" expected to have the same value'.format(OUT_DIR_ARG, plugin_out_dir_arg) args[i] = plugin_out_dir_arg + out_dir_temp - + assert out_dir_temp, 'Param "{0}" not found'.format(OUT_DIR_ARG) retcode = subprocess.call(args) diff --git a/build/scripts/gen_test_apk_gradle_script.py b/build/scripts/gen_test_apk_gradle_script.py index d1a78ceb1c..2d4319336b 100644 --- a/build/scripts/gen_test_apk_gradle_script.py +++ b/build/scripts/gen_test_apk_gradle_script.py @@ -1,193 +1,193 @@ -import argparse -import os -import tarfile -import xml.etree.ElementTree as etree - -FLAT_DIRS_REPO_TEMPLATE='flatDir {{ dirs {dirs} }}\n' -MAVEN_REPO_TEMPLATE='maven {{ url "{repo}" }}\n' -KEYSTORE_TEMLATE='signingConfigs {{ debug {{ storeFile file("{keystore}") }} }}\n' - -TEST_APK_TEMPLATE = """\ -ext.jniLibsDirs = [ - {jni_libs_dirs} -] -ext.resDirs = [ - {res_dirs} -] -ext.javaDirs = [ - {java_dirs} -] -ext.bundles = [ - {bundles} -] - -buildscript {{ -// repositories {{ -// jcenter() -// }} - - repositories {{ - {maven_repos} - }} - - dependencies {{ +import argparse +import os +import tarfile +import xml.etree.ElementTree as etree + +FLAT_DIRS_REPO_TEMPLATE='flatDir {{ dirs {dirs} }}\n' +MAVEN_REPO_TEMPLATE='maven {{ url "{repo}" }}\n' +KEYSTORE_TEMLATE='signingConfigs {{ debug {{ storeFile file("{keystore}") }} }}\n' + +TEST_APK_TEMPLATE = """\ +ext.jniLibsDirs = [ + {jni_libs_dirs} +] +ext.resDirs = [ + {res_dirs} +] +ext.javaDirs = [ + {java_dirs} +] +ext.bundles = [ + {bundles} +] + +buildscript {{ +// repositories {{ +// jcenter() +// }} + + repositories {{ + {maven_repos} + }} + + dependencies {{ classpath 'com.android.tools.build:gradle:3.5.3' - }} -}} - -apply plugin: 'com.android.application' - -repositories {{ -// maven {{ -// url "http://maven.google.com/" -// }} -// maven {{ -// url "http://artifactory.yandex.net/artifactory/public/" -// }} -// flatDir {{ -// dirs System.env.PKG_ROOT + '/bundle' -// }} - - {flat_dirs_repo} - - {maven_repos} -}} - -dependencies {{ - for (bundle in bundles) {{ - compile("$bundle") - }} -}} - -android {{ - {keystore} - + }} +}} + +apply plugin: 'com.android.application' + +repositories {{ +// maven {{ +// url "http://maven.google.com/" +// }} +// maven {{ +// url "http://artifactory.yandex.net/artifactory/public/" +// }} +// flatDir {{ +// dirs System.env.PKG_ROOT + '/bundle' +// }} + + {flat_dirs_repo} + + {maven_repos} +}} + +dependencies {{ + for (bundle in bundles) {{ + compile("$bundle") + }} +}} + +android {{ + {keystore} + compileSdkVersion 30 buildToolsVersion "30.0.3" - - - defaultConfig {{ + + + defaultConfig {{ minSdkVersion 21 targetSdkVersion 30 - applicationId "{app_id}" - }} - - sourceSets {{ - main {{ - manifest.srcFile 'Manifest.xml' - jniLibs.srcDirs = jniLibsDirs - res.srcDirs = resDirs - java.srcDirs = javaDirs - }} - }} - - applicationVariants.all {{ variant -> - variant.outputs.each {{ output -> + applicationId "{app_id}" + }} + + sourceSets {{ + main {{ + manifest.srcFile 'Manifest.xml' + jniLibs.srcDirs = jniLibsDirs + res.srcDirs = resDirs + java.srcDirs = javaDirs + }} + }} + + applicationVariants.all {{ variant -> + variant.outputs.each {{ output -> def fileName = "$projectDir/output/{app_id}.apk" output.outputFileName = new File(output.outputFile.parent, fileName).getName() - }} - }} - - dependencies {{ + }} + }} + + dependencies {{ implementation 'com.google.android.gms:play-services-location:16.0.0' implementation 'com.google.android.gms:play-services-gcm:16.0.0' implementation 'com.evernote:android-job:1.2.6' implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.core:core:1.1.0' - }} -}} -""" - - -def create_native_properties(output_dir, library_name): - native_properties_file = os.path.join(output_dir, 'native_library_name.xml') - resources = etree.Element('resources') - name = etree.SubElement(resources, 'item', dict(name='native_library_name', type='string')) - name.text = library_name - etree.ElementTree(resources).write(native_properties_file, xml_declaration=True, encoding='utf-8') - - -def gen_build_script(args): - def wrap(items): - return ',\n '.join('"{}"'.format(x) for x in items) - - bundles = [] - bundles_dirs = set(args.flat_repos) - for bundle in args.bundles: - dir_name, base_name = os.path.split(bundle) - assert(len(dir_name) > 0 and len(base_name) > 0) - name, ext = os.path.splitext(base_name) - assert(len(name) > 0 and ext == '.aar') - bundles_dirs.add(dir_name) - bundles.append('com.yandex:{}@aar'.format(name)) - - if len(bundles_dirs) > 0: - flat_dirs_repo = FLAT_DIRS_REPO_TEMPLATE.format(dirs=wrap(bundles_dirs)) - else: - flat_dirs_repo = '' - - maven_repos = ''.join(MAVEN_REPO_TEMPLATE.format(repo=repo) for repo in args.maven_repos) - - if args.keystore: - keystore = KEYSTORE_TEMLATE.format(keystore=args.keystore) - else: - keystore = '' - - return TEST_APK_TEMPLATE.format( - app_id=args.app_id, - jni_libs_dirs=wrap(args.jni_libs_dirs), - res_dirs=wrap(args.res_dirs), - java_dirs=wrap(args.java_dirs), - maven_repos=maven_repos, - bundles=wrap(bundles), - flat_dirs_repo=flat_dirs_repo, - keystore=keystore, - ) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('--aars', nargs='*', default=[]) - parser.add_argument('--app-id', required=True) - parser.add_argument('--assets-dirs', nargs='*', default=[]) - parser.add_argument('--bundles', nargs='*', default=[]) - parser.add_argument('--bundle-name', nargs='?', default=None) - parser.add_argument('--java-dirs', nargs='*', default=[]) - parser.add_argument('--jni-libs-dirs', nargs='*', default=[]) - parser.add_argument('--library-name', required=True) - parser.add_argument('--manifest', required=True) - parser.add_argument('--flat-repos', nargs='*', default=[]) - parser.add_argument('--maven-repos', nargs='*', default=[]) - parser.add_argument('--output-dir', required=True) - parser.add_argument('--peers', nargs='*', default=[]) - parser.add_argument('--keystore', default=None) - parser.add_argument('--res-dirs', nargs='*', default=[]) - args = parser.parse_args() - - for index, jsrc in enumerate(filter(lambda x: x.endswith('.jsrc'), args.peers)): - jsrc_dir = os.path.join(args.output_dir, 'jsrc_{}'.format(str(index))) - os.makedirs(jsrc_dir) - with tarfile.open(jsrc, 'r') as tar: - tar.extractall(path=jsrc_dir) - args.java_dirs.append(jsrc_dir) - - args.build_gradle = os.path.join(args.output_dir, 'build.gradle') - args.settings_gradle = os.path.join(args.output_dir, 'settings.gradle') + }} +}} +""" + + +def create_native_properties(output_dir, library_name): + native_properties_file = os.path.join(output_dir, 'native_library_name.xml') + resources = etree.Element('resources') + name = etree.SubElement(resources, 'item', dict(name='native_library_name', type='string')) + name.text = library_name + etree.ElementTree(resources).write(native_properties_file, xml_declaration=True, encoding='utf-8') + + +def gen_build_script(args): + def wrap(items): + return ',\n '.join('"{}"'.format(x) for x in items) + + bundles = [] + bundles_dirs = set(args.flat_repos) + for bundle in args.bundles: + dir_name, base_name = os.path.split(bundle) + assert(len(dir_name) > 0 and len(base_name) > 0) + name, ext = os.path.splitext(base_name) + assert(len(name) > 0 and ext == '.aar') + bundles_dirs.add(dir_name) + bundles.append('com.yandex:{}@aar'.format(name)) + + if len(bundles_dirs) > 0: + flat_dirs_repo = FLAT_DIRS_REPO_TEMPLATE.format(dirs=wrap(bundles_dirs)) + else: + flat_dirs_repo = '' + + maven_repos = ''.join(MAVEN_REPO_TEMPLATE.format(repo=repo) for repo in args.maven_repos) + + if args.keystore: + keystore = KEYSTORE_TEMLATE.format(keystore=args.keystore) + else: + keystore = '' + + return TEST_APK_TEMPLATE.format( + app_id=args.app_id, + jni_libs_dirs=wrap(args.jni_libs_dirs), + res_dirs=wrap(args.res_dirs), + java_dirs=wrap(args.java_dirs), + maven_repos=maven_repos, + bundles=wrap(bundles), + flat_dirs_repo=flat_dirs_repo, + keystore=keystore, + ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--aars', nargs='*', default=[]) + parser.add_argument('--app-id', required=True) + parser.add_argument('--assets-dirs', nargs='*', default=[]) + parser.add_argument('--bundles', nargs='*', default=[]) + parser.add_argument('--bundle-name', nargs='?', default=None) + parser.add_argument('--java-dirs', nargs='*', default=[]) + parser.add_argument('--jni-libs-dirs', nargs='*', default=[]) + parser.add_argument('--library-name', required=True) + parser.add_argument('--manifest', required=True) + parser.add_argument('--flat-repos', nargs='*', default=[]) + parser.add_argument('--maven-repos', nargs='*', default=[]) + parser.add_argument('--output-dir', required=True) + parser.add_argument('--peers', nargs='*', default=[]) + parser.add_argument('--keystore', default=None) + parser.add_argument('--res-dirs', nargs='*', default=[]) + args = parser.parse_args() + + for index, jsrc in enumerate(filter(lambda x: x.endswith('.jsrc'), args.peers)): + jsrc_dir = os.path.join(args.output_dir, 'jsrc_{}'.format(str(index))) + os.makedirs(jsrc_dir) + with tarfile.open(jsrc, 'r') as tar: + tar.extractall(path=jsrc_dir) + args.java_dirs.append(jsrc_dir) + + args.build_gradle = os.path.join(args.output_dir, 'build.gradle') + args.settings_gradle = os.path.join(args.output_dir, 'settings.gradle') args.gradle_properties = os.path.join(args.output_dir, 'gradle.properties') - - content = gen_build_script(args) - with open(args.build_gradle, 'w') as f: - f.write(content) - + + content = gen_build_script(args) + with open(args.build_gradle, 'w') as f: + f.write(content) + with open(args.gradle_properties, 'w') as f: f.write('''android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx8192m -XX:MaxPermSize=512m''') - if args.bundle_name: - with open(args.settings_gradle, 'w') as f: - f.write('rootProject.name = "{}"'.format(args.bundle_name)) - - values_dir = os.path.join(args.output_dir, 'res', 'values') - os.makedirs(values_dir) - create_native_properties(values_dir, args.library_name) + if args.bundle_name: + with open(args.settings_gradle, 'w') as f: + f.write('rootProject.name = "{}"'.format(args.bundle_name)) + + values_dir = os.path.join(args.output_dir, 'res', 'values') + os.makedirs(values_dir) + create_native_properties(values_dir, args.library_name) diff --git a/build/scripts/generate_mf.py b/build/scripts/generate_mf.py index a44a969980..c7b8a72cbd 100644 --- a/build/scripts/generate_mf.py +++ b/build/scripts/generate_mf.py @@ -67,11 +67,11 @@ def generate_mf(): build_root = options.build_root file_name = os.path.join(build_root, options.output) - if options.type != 'LIBRARY': - for rel_filename in peers: - with open(os.path.join(build_root, rel_filename + '.mf')) as peer_file: - peer_meta = json.load(peer_file) - meta['dependencies'].append(peer_meta) + if options.type != 'LIBRARY': + for rel_filename in peers: + with open(os.path.join(build_root, rel_filename + '.mf')) as peer_file: + peer_meta = json.load(peer_file) + meta['dependencies'].append(peer_meta) if credits: union_texts = [] diff --git a/build/scripts/go_proto_wrapper.py b/build/scripts/go_proto_wrapper.py index 065120b6eb..74c3aaf82a 100644 --- a/build/scripts/go_proto_wrapper.py +++ b/build/scripts/go_proto_wrapper.py @@ -1,82 +1,82 @@ -from __future__ import absolute_import -import os -import re -import shutil -import subprocess -import sys -import tempfile -from six.moves import range - - -OUT_DIR_FLAG_PATTERN = re.compile(r'^(--go(([-_]\w+))*_out=)') - - -def move_tree(src_root, dst_root): - for root, _, files in os.walk(src_root): - rel_dir = os.path.relpath(root, src_root) - dst_dir = os.path.join(dst_root, rel_dir) - if not os.path.exists(dst_dir): - os.mkdir(dst_dir) - for file in files: - os.rename(os.path.join(root, file), os.path.join(dst_dir, file)) - - -def main(arcadia_prefix, contrib_prefix, proto_namespace, args): - out_dir_orig = None - out_dir_temp = None - for i in range(len(args)): - m = re.match(OUT_DIR_FLAG_PATTERN, args[i]) - if m: - out_dir_flag = m.group(1) - index = max(len(out_dir_flag), args[i].rfind(':')+1) - out_dir = args[i][index:] - if out_dir_orig: - assert out_dir_orig == out_dir, 'Output directories do not match: [{}] and [{}]'.format(out_dir_orig, out_dir) - else: - out_dir_orig = out_dir - out_dir_temp = tempfile.mkdtemp(dir=out_dir_orig) - args[i] = (args[i][:index] + out_dir_temp).replace('|', ',') - assert out_dir_temp is not None, 'Output directory is not specified' - - try: +from __future__ import absolute_import +import os +import re +import shutil +import subprocess +import sys +import tempfile +from six.moves import range + + +OUT_DIR_FLAG_PATTERN = re.compile(r'^(--go(([-_]\w+))*_out=)') + + +def move_tree(src_root, dst_root): + for root, _, files in os.walk(src_root): + rel_dir = os.path.relpath(root, src_root) + dst_dir = os.path.join(dst_root, rel_dir) + if not os.path.exists(dst_dir): + os.mkdir(dst_dir) + for file in files: + os.rename(os.path.join(root, file), os.path.join(dst_dir, file)) + + +def main(arcadia_prefix, contrib_prefix, proto_namespace, args): + out_dir_orig = None + out_dir_temp = None + for i in range(len(args)): + m = re.match(OUT_DIR_FLAG_PATTERN, args[i]) + if m: + out_dir_flag = m.group(1) + index = max(len(out_dir_flag), args[i].rfind(':')+1) + out_dir = args[i][index:] + if out_dir_orig: + assert out_dir_orig == out_dir, 'Output directories do not match: [{}] and [{}]'.format(out_dir_orig, out_dir) + else: + out_dir_orig = out_dir + out_dir_temp = tempfile.mkdtemp(dir=out_dir_orig) + args[i] = (args[i][:index] + out_dir_temp).replace('|', ',') + assert out_dir_temp is not None, 'Output directory is not specified' + + try: subprocess.check_output(args, stdin=None, stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - sys.stderr.write('{} returned non-zero exit code {}.\n{}\n'.format(' '.join(e.cmd), e.returncode, e.output)) - return e.returncode - - # All Arcadia GO projects should have 'a.yandex-team.ru/' namespace prefix. - # If the namespace doesn't start with 'a.yandex-team.ru/' prefix then this - # project is from vendor directory under the root of Arcadia. - out_dir_src = os.path.normpath(os.path.join(out_dir_temp, arcadia_prefix, proto_namespace)) - out_dir_dst = out_dir_orig - is_from_contrib = False - if not os.path.isdir(out_dir_src): - is_from_contrib = True - out_dir_src = out_dir_temp - out_dir_dst = os.path.join(out_dir_orig, contrib_prefix) - - if not os.path.exists(out_dir_src) or is_from_contrib: - protos = [x for x in args if x.endswith('.proto')] - if not is_from_contrib or not all(x.startswith(contrib_prefix) for x in protos): - proto_list = [] - option_re = re.compile(r'^\s*option\s+go_package\s*=\s*') - for arg in protos: - with open(arg, 'r') as f: - if not any([re.match(option_re, line) for line in f]): - proto_list.append(arg) - if proto_list: - sys.stderr.write( - '\nError: Option go_package is not specified in the following proto files: {}\n' - '\nNOTE! You can find detailed description of how to properly set go_package ' - 'option here https://wiki.yandex-team.ru/devrules/Go/#protobufigrpc'.format(', '.join(proto_list))) - return 1 - - move_tree(out_dir_src, out_dir_dst) - - shutil.rmtree(out_dir_temp) - - return 0 - - -if __name__ == '__main__': - sys.exit(main(os.path.normpath(sys.argv[1]), os.path.normpath(sys.argv[2]), os.path.normpath(sys.argv[3]), sys.argv[4:])) + except subprocess.CalledProcessError as e: + sys.stderr.write('{} returned non-zero exit code {}.\n{}\n'.format(' '.join(e.cmd), e.returncode, e.output)) + return e.returncode + + # All Arcadia GO projects should have 'a.yandex-team.ru/' namespace prefix. + # If the namespace doesn't start with 'a.yandex-team.ru/' prefix then this + # project is from vendor directory under the root of Arcadia. + out_dir_src = os.path.normpath(os.path.join(out_dir_temp, arcadia_prefix, proto_namespace)) + out_dir_dst = out_dir_orig + is_from_contrib = False + if not os.path.isdir(out_dir_src): + is_from_contrib = True + out_dir_src = out_dir_temp + out_dir_dst = os.path.join(out_dir_orig, contrib_prefix) + + if not os.path.exists(out_dir_src) or is_from_contrib: + protos = [x for x in args if x.endswith('.proto')] + if not is_from_contrib or not all(x.startswith(contrib_prefix) for x in protos): + proto_list = [] + option_re = re.compile(r'^\s*option\s+go_package\s*=\s*') + for arg in protos: + with open(arg, 'r') as f: + if not any([re.match(option_re, line) for line in f]): + proto_list.append(arg) + if proto_list: + sys.stderr.write( + '\nError: Option go_package is not specified in the following proto files: {}\n' + '\nNOTE! You can find detailed description of how to properly set go_package ' + 'option here https://wiki.yandex-team.ru/devrules/Go/#protobufigrpc'.format(', '.join(proto_list))) + return 1 + + move_tree(out_dir_src, out_dir_dst) + + shutil.rmtree(out_dir_temp) + + return 0 + + +if __name__ == '__main__': + sys.exit(main(os.path.normpath(sys.argv[1]), os.path.normpath(sys.argv[2]), os.path.normpath(sys.argv[3]), sys.argv[4:])) diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py index c1e98b20c0..49471d792e 100644 --- a/build/scripts/go_tool.py +++ b/build/scripts/go_tool.py @@ -1,864 +1,864 @@ -from __future__ import absolute_import, unicode_literals -import argparse -import copy -import json -import os -import re -import shutil -import subprocess -import sys -import tarfile -import tempfile -import threading -import six -from functools import reduce - +from __future__ import absolute_import, unicode_literals +import argparse +import copy +import json +import os +import re +import shutil +import subprocess +import sys +import tarfile +import tempfile +import threading +import six +from functools import reduce + import process_command_files as pcf import process_whole_archive_option as pwa -arc_project_prefix = 'a.yandex-team.ru/' -std_lib_prefix = 'contrib/go/_std/src/' -vendor_prefix = 'vendor/' -vet_info_ext = '.vet.out' -vet_report_ext = '.vet.txt' - -FIXED_CGO1_SUFFIX='.fixed.cgo1.go' - -COMPILE_OPTIMIZATION_FLAGS=('-N',) - - -def get_trimpath_args(args): - return ['-trimpath', args.trimpath] if args.trimpath else [] - - -def preprocess_cgo1(src_path, dst_path, source_root): - with open(src_path, 'r') as f: - content = f.read() - content = content.replace('__ARCADIA_SOURCE_ROOT_PREFIX__', source_root) - with open(dst_path, 'w') as f: - f.write(content) - - -def preprocess_args(args): - # Temporary work around for noauto - if args.cgo_srcs and len(args.cgo_srcs) > 0: - cgo_srcs_set = set(args.cgo_srcs) - args.srcs = [x for x in args.srcs if x not in cgo_srcs_set] - - args.pkg_root = os.path.join(args.toolchain_root, 'pkg') - toolchain_tool_root = os.path.join(args.pkg_root, 'tool', '{}_{}'.format(args.host_os, args.host_arch)) - args.go_compile = os.path.join(toolchain_tool_root, 'compile') - args.go_cgo = os.path.join(toolchain_tool_root, 'cgo') - args.go_link = os.path.join(toolchain_tool_root, 'link') - args.go_asm = os.path.join(toolchain_tool_root, 'asm') - args.go_pack = os.path.join(toolchain_tool_root, 'pack') - args.go_vet = os.path.join(toolchain_tool_root, 'vet') if args.vet is True else args.vet - args.output = os.path.normpath(args.output) - args.vet_report_output = vet_report_output_name(args.output, args.vet_report_ext) - args.trimpath = None - if args.debug_root_map: - roots = {'build': args.build_root, 'source': args.source_root, 'tools': args.tools_root} - replaces = [] - for root in args.debug_root_map.split(';'): - src, dst = root.split('=', 1) - assert src in roots - replaces.append('{}=>{}'.format(roots[src], dst)) - del roots[src] - assert len(replaces) > 0 - args.trimpath = ';'.join(replaces) - args.build_root = os.path.normpath(args.build_root) - args.build_root_dir = args.build_root + os.path.sep - args.source_root = os.path.normpath(args.source_root) - args.source_root_dir = args.source_root + os.path.sep - args.output_root = os.path.normpath(args.output_root) - args.import_map = {} - args.module_map = {} - if args.cgo_peers: - args.cgo_peers = [x for x in args.cgo_peers if not x.endswith('.fake.pkg')] - - srcs = [] - for f in args.srcs: - if f.endswith('.gosrc'): - with tarfile.open(f, 'r') as tar: - srcs.extend(os.path.join(args.output_root, src) for src in tar.getnames()) - tar.extractall(path=args.output_root) - else: - srcs.append(f) - args.srcs = srcs - - assert args.mode == 'test' or args.test_srcs is None and args.xtest_srcs is None - # add lexical oreder by basename for go sources - args.srcs.sort(key=lambda x: os.path.basename(x)) - if args.test_srcs: - args.srcs += sorted(args.test_srcs, key=lambda x: os.path.basename(x)) - del args.test_srcs - if args.xtest_srcs: - args.xtest_srcs.sort(key=lambda x: os.path.basename(x)) - - # compute root relative module dir path - assert args.output is None or args.output_root == os.path.dirname(args.output) - assert args.output_root.startswith(args.build_root_dir) - args.module_path = args.output_root[len(args.build_root_dir):] - args.source_module_dir = os.path.join(args.source_root, args.test_import_path or args.module_path) + os.path.sep - assert len(args.module_path) > 0 - args.import_path, args.is_std = get_import_path(args.module_path) - - assert args.asmhdr is None or args.word == 'go' - - srcs = [] - for f in args.srcs: - if f.endswith(FIXED_CGO1_SUFFIX) and f.startswith(args.build_root_dir): - path = os.path.join(args.output_root, '{}.cgo1.go'.format(os.path.basename(f[:-len(FIXED_CGO1_SUFFIX)]))) - srcs.append(path) - preprocess_cgo1(f, path, args.source_root) - else: - srcs.append(f) - args.srcs = srcs - +arc_project_prefix = 'a.yandex-team.ru/' +std_lib_prefix = 'contrib/go/_std/src/' +vendor_prefix = 'vendor/' +vet_info_ext = '.vet.out' +vet_report_ext = '.vet.txt' + +FIXED_CGO1_SUFFIX='.fixed.cgo1.go' + +COMPILE_OPTIMIZATION_FLAGS=('-N',) + + +def get_trimpath_args(args): + return ['-trimpath', args.trimpath] if args.trimpath else [] + + +def preprocess_cgo1(src_path, dst_path, source_root): + with open(src_path, 'r') as f: + content = f.read() + content = content.replace('__ARCADIA_SOURCE_ROOT_PREFIX__', source_root) + with open(dst_path, 'w') as f: + f.write(content) + + +def preprocess_args(args): + # Temporary work around for noauto + if args.cgo_srcs and len(args.cgo_srcs) > 0: + cgo_srcs_set = set(args.cgo_srcs) + args.srcs = [x for x in args.srcs if x not in cgo_srcs_set] + + args.pkg_root = os.path.join(args.toolchain_root, 'pkg') + toolchain_tool_root = os.path.join(args.pkg_root, 'tool', '{}_{}'.format(args.host_os, args.host_arch)) + args.go_compile = os.path.join(toolchain_tool_root, 'compile') + args.go_cgo = os.path.join(toolchain_tool_root, 'cgo') + args.go_link = os.path.join(toolchain_tool_root, 'link') + args.go_asm = os.path.join(toolchain_tool_root, 'asm') + args.go_pack = os.path.join(toolchain_tool_root, 'pack') + args.go_vet = os.path.join(toolchain_tool_root, 'vet') if args.vet is True else args.vet + args.output = os.path.normpath(args.output) + args.vet_report_output = vet_report_output_name(args.output, args.vet_report_ext) + args.trimpath = None + if args.debug_root_map: + roots = {'build': args.build_root, 'source': args.source_root, 'tools': args.tools_root} + replaces = [] + for root in args.debug_root_map.split(';'): + src, dst = root.split('=', 1) + assert src in roots + replaces.append('{}=>{}'.format(roots[src], dst)) + del roots[src] + assert len(replaces) > 0 + args.trimpath = ';'.join(replaces) + args.build_root = os.path.normpath(args.build_root) + args.build_root_dir = args.build_root + os.path.sep + args.source_root = os.path.normpath(args.source_root) + args.source_root_dir = args.source_root + os.path.sep + args.output_root = os.path.normpath(args.output_root) + args.import_map = {} + args.module_map = {} + if args.cgo_peers: + args.cgo_peers = [x for x in args.cgo_peers if not x.endswith('.fake.pkg')] + + srcs = [] + for f in args.srcs: + if f.endswith('.gosrc'): + with tarfile.open(f, 'r') as tar: + srcs.extend(os.path.join(args.output_root, src) for src in tar.getnames()) + tar.extractall(path=args.output_root) + else: + srcs.append(f) + args.srcs = srcs + + assert args.mode == 'test' or args.test_srcs is None and args.xtest_srcs is None + # add lexical oreder by basename for go sources + args.srcs.sort(key=lambda x: os.path.basename(x)) + if args.test_srcs: + args.srcs += sorted(args.test_srcs, key=lambda x: os.path.basename(x)) + del args.test_srcs + if args.xtest_srcs: + args.xtest_srcs.sort(key=lambda x: os.path.basename(x)) + + # compute root relative module dir path + assert args.output is None or args.output_root == os.path.dirname(args.output) + assert args.output_root.startswith(args.build_root_dir) + args.module_path = args.output_root[len(args.build_root_dir):] + args.source_module_dir = os.path.join(args.source_root, args.test_import_path or args.module_path) + os.path.sep + assert len(args.module_path) > 0 + args.import_path, args.is_std = get_import_path(args.module_path) + + assert args.asmhdr is None or args.word == 'go' + + srcs = [] + for f in args.srcs: + if f.endswith(FIXED_CGO1_SUFFIX) and f.startswith(args.build_root_dir): + path = os.path.join(args.output_root, '{}.cgo1.go'.format(os.path.basename(f[:-len(FIXED_CGO1_SUFFIX)]))) + srcs.append(path) + preprocess_cgo1(f, path, args.source_root) + else: + srcs.append(f) + args.srcs = srcs + if args.extldflags: args.extldflags = pwa.ProcessWholeArchiveOption(args.targ_os).construct_cmd(args.extldflags) - classify_srcs(args.srcs, args) - - -def compare_versions(version1, version2): - def last_index(version): - index = version.find('beta') - return len(version) if index < 0 else index - - v1 = tuple(x.zfill(8) for x in version1[:last_index(version1)].split('.')) - v2 = tuple(x.zfill(8) for x in version2[:last_index(version2)].split('.')) - if v1 == v2: - return 0 - return 1 if v1 < v2 else -1 - - -def get_symlink_or_copyfile(): - os_symlink = getattr(os, 'symlink', None) - if os_symlink is None: - os_symlink = shutil.copyfile - return os_symlink - - -def copy_args(args): - return copy.copy(args) - - -def get_vendor_index(import_path): - index = import_path.rfind('/' + vendor_prefix) - if index < 0: - index = 0 if import_path.startswith(vendor_prefix) else index - else: - index = index + 1 - return index - - -def get_import_path(module_path): - assert len(module_path) > 0 - import_path = module_path.replace('\\', '/') - is_std_module = import_path.startswith(std_lib_prefix) - if is_std_module: - import_path = import_path[len(std_lib_prefix):] - elif import_path.startswith(vendor_prefix): - import_path = import_path[len(vendor_prefix):] - else: - import_path = arc_project_prefix + import_path - assert len(import_path) > 0 - return import_path, is_std_module - - -def call(cmd, cwd, env=None): - # sys.stderr.write('{}\n'.format(' '.join(cmd))) - return subprocess.check_output(cmd, stdin=None, stderr=subprocess.STDOUT, cwd=cwd, env=env) - - -def classify_srcs(srcs, args): - args.go_srcs = [x for x in srcs if x.endswith('.go')] - args.asm_srcs = [x for x in srcs if x.endswith('.s')] - args.objects = [x for x in srcs if x.endswith('.o') or x.endswith('.obj')] - args.symabis = [x for x in srcs if x.endswith('.symabis')] - args.sysos = [x for x in srcs if x.endswith('.syso')] - - -def get_import_config_info(peers, gen_importmap, import_map={}, module_map={}): - info = {'importmap': [], 'packagefile': [], 'standard': {}} - if gen_importmap: - for key, value in six.iteritems(import_map): - info['importmap'].append((key, value)) - for peer in peers: - peer_import_path, is_std = get_import_path(os.path.dirname(peer)) - if gen_importmap: - index = get_vendor_index(peer_import_path) - if index >= 0: - index += len(vendor_prefix) - info['importmap'].append((peer_import_path[index:], peer_import_path)) - info['packagefile'].append((peer_import_path, os.path.join(args.build_root, peer))) - if is_std: - info['standard'][peer_import_path] = True - for key, value in six.iteritems(module_map): - info['packagefile'].append((key, value)) - return info - - -def create_import_config(peers, gen_importmap, import_map={}, module_map={}): - lines = [] - info = get_import_config_info(peers, gen_importmap, import_map, module_map) - for key in ('importmap', 'packagefile'): - for item in info[key]: - lines.append('{} {}={}'.format(key, *item)) - if len(lines) > 0: - lines.append('') - content = '\n'.join(lines) - # sys.stderr.writelines('{}\n'.format(l) for l in lines) - with tempfile.NamedTemporaryFile(delete=False) as f: - f.write(content.encode('UTF-8')) - return f.name - return None - - -def create_embed_config(args): - data = { - 'Patterns': {}, - 'Files': {}, - } - for info in args.embed: - pattern = info[0] - if pattern.endswith('/**/*'): - pattern = pattern[:-3] - files = {os.path.relpath(f, args.source_module_dir).replace('\\', '/'): f for f in info[1:]} - data['Patterns'][pattern] = list(files.keys()) - data['Files'].update(files) - # sys.stderr.write('{}\n'.format(json.dumps(data, indent=4))) - with tempfile.NamedTemporaryFile(delete=False, suffix='.embedcfg') as f: - f.write(json.dumps(data).encode('UTF-8')) - return f.name - - -def vet_info_output_name(path, ext=None): - return '{}{}'.format(path, ext or vet_info_ext) - - -def vet_report_output_name(path, ext=None): - return '{}{}'.format(path, ext or vet_report_ext) - - -def get_source_path(args): - return args.test_import_path or args.module_path - - -def gen_vet_info(args): - import_path = args.real_import_path if hasattr(args, 'real_import_path') else args.import_path - info = get_import_config_info(args.peers, True, args.import_map, args.module_map) - - import_map = dict(info['importmap']) - # FIXME(snermolaev): it seems that adding import map for 'fake' package - # does't make any harm (it needs to be revised later) - import_map['unsafe'] = 'unsafe' - - for (key, _) in info['packagefile']: - if key not in import_map: - import_map[key] = key - - data = { - 'ID': import_path, - 'Compiler': 'gc', - 'Dir': os.path.join(args.source_root, get_source_path(args)), - 'ImportPath': import_path, - 'GoFiles': [x for x in args.go_srcs if x.endswith('.go')], - 'NonGoFiles': [x for x in args.go_srcs if not x.endswith('.go')], - 'ImportMap': import_map, - 'PackageFile': dict(info['packagefile']), - 'Standard': dict(info['standard']), - 'PackageVetx': dict((key, vet_info_output_name(value)) for key, value in info['packagefile']), - 'VetxOnly': False, - 'VetxOutput': vet_info_output_name(args.output), - 'SucceedOnTypecheckFailure': False - } - # sys.stderr.write('{}\n'.format(json.dumps(data, indent=4))) - return data - - -def create_vet_config(args, info): - with tempfile.NamedTemporaryFile(delete=False, suffix='.cfg') as f: - f.write(json.dumps(info).encode('UTF-8')) - return f.name - - -def decode_vet_report(json_report): - report = '' - if json_report: - try: - full_diags = json.JSONDecoder().decode(json_report.decode('UTF-8')) - except ValueError: - report = json_report - else: - messages = [] - for _, module_diags in six.iteritems(full_diags): - for _, type_diags in six.iteritems(module_diags): - for diag in type_diags: - messages.append('{}: {}'.format(diag['posn'], json.dumps(diag['message']))) - report = '\n'.join(messages) - - return report - - -def dump_vet_report(args, report): - if report: - report = report.replace(args.build_root, '$B') - report = report.replace(args.source_root, '$S') - with open(args.vet_report_output, 'w') as f: - f.write(report) - - -def read_vet_report(args): - assert args - report = '' - if os.path.exists(args.vet_report_output): - with open(args.vet_report_output, 'r') as f: - report += f.read() - return report - - -def dump_vet_report_for_tests(args, *test_args_list): - dump_vet_report(args, reduce(lambda x, y: x + read_vet_report(y), [_f for _f in test_args_list if _f], '')) - - -def do_vet(args): - assert args.vet - info = gen_vet_info(args) - vet_config = create_vet_config(args, info) - cmd = [args.go_vet, '-json'] - if args.vet_flags: - cmd.extend(args.vet_flags) - cmd.append(vet_config) - # sys.stderr.write('>>>> [{}]\n'.format(' '.join(cmd))) - p_vet = subprocess.Popen(cmd, stdin=None, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=args.source_root) - vet_out, vet_err = p_vet.communicate() - report = decode_vet_report(vet_out) if vet_out else '' - dump_vet_report(args, report) - if p_vet.returncode: - raise subprocess.CalledProcessError(returncode=p_vet.returncode, cmd=cmd, output=vet_err) - - -def _do_compile_go(args): - import_path, is_std_module = args.import_path, args.is_std - cmd = [ - args.go_compile, - '-o', - args.output, - '-p', - import_path, - '-D', - '""', - '-goversion', - 'go{}'.format(args.goversion) - ] - cmd.extend(get_trimpath_args(args)) - compiling_runtime = False - if is_std_module: - cmd.append('-std') - if import_path in ('runtime', 'internal/abi', 'internal/bytealg', 'internal/cpu') or import_path.startswith('runtime/internal/'): - cmd.append('-+') - compiling_runtime = True - import_config_name = create_import_config(args.peers, True, args.import_map, args.module_map) - if import_config_name: - cmd += ['-importcfg', import_config_name] - else: - if import_path == 'unsafe' or len(args.objects) > 0 or args.asmhdr: - pass - else: - cmd.append('-complete') - # if compare_versions('1.16', args.goversion) >= 0: - if args.embed: - embed_config_name = create_embed_config(args) - cmd.extend(['-embedcfg', embed_config_name]) - if args.asmhdr: - cmd += ['-asmhdr', args.asmhdr] - # Use .symabis (starting from 1.12 version) - if args.symabis: - cmd += ['-symabis'] + args.symabis - # If 1.12 <= version < 1.13 we have to pass -allabis for 'runtime' and 'runtime/internal/atomic' - # if compare_versions('1.13', args.goversion) >= 0: - # pass - # elif import_path in ('runtime', 'runtime/internal/atomic'): - # cmd.append('-allabis') - compile_workers = '4' - if args.compile_flags: - if compiling_runtime: - cmd.extend(x for x in args.compile_flags if x not in COMPILE_OPTIMIZATION_FLAGS) - else: - cmd.extend(args.compile_flags) - if any([x in ('-race', '-shared') for x in args.compile_flags]): - compile_workers = '1' - cmd += ['-pack', '-c={}'.format(compile_workers)] - cmd += args.go_srcs - call(cmd, args.build_root) - - -class VetThread(threading.Thread): - - def __init__(self, target, args): - super(VetThread, self).__init__(target=target, args=args) - self.exc_info = None - - def run(self): - try: - super(VetThread, self).run() - except: - self.exc_info = sys.exc_info() - - def join_with_exception(self, reraise_exception): - self.join() - if reraise_exception and self.exc_info: - six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2]) - - -def do_compile_go(args): - raise_exception_from_vet = False - if args.vet: - run_vet = VetThread(target=do_vet, args=(args,)) - run_vet.start() - try: - _do_compile_go(args) - raise_exception_from_vet = True - finally: - if args.vet: - run_vet.join_with_exception(raise_exception_from_vet) - - -def do_compile_asm(args): - def need_compiling_runtime(import_path): - return import_path in ('runtime', 'reflect', 'syscall') or \ - import_path.startswith('runtime/internal/') or \ - compare_versions('1.17', args.goversion) >= 0 and import_path == 'internal/bytealg' - - assert(len(args.srcs) == 1 and len(args.asm_srcs) == 1) - cmd = [args.go_asm] - cmd += get_trimpath_args(args) - cmd += ['-I', args.output_root, '-I', os.path.join(args.pkg_root, 'include')] - cmd += ['-D', 'GOOS_' + args.targ_os, '-D', 'GOARCH_' + args.targ_arch, '-o', args.output] - - # if compare_versions('1.16', args.goversion) >= 0: - cmd += ['-p', args.import_path] - if need_compiling_runtime(args.import_path): - cmd += ['-compiling-runtime'] - - if args.asm_flags: - cmd += args.asm_flags - cmd += args.asm_srcs - call(cmd, args.build_root) - - -def do_link_lib(args): - if len(args.asm_srcs) > 0: - asmargs = copy_args(args) - asmargs.asmhdr = os.path.join(asmargs.output_root, 'go_asm.h') - do_compile_go(asmargs) - for src in asmargs.asm_srcs: - asmargs.srcs = [src] - asmargs.asm_srcs = [src] - asmargs.output = os.path.join(asmargs.output_root, os.path.basename(src) + '.o') - do_compile_asm(asmargs) - args.objects.append(asmargs.output) - else: - do_compile_go(args) - if args.objects or args.sysos: - cmd = [args.go_pack, 'r', args.output] + args.objects + args.sysos - call(cmd, args.build_root) - - -def do_link_exe(args): - assert args.extld is not None - assert args.non_local_peers is not None - compile_args = copy_args(args) - compile_args.output = os.path.join(args.output_root, 'main.a') - compile_args.real_import_path = compile_args.import_path - compile_args.import_path = 'main' + classify_srcs(args.srcs, args) + + +def compare_versions(version1, version2): + def last_index(version): + index = version.find('beta') + return len(version) if index < 0 else index + + v1 = tuple(x.zfill(8) for x in version1[:last_index(version1)].split('.')) + v2 = tuple(x.zfill(8) for x in version2[:last_index(version2)].split('.')) + if v1 == v2: + return 0 + return 1 if v1 < v2 else -1 + + +def get_symlink_or_copyfile(): + os_symlink = getattr(os, 'symlink', None) + if os_symlink is None: + os_symlink = shutil.copyfile + return os_symlink + + +def copy_args(args): + return copy.copy(args) + + +def get_vendor_index(import_path): + index = import_path.rfind('/' + vendor_prefix) + if index < 0: + index = 0 if import_path.startswith(vendor_prefix) else index + else: + index = index + 1 + return index + + +def get_import_path(module_path): + assert len(module_path) > 0 + import_path = module_path.replace('\\', '/') + is_std_module = import_path.startswith(std_lib_prefix) + if is_std_module: + import_path = import_path[len(std_lib_prefix):] + elif import_path.startswith(vendor_prefix): + import_path = import_path[len(vendor_prefix):] + else: + import_path = arc_project_prefix + import_path + assert len(import_path) > 0 + return import_path, is_std_module + + +def call(cmd, cwd, env=None): + # sys.stderr.write('{}\n'.format(' '.join(cmd))) + return subprocess.check_output(cmd, stdin=None, stderr=subprocess.STDOUT, cwd=cwd, env=env) + + +def classify_srcs(srcs, args): + args.go_srcs = [x for x in srcs if x.endswith('.go')] + args.asm_srcs = [x for x in srcs if x.endswith('.s')] + args.objects = [x for x in srcs if x.endswith('.o') or x.endswith('.obj')] + args.symabis = [x for x in srcs if x.endswith('.symabis')] + args.sysos = [x for x in srcs if x.endswith('.syso')] + + +def get_import_config_info(peers, gen_importmap, import_map={}, module_map={}): + info = {'importmap': [], 'packagefile': [], 'standard': {}} + if gen_importmap: + for key, value in six.iteritems(import_map): + info['importmap'].append((key, value)) + for peer in peers: + peer_import_path, is_std = get_import_path(os.path.dirname(peer)) + if gen_importmap: + index = get_vendor_index(peer_import_path) + if index >= 0: + index += len(vendor_prefix) + info['importmap'].append((peer_import_path[index:], peer_import_path)) + info['packagefile'].append((peer_import_path, os.path.join(args.build_root, peer))) + if is_std: + info['standard'][peer_import_path] = True + for key, value in six.iteritems(module_map): + info['packagefile'].append((key, value)) + return info + + +def create_import_config(peers, gen_importmap, import_map={}, module_map={}): + lines = [] + info = get_import_config_info(peers, gen_importmap, import_map, module_map) + for key in ('importmap', 'packagefile'): + for item in info[key]: + lines.append('{} {}={}'.format(key, *item)) + if len(lines) > 0: + lines.append('') + content = '\n'.join(lines) + # sys.stderr.writelines('{}\n'.format(l) for l in lines) + with tempfile.NamedTemporaryFile(delete=False) as f: + f.write(content.encode('UTF-8')) + return f.name + return None + + +def create_embed_config(args): + data = { + 'Patterns': {}, + 'Files': {}, + } + for info in args.embed: + pattern = info[0] + if pattern.endswith('/**/*'): + pattern = pattern[:-3] + files = {os.path.relpath(f, args.source_module_dir).replace('\\', '/'): f for f in info[1:]} + data['Patterns'][pattern] = list(files.keys()) + data['Files'].update(files) + # sys.stderr.write('{}\n'.format(json.dumps(data, indent=4))) + with tempfile.NamedTemporaryFile(delete=False, suffix='.embedcfg') as f: + f.write(json.dumps(data).encode('UTF-8')) + return f.name + + +def vet_info_output_name(path, ext=None): + return '{}{}'.format(path, ext or vet_info_ext) + + +def vet_report_output_name(path, ext=None): + return '{}{}'.format(path, ext or vet_report_ext) + + +def get_source_path(args): + return args.test_import_path or args.module_path + + +def gen_vet_info(args): + import_path = args.real_import_path if hasattr(args, 'real_import_path') else args.import_path + info = get_import_config_info(args.peers, True, args.import_map, args.module_map) + + import_map = dict(info['importmap']) + # FIXME(snermolaev): it seems that adding import map for 'fake' package + # does't make any harm (it needs to be revised later) + import_map['unsafe'] = 'unsafe' + + for (key, _) in info['packagefile']: + if key not in import_map: + import_map[key] = key + + data = { + 'ID': import_path, + 'Compiler': 'gc', + 'Dir': os.path.join(args.source_root, get_source_path(args)), + 'ImportPath': import_path, + 'GoFiles': [x for x in args.go_srcs if x.endswith('.go')], + 'NonGoFiles': [x for x in args.go_srcs if not x.endswith('.go')], + 'ImportMap': import_map, + 'PackageFile': dict(info['packagefile']), + 'Standard': dict(info['standard']), + 'PackageVetx': dict((key, vet_info_output_name(value)) for key, value in info['packagefile']), + 'VetxOnly': False, + 'VetxOutput': vet_info_output_name(args.output), + 'SucceedOnTypecheckFailure': False + } + # sys.stderr.write('{}\n'.format(json.dumps(data, indent=4))) + return data + + +def create_vet_config(args, info): + with tempfile.NamedTemporaryFile(delete=False, suffix='.cfg') as f: + f.write(json.dumps(info).encode('UTF-8')) + return f.name + + +def decode_vet_report(json_report): + report = '' + if json_report: + try: + full_diags = json.JSONDecoder().decode(json_report.decode('UTF-8')) + except ValueError: + report = json_report + else: + messages = [] + for _, module_diags in six.iteritems(full_diags): + for _, type_diags in six.iteritems(module_diags): + for diag in type_diags: + messages.append('{}: {}'.format(diag['posn'], json.dumps(diag['message']))) + report = '\n'.join(messages) + + return report + + +def dump_vet_report(args, report): + if report: + report = report.replace(args.build_root, '$B') + report = report.replace(args.source_root, '$S') + with open(args.vet_report_output, 'w') as f: + f.write(report) + + +def read_vet_report(args): + assert args + report = '' + if os.path.exists(args.vet_report_output): + with open(args.vet_report_output, 'r') as f: + report += f.read() + return report + + +def dump_vet_report_for_tests(args, *test_args_list): + dump_vet_report(args, reduce(lambda x, y: x + read_vet_report(y), [_f for _f in test_args_list if _f], '')) + + +def do_vet(args): + assert args.vet + info = gen_vet_info(args) + vet_config = create_vet_config(args, info) + cmd = [args.go_vet, '-json'] + if args.vet_flags: + cmd.extend(args.vet_flags) + cmd.append(vet_config) + # sys.stderr.write('>>>> [{}]\n'.format(' '.join(cmd))) + p_vet = subprocess.Popen(cmd, stdin=None, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=args.source_root) + vet_out, vet_err = p_vet.communicate() + report = decode_vet_report(vet_out) if vet_out else '' + dump_vet_report(args, report) + if p_vet.returncode: + raise subprocess.CalledProcessError(returncode=p_vet.returncode, cmd=cmd, output=vet_err) + + +def _do_compile_go(args): + import_path, is_std_module = args.import_path, args.is_std + cmd = [ + args.go_compile, + '-o', + args.output, + '-p', + import_path, + '-D', + '""', + '-goversion', + 'go{}'.format(args.goversion) + ] + cmd.extend(get_trimpath_args(args)) + compiling_runtime = False + if is_std_module: + cmd.append('-std') + if import_path in ('runtime', 'internal/abi', 'internal/bytealg', 'internal/cpu') or import_path.startswith('runtime/internal/'): + cmd.append('-+') + compiling_runtime = True + import_config_name = create_import_config(args.peers, True, args.import_map, args.module_map) + if import_config_name: + cmd += ['-importcfg', import_config_name] + else: + if import_path == 'unsafe' or len(args.objects) > 0 or args.asmhdr: + pass + else: + cmd.append('-complete') + # if compare_versions('1.16', args.goversion) >= 0: + if args.embed: + embed_config_name = create_embed_config(args) + cmd.extend(['-embedcfg', embed_config_name]) + if args.asmhdr: + cmd += ['-asmhdr', args.asmhdr] + # Use .symabis (starting from 1.12 version) + if args.symabis: + cmd += ['-symabis'] + args.symabis + # If 1.12 <= version < 1.13 we have to pass -allabis for 'runtime' and 'runtime/internal/atomic' + # if compare_versions('1.13', args.goversion) >= 0: + # pass + # elif import_path in ('runtime', 'runtime/internal/atomic'): + # cmd.append('-allabis') + compile_workers = '4' + if args.compile_flags: + if compiling_runtime: + cmd.extend(x for x in args.compile_flags if x not in COMPILE_OPTIMIZATION_FLAGS) + else: + cmd.extend(args.compile_flags) + if any([x in ('-race', '-shared') for x in args.compile_flags]): + compile_workers = '1' + cmd += ['-pack', '-c={}'.format(compile_workers)] + cmd += args.go_srcs + call(cmd, args.build_root) + + +class VetThread(threading.Thread): + + def __init__(self, target, args): + super(VetThread, self).__init__(target=target, args=args) + self.exc_info = None + + def run(self): + try: + super(VetThread, self).run() + except: + self.exc_info = sys.exc_info() + + def join_with_exception(self, reraise_exception): + self.join() + if reraise_exception and self.exc_info: + six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2]) + + +def do_compile_go(args): + raise_exception_from_vet = False + if args.vet: + run_vet = VetThread(target=do_vet, args=(args,)) + run_vet.start() + try: + _do_compile_go(args) + raise_exception_from_vet = True + finally: + if args.vet: + run_vet.join_with_exception(raise_exception_from_vet) + + +def do_compile_asm(args): + def need_compiling_runtime(import_path): + return import_path in ('runtime', 'reflect', 'syscall') or \ + import_path.startswith('runtime/internal/') or \ + compare_versions('1.17', args.goversion) >= 0 and import_path == 'internal/bytealg' + + assert(len(args.srcs) == 1 and len(args.asm_srcs) == 1) + cmd = [args.go_asm] + cmd += get_trimpath_args(args) + cmd += ['-I', args.output_root, '-I', os.path.join(args.pkg_root, 'include')] + cmd += ['-D', 'GOOS_' + args.targ_os, '-D', 'GOARCH_' + args.targ_arch, '-o', args.output] + + # if compare_versions('1.16', args.goversion) >= 0: + cmd += ['-p', args.import_path] + if need_compiling_runtime(args.import_path): + cmd += ['-compiling-runtime'] + + if args.asm_flags: + cmd += args.asm_flags + cmd += args.asm_srcs + call(cmd, args.build_root) + + +def do_link_lib(args): + if len(args.asm_srcs) > 0: + asmargs = copy_args(args) + asmargs.asmhdr = os.path.join(asmargs.output_root, 'go_asm.h') + do_compile_go(asmargs) + for src in asmargs.asm_srcs: + asmargs.srcs = [src] + asmargs.asm_srcs = [src] + asmargs.output = os.path.join(asmargs.output_root, os.path.basename(src) + '.o') + do_compile_asm(asmargs) + args.objects.append(asmargs.output) + else: + do_compile_go(args) + if args.objects or args.sysos: + cmd = [args.go_pack, 'r', args.output] + args.objects + args.sysos + call(cmd, args.build_root) + + +def do_link_exe(args): + assert args.extld is not None + assert args.non_local_peers is not None + compile_args = copy_args(args) + compile_args.output = os.path.join(args.output_root, 'main.a') + compile_args.real_import_path = compile_args.import_path + compile_args.import_path = 'main' if args.vcs and os.path.isfile(compile_args.vcs): build_info = os.path.join('library', 'go', 'core', 'buildinfo') - if any([x.startswith(build_info) for x in compile_args.peers]): + if any([x.startswith(build_info) for x in compile_args.peers]): compile_args.go_srcs.append(compile_args.vcs) - do_link_lib(compile_args) - cmd = [args.go_link, '-o', args.output] - import_config_name = create_import_config(args.peers + args.non_local_peers, False, args.import_map, args.module_map) - if import_config_name: - cmd += ['-importcfg', import_config_name] - if args.link_flags: - cmd += args.link_flags - - if args.mode in ('exe', 'test'): - cmd.append('-buildmode=exe') - elif args.mode == 'dll': - cmd.append('-buildmode=c-shared') - else: - assert False, 'Unexpected mode: {}'.format(args.mode) - cmd.append('-extld={}'.format(args.extld)) - - extldflags = [] - if args.extldflags is not None: - filter_musl = bool - if args.musl: - cmd.append('-linkmode=external') - extldflags.append('-static') - filter_musl = lambda x: x not in ('-lc', '-ldl', '-lm', '-lpthread', '-lrt') - extldflags += [x for x in args.extldflags if filter_musl(x)] - cgo_peers = [] - if args.cgo_peers is not None and len(args.cgo_peers) > 0: - is_group = args.targ_os == 'linux' - if is_group: - cgo_peers.append('-Wl,--start-group') - cgo_peers.extend(args.cgo_peers) - if is_group: - cgo_peers.append('-Wl,--end-group') - try: - index = extldflags.index('--cgo-peers') - extldflags = extldflags[:index] + cgo_peers + extldflags[index+1:] - except ValueError: - extldflags.extend(cgo_peers) - if len(extldflags) > 0: - cmd.append('-extldflags={}'.format(' '.join(extldflags))) - cmd.append(compile_args.output) - call(cmd, args.build_root) - - -def gen_cover_info(args): - lines = [] - lines.extend([ - """ -var ( - coverCounters = make(map[string][]uint32) - coverBlocks = make(map[string][]testing.CoverBlock) -) - """, - 'func init() {', - ]) - for var, file in (x.split(':') for x in args.cover_info): - lines.append(' coverRegisterFile("{file}", _cover0.{var}.Count[:], _cover0.{var}.Pos[:], _cover0.{var}.NumStmt[:])'.format(file=file, var=var)) - lines.extend([ - '}', - """ -func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) { - if 3*len(counter) != len(pos) || len(counter) != len(numStmts) { - panic("coverage: mismatched sizes") - } - if coverCounters[fileName] != nil { - // Already registered. - return - } - coverCounters[fileName] = counter - block := make([]testing.CoverBlock, len(counter)) - for i := range counter { - block[i] = testing.CoverBlock{ - Line0: pos[3*i+0], - Col0: uint16(pos[3*i+2]), - Line1: pos[3*i+1], - Col1: uint16(pos[3*i+2]>>16), - Stmts: numStmts[i], - } - } - coverBlocks[fileName] = block -} - """, - ]) - return lines - - -def filter_out_skip_tests(tests, skip_tests): - skip_set = set() - star_skip_set = set() - for t in skip_tests: - work_set = star_skip_set if '*' in t else skip_set - work_set.add(t) - - re_star_tests = None - if len(star_skip_set) > 0: - re_star_tests = re.compile(re.sub(r'(\*)+', r'.\1', '^({})$'.format('|'.join(star_skip_set)))) - - return [x for x in tests if not (x in skip_tests or re_star_tests and re_star_tests.match(x))] - - -def gen_test_main(args, test_lib_args, xtest_lib_args): - assert args and (test_lib_args or xtest_lib_args) - test_miner = args.test_miner - test_module_path = test_lib_args.import_path if test_lib_args else xtest_lib_args.import_path - is_cover = args.cover_info and len(args.cover_info) > 0 - - # Prepare GOPATH - # $BINDIR - # |- __go__ - # |- src - # |- pkg - # |- ${TARGET_OS}_${TARGET_ARCH} - go_path_root = os.path.join(args.output_root, '__go__') - test_src_dir = os.path.join(go_path_root, 'src') - target_os_arch = '_'.join([args.targ_os, args.targ_arch]) - test_pkg_dir = os.path.join(go_path_root, 'pkg', target_os_arch, os.path.dirname(test_module_path)) - os.makedirs(test_pkg_dir) - - my_env = os.environ.copy() - my_env['GOROOT'] = '' - my_env['GOPATH'] = go_path_root - my_env['GOARCH'] = args.targ_arch - my_env['GOOS'] = args.targ_os - - tests = [] - xtests = [] - os_symlink = get_symlink_or_copyfile() - - # Get the list of "internal" tests - if test_lib_args: - os.makedirs(os.path.join(test_src_dir, test_module_path)) - os_symlink(test_lib_args.output, os.path.join(test_pkg_dir, os.path.basename(test_module_path) + '.a')) - cmd = [test_miner, '-benchmarks', '-tests', test_module_path] - tests = [x for x in (call(cmd, test_lib_args.output_root, my_env).decode('UTF-8') or '').strip().split('\n') if len(x) > 0] - if args.skip_tests: - tests = filter_out_skip_tests(tests, args.skip_tests) - test_main_found = '#TestMain' in tests - - # Get the list of "external" tests - if xtest_lib_args: - xtest_module_path = xtest_lib_args.import_path - os.makedirs(os.path.join(test_src_dir, xtest_module_path)) - os_symlink(xtest_lib_args.output, os.path.join(test_pkg_dir, os.path.basename(xtest_module_path) + '.a')) - cmd = [test_miner, '-benchmarks', '-tests', xtest_module_path] - xtests = [x for x in (call(cmd, xtest_lib_args.output_root, my_env).decode('UTF-8') or '').strip().split('\n') if len(x) > 0] - if args.skip_tests: - xtests = filter_out_skip_tests(xtests, args.skip_tests) - xtest_main_found = '#TestMain' in xtests - - test_main_package = None - if test_main_found and xtest_main_found: - assert False, 'multiple definition of TestMain' - elif test_main_found: - test_main_package = '_test' - elif xtest_main_found: - test_main_package = '_xtest' - - shutil.rmtree(go_path_root) - - lines = ['package main', '', 'import ('] - if test_main_package is None: - lines.append(' "os"') - lines.extend([' "testing"', ' "testing/internal/testdeps"']) - - if len(tests) > 0: - lines.append(' _test "{}"'.format(test_module_path)) - elif test_lib_args: - lines.append(' _ "{}"'.format(test_module_path)) - - if len(xtests) > 0: - lines.append(' _xtest "{}"'.format(xtest_module_path)) - elif xtest_lib_args: - lines.append(' _ "{}"'.format(xtest_module_path)) - - if is_cover: - lines.append(' _cover0 "{}"'.format(test_module_path)) - lines.extend([')', '']) - - if compare_versions('1.18', args.goversion) < 0: - kinds = ['Test', 'Benchmark', 'Example'] - else: - kinds = ['Test', 'Benchmark', 'FuzzTarget', 'Example'] - - var_names = [] - for kind in kinds: - var_name = '{}s'.format(kind.lower()) - var_names.append(var_name) - lines.append('var {} = []testing.Internal{}{{'.format(var_name, kind)) - for test in [x for x in tests if x.startswith(kind)]: - lines.append(' {{"{test}", _test.{test}}},'.format(test=test)) - for test in [x for x in xtests if x.startswith(kind)]: - lines.append(' {{"{test}", _xtest.{test}}},'.format(test=test)) - lines.extend(['}', '']) - - if is_cover: - lines.extend(gen_cover_info(args)) - - lines.append('func main() {') - if is_cover: - lines.extend([ - ' testing.RegisterCover(testing.Cover{', - ' Mode: "set",', - ' Counters: coverCounters,', - ' Blocks: coverBlocks,', - ' CoveredPackages: "",', - ' })', - ]) - lines.extend([ - ' m := testing.MainStart(testdeps.TestDeps{{}}, {})'.format(', '.join(var_names)), - '', - ]) - - if test_main_package: - lines.append(' {}.TestMain(m)'.format(test_main_package)) - else: - lines.append(' os.Exit(m.Run())') - lines.extend(['}', '']) - - content = '\n'.join(lines) - # sys.stderr.write('{}\n'.format(content)) - return content - - -def do_link_test(args): - assert args.srcs or args.xtest_srcs - assert args.test_miner is not None - - test_module_path = get_source_path(args) - test_import_path, _ = get_import_path(test_module_path) - - test_lib_args = copy_args(args) if args.srcs else None - xtest_lib_args = copy_args(args) if args.xtest_srcs else None - if xtest_lib_args is not None: - xtest_lib_args.embed = args.embed_xtest if args.embed_xtest else None - - ydx_file_name = None - xtest_ydx_file_name = None - need_append_ydx = test_lib_args and xtest_lib_args and args.ydx_file and args.vet_flags - if need_append_ydx: - def find_ydx_file_name(name, flags): - for i, elem in enumerate(flags): - if elem.endswith(name): - return (i, elem) - assert False, 'Unreachable code' - - idx, ydx_file_name = find_ydx_file_name(xtest_lib_args.ydx_file, xtest_lib_args.vet_flags) - xtest_ydx_file_name = '{}_xtest'.format(ydx_file_name) - xtest_lib_args.vet_flags = copy.copy(xtest_lib_args.vet_flags) - xtest_lib_args.vet_flags[idx] = xtest_ydx_file_name - - if test_lib_args: - test_lib_args.output = os.path.join(args.output_root, 'test.a') - test_lib_args.vet_report_output = vet_report_output_name(test_lib_args.output) - test_lib_args.module_path = test_module_path - test_lib_args.import_path = test_import_path - do_link_lib(test_lib_args) - - if xtest_lib_args: - xtest_lib_args.srcs = xtest_lib_args.xtest_srcs - classify_srcs(xtest_lib_args.srcs, xtest_lib_args) - xtest_lib_args.output = os.path.join(args.output_root, 'xtest.a') - xtest_lib_args.vet_report_output = vet_report_output_name(xtest_lib_args.output) - xtest_lib_args.module_path = test_module_path + '_test' - xtest_lib_args.import_path = test_import_path + '_test' - if test_lib_args: - xtest_lib_args.module_map[test_import_path] = test_lib_args.output - need_append_ydx = args.ydx_file and args.srcs and args.vet_flags - do_link_lib(xtest_lib_args) - - if need_append_ydx: - with open(os.path.join(args.build_root, ydx_file_name), 'ab') as dst_file: - with open(os.path.join(args.build_root, xtest_ydx_file_name), 'rb') as src_file: - dst_file.write(src_file.read()) - - test_main_content = gen_test_main(args, test_lib_args, xtest_lib_args) - test_main_name = os.path.join(args.output_root, '_test_main.go') - with open(test_main_name, "w") as f: - f.write(test_main_content) - test_args = copy_args(args) - test_args.embed = None - test_args.srcs = [test_main_name] - if test_args.test_import_path is None: - # it seems that we can do it unconditionally, but this kind - # of mangling doesn't really looks good to me and we leave it - # for pure GO_TEST module - test_args.module_path = test_args.module_path + '___test_main__' - test_args.import_path = test_args.import_path + '___test_main__' - classify_srcs(test_args.srcs, test_args) - if test_lib_args: - test_args.module_map[test_lib_args.import_path] = test_lib_args.output - if xtest_lib_args: - test_args.module_map[xtest_lib_args.import_path] = xtest_lib_args.output - - if args.vet: - dump_vet_report_for_tests(test_args, test_lib_args, xtest_lib_args) - test_args.vet = False - - do_link_exe(test_args) - - -if __name__ == '__main__': + do_link_lib(compile_args) + cmd = [args.go_link, '-o', args.output] + import_config_name = create_import_config(args.peers + args.non_local_peers, False, args.import_map, args.module_map) + if import_config_name: + cmd += ['-importcfg', import_config_name] + if args.link_flags: + cmd += args.link_flags + + if args.mode in ('exe', 'test'): + cmd.append('-buildmode=exe') + elif args.mode == 'dll': + cmd.append('-buildmode=c-shared') + else: + assert False, 'Unexpected mode: {}'.format(args.mode) + cmd.append('-extld={}'.format(args.extld)) + + extldflags = [] + if args.extldflags is not None: + filter_musl = bool + if args.musl: + cmd.append('-linkmode=external') + extldflags.append('-static') + filter_musl = lambda x: x not in ('-lc', '-ldl', '-lm', '-lpthread', '-lrt') + extldflags += [x for x in args.extldflags if filter_musl(x)] + cgo_peers = [] + if args.cgo_peers is not None and len(args.cgo_peers) > 0: + is_group = args.targ_os == 'linux' + if is_group: + cgo_peers.append('-Wl,--start-group') + cgo_peers.extend(args.cgo_peers) + if is_group: + cgo_peers.append('-Wl,--end-group') + try: + index = extldflags.index('--cgo-peers') + extldflags = extldflags[:index] + cgo_peers + extldflags[index+1:] + except ValueError: + extldflags.extend(cgo_peers) + if len(extldflags) > 0: + cmd.append('-extldflags={}'.format(' '.join(extldflags))) + cmd.append(compile_args.output) + call(cmd, args.build_root) + + +def gen_cover_info(args): + lines = [] + lines.extend([ + """ +var ( + coverCounters = make(map[string][]uint32) + coverBlocks = make(map[string][]testing.CoverBlock) +) + """, + 'func init() {', + ]) + for var, file in (x.split(':') for x in args.cover_info): + lines.append(' coverRegisterFile("{file}", _cover0.{var}.Count[:], _cover0.{var}.Pos[:], _cover0.{var}.NumStmt[:])'.format(file=file, var=var)) + lines.extend([ + '}', + """ +func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) { + if 3*len(counter) != len(pos) || len(counter) != len(numStmts) { + panic("coverage: mismatched sizes") + } + if coverCounters[fileName] != nil { + // Already registered. + return + } + coverCounters[fileName] = counter + block := make([]testing.CoverBlock, len(counter)) + for i := range counter { + block[i] = testing.CoverBlock{ + Line0: pos[3*i+0], + Col0: uint16(pos[3*i+2]), + Line1: pos[3*i+1], + Col1: uint16(pos[3*i+2]>>16), + Stmts: numStmts[i], + } + } + coverBlocks[fileName] = block +} + """, + ]) + return lines + + +def filter_out_skip_tests(tests, skip_tests): + skip_set = set() + star_skip_set = set() + for t in skip_tests: + work_set = star_skip_set if '*' in t else skip_set + work_set.add(t) + + re_star_tests = None + if len(star_skip_set) > 0: + re_star_tests = re.compile(re.sub(r'(\*)+', r'.\1', '^({})$'.format('|'.join(star_skip_set)))) + + return [x for x in tests if not (x in skip_tests or re_star_tests and re_star_tests.match(x))] + + +def gen_test_main(args, test_lib_args, xtest_lib_args): + assert args and (test_lib_args or xtest_lib_args) + test_miner = args.test_miner + test_module_path = test_lib_args.import_path if test_lib_args else xtest_lib_args.import_path + is_cover = args.cover_info and len(args.cover_info) > 0 + + # Prepare GOPATH + # $BINDIR + # |- __go__ + # |- src + # |- pkg + # |- ${TARGET_OS}_${TARGET_ARCH} + go_path_root = os.path.join(args.output_root, '__go__') + test_src_dir = os.path.join(go_path_root, 'src') + target_os_arch = '_'.join([args.targ_os, args.targ_arch]) + test_pkg_dir = os.path.join(go_path_root, 'pkg', target_os_arch, os.path.dirname(test_module_path)) + os.makedirs(test_pkg_dir) + + my_env = os.environ.copy() + my_env['GOROOT'] = '' + my_env['GOPATH'] = go_path_root + my_env['GOARCH'] = args.targ_arch + my_env['GOOS'] = args.targ_os + + tests = [] + xtests = [] + os_symlink = get_symlink_or_copyfile() + + # Get the list of "internal" tests + if test_lib_args: + os.makedirs(os.path.join(test_src_dir, test_module_path)) + os_symlink(test_lib_args.output, os.path.join(test_pkg_dir, os.path.basename(test_module_path) + '.a')) + cmd = [test_miner, '-benchmarks', '-tests', test_module_path] + tests = [x for x in (call(cmd, test_lib_args.output_root, my_env).decode('UTF-8') or '').strip().split('\n') if len(x) > 0] + if args.skip_tests: + tests = filter_out_skip_tests(tests, args.skip_tests) + test_main_found = '#TestMain' in tests + + # Get the list of "external" tests + if xtest_lib_args: + xtest_module_path = xtest_lib_args.import_path + os.makedirs(os.path.join(test_src_dir, xtest_module_path)) + os_symlink(xtest_lib_args.output, os.path.join(test_pkg_dir, os.path.basename(xtest_module_path) + '.a')) + cmd = [test_miner, '-benchmarks', '-tests', xtest_module_path] + xtests = [x for x in (call(cmd, xtest_lib_args.output_root, my_env).decode('UTF-8') or '').strip().split('\n') if len(x) > 0] + if args.skip_tests: + xtests = filter_out_skip_tests(xtests, args.skip_tests) + xtest_main_found = '#TestMain' in xtests + + test_main_package = None + if test_main_found and xtest_main_found: + assert False, 'multiple definition of TestMain' + elif test_main_found: + test_main_package = '_test' + elif xtest_main_found: + test_main_package = '_xtest' + + shutil.rmtree(go_path_root) + + lines = ['package main', '', 'import ('] + if test_main_package is None: + lines.append(' "os"') + lines.extend([' "testing"', ' "testing/internal/testdeps"']) + + if len(tests) > 0: + lines.append(' _test "{}"'.format(test_module_path)) + elif test_lib_args: + lines.append(' _ "{}"'.format(test_module_path)) + + if len(xtests) > 0: + lines.append(' _xtest "{}"'.format(xtest_module_path)) + elif xtest_lib_args: + lines.append(' _ "{}"'.format(xtest_module_path)) + + if is_cover: + lines.append(' _cover0 "{}"'.format(test_module_path)) + lines.extend([')', '']) + + if compare_versions('1.18', args.goversion) < 0: + kinds = ['Test', 'Benchmark', 'Example'] + else: + kinds = ['Test', 'Benchmark', 'FuzzTarget', 'Example'] + + var_names = [] + for kind in kinds: + var_name = '{}s'.format(kind.lower()) + var_names.append(var_name) + lines.append('var {} = []testing.Internal{}{{'.format(var_name, kind)) + for test in [x for x in tests if x.startswith(kind)]: + lines.append(' {{"{test}", _test.{test}}},'.format(test=test)) + for test in [x for x in xtests if x.startswith(kind)]: + lines.append(' {{"{test}", _xtest.{test}}},'.format(test=test)) + lines.extend(['}', '']) + + if is_cover: + lines.extend(gen_cover_info(args)) + + lines.append('func main() {') + if is_cover: + lines.extend([ + ' testing.RegisterCover(testing.Cover{', + ' Mode: "set",', + ' Counters: coverCounters,', + ' Blocks: coverBlocks,', + ' CoveredPackages: "",', + ' })', + ]) + lines.extend([ + ' m := testing.MainStart(testdeps.TestDeps{{}}, {})'.format(', '.join(var_names)), + '', + ]) + + if test_main_package: + lines.append(' {}.TestMain(m)'.format(test_main_package)) + else: + lines.append(' os.Exit(m.Run())') + lines.extend(['}', '']) + + content = '\n'.join(lines) + # sys.stderr.write('{}\n'.format(content)) + return content + + +def do_link_test(args): + assert args.srcs or args.xtest_srcs + assert args.test_miner is not None + + test_module_path = get_source_path(args) + test_import_path, _ = get_import_path(test_module_path) + + test_lib_args = copy_args(args) if args.srcs else None + xtest_lib_args = copy_args(args) if args.xtest_srcs else None + if xtest_lib_args is not None: + xtest_lib_args.embed = args.embed_xtest if args.embed_xtest else None + + ydx_file_name = None + xtest_ydx_file_name = None + need_append_ydx = test_lib_args and xtest_lib_args and args.ydx_file and args.vet_flags + if need_append_ydx: + def find_ydx_file_name(name, flags): + for i, elem in enumerate(flags): + if elem.endswith(name): + return (i, elem) + assert False, 'Unreachable code' + + idx, ydx_file_name = find_ydx_file_name(xtest_lib_args.ydx_file, xtest_lib_args.vet_flags) + xtest_ydx_file_name = '{}_xtest'.format(ydx_file_name) + xtest_lib_args.vet_flags = copy.copy(xtest_lib_args.vet_flags) + xtest_lib_args.vet_flags[idx] = xtest_ydx_file_name + + if test_lib_args: + test_lib_args.output = os.path.join(args.output_root, 'test.a') + test_lib_args.vet_report_output = vet_report_output_name(test_lib_args.output) + test_lib_args.module_path = test_module_path + test_lib_args.import_path = test_import_path + do_link_lib(test_lib_args) + + if xtest_lib_args: + xtest_lib_args.srcs = xtest_lib_args.xtest_srcs + classify_srcs(xtest_lib_args.srcs, xtest_lib_args) + xtest_lib_args.output = os.path.join(args.output_root, 'xtest.a') + xtest_lib_args.vet_report_output = vet_report_output_name(xtest_lib_args.output) + xtest_lib_args.module_path = test_module_path + '_test' + xtest_lib_args.import_path = test_import_path + '_test' + if test_lib_args: + xtest_lib_args.module_map[test_import_path] = test_lib_args.output + need_append_ydx = args.ydx_file and args.srcs and args.vet_flags + do_link_lib(xtest_lib_args) + + if need_append_ydx: + with open(os.path.join(args.build_root, ydx_file_name), 'ab') as dst_file: + with open(os.path.join(args.build_root, xtest_ydx_file_name), 'rb') as src_file: + dst_file.write(src_file.read()) + + test_main_content = gen_test_main(args, test_lib_args, xtest_lib_args) + test_main_name = os.path.join(args.output_root, '_test_main.go') + with open(test_main_name, "w") as f: + f.write(test_main_content) + test_args = copy_args(args) + test_args.embed = None + test_args.srcs = [test_main_name] + if test_args.test_import_path is None: + # it seems that we can do it unconditionally, but this kind + # of mangling doesn't really looks good to me and we leave it + # for pure GO_TEST module + test_args.module_path = test_args.module_path + '___test_main__' + test_args.import_path = test_args.import_path + '___test_main__' + classify_srcs(test_args.srcs, test_args) + if test_lib_args: + test_args.module_map[test_lib_args.import_path] = test_lib_args.output + if xtest_lib_args: + test_args.module_map[xtest_lib_args.import_path] = xtest_lib_args.output + + if args.vet: + dump_vet_report_for_tests(test_args, test_lib_args, xtest_lib_args) + test_args.vet = False + + do_link_exe(test_args) + + +if __name__ == '__main__': args = pcf.get_args(sys.argv[1:]) - parser = argparse.ArgumentParser(prefix_chars='+') - parser.add_argument('++mode', choices=['dll', 'exe', 'lib', 'test'], required=True) - parser.add_argument('++srcs', nargs='*', required=True) - parser.add_argument('++cgo-srcs', nargs='*') - parser.add_argument('++test_srcs', nargs='*') - parser.add_argument('++xtest_srcs', nargs='*') - parser.add_argument('++cover_info', nargs='*') - parser.add_argument('++output', nargs='?', default=None) - parser.add_argument('++source-root', default=None) - parser.add_argument('++build-root', required=True) - parser.add_argument('++tools-root', default=None) - parser.add_argument('++output-root', required=True) - parser.add_argument('++toolchain-root', required=True) - parser.add_argument('++host-os', choices=['linux', 'darwin', 'windows'], required=True) + parser = argparse.ArgumentParser(prefix_chars='+') + parser.add_argument('++mode', choices=['dll', 'exe', 'lib', 'test'], required=True) + parser.add_argument('++srcs', nargs='*', required=True) + parser.add_argument('++cgo-srcs', nargs='*') + parser.add_argument('++test_srcs', nargs='*') + parser.add_argument('++xtest_srcs', nargs='*') + parser.add_argument('++cover_info', nargs='*') + parser.add_argument('++output', nargs='?', default=None) + parser.add_argument('++source-root', default=None) + parser.add_argument('++build-root', required=True) + parser.add_argument('++tools-root', default=None) + parser.add_argument('++output-root', required=True) + parser.add_argument('++toolchain-root', required=True) + parser.add_argument('++host-os', choices=['linux', 'darwin', 'windows'], required=True) parser.add_argument('++host-arch', choices=['amd64', 'arm64'], required=True) - parser.add_argument('++targ-os', choices=['linux', 'darwin', 'windows'], required=True) + parser.add_argument('++targ-os', choices=['linux', 'darwin', 'windows'], required=True) parser.add_argument('++targ-arch', choices=['amd64', 'x86', 'arm64'], required=True) - parser.add_argument('++peers', nargs='*') - parser.add_argument('++non-local-peers', nargs='*') - parser.add_argument('++cgo-peers', nargs='*') - parser.add_argument('++asmhdr', nargs='?', default=None) - parser.add_argument('++test-import-path', nargs='?') - parser.add_argument('++test-miner', nargs='?') - parser.add_argument('++arc-project-prefix', nargs='?', default=arc_project_prefix) - parser.add_argument('++std-lib-prefix', nargs='?', default=std_lib_prefix) - parser.add_argument('++vendor-prefix', nargs='?', default=vendor_prefix) - parser.add_argument('++extld', nargs='?', default=None) - parser.add_argument('++extldflags', nargs='+', default=None) - parser.add_argument('++goversion', required=True) - parser.add_argument('++asm-flags', nargs='*') - parser.add_argument('++compile-flags', nargs='*') - parser.add_argument('++link-flags', nargs='*') + parser.add_argument('++peers', nargs='*') + parser.add_argument('++non-local-peers', nargs='*') + parser.add_argument('++cgo-peers', nargs='*') + parser.add_argument('++asmhdr', nargs='?', default=None) + parser.add_argument('++test-import-path', nargs='?') + parser.add_argument('++test-miner', nargs='?') + parser.add_argument('++arc-project-prefix', nargs='?', default=arc_project_prefix) + parser.add_argument('++std-lib-prefix', nargs='?', default=std_lib_prefix) + parser.add_argument('++vendor-prefix', nargs='?', default=vendor_prefix) + parser.add_argument('++extld', nargs='?', default=None) + parser.add_argument('++extldflags', nargs='+', default=None) + parser.add_argument('++goversion', required=True) + parser.add_argument('++asm-flags', nargs='*') + parser.add_argument('++compile-flags', nargs='*') + parser.add_argument('++link-flags', nargs='*') parser.add_argument('++vcs', nargs='?', default=None) - parser.add_argument('++vet', nargs='?', const=True, default=False) - parser.add_argument('++vet-flags', nargs='*', default=None) - parser.add_argument('++vet-info-ext', default=vet_info_ext) - parser.add_argument('++vet-report-ext', default=vet_report_ext) - parser.add_argument('++musl', action='store_true') - parser.add_argument('++skip-tests', nargs='*', default=None) - parser.add_argument('++ydx-file', default='') - parser.add_argument('++debug-root-map', default=None) - parser.add_argument('++embed', action='append', nargs='*') - parser.add_argument('++embed_xtest', action='append', nargs='*') + parser.add_argument('++vet', nargs='?', const=True, default=False) + parser.add_argument('++vet-flags', nargs='*', default=None) + parser.add_argument('++vet-info-ext', default=vet_info_ext) + parser.add_argument('++vet-report-ext', default=vet_report_ext) + parser.add_argument('++musl', action='store_true') + parser.add_argument('++skip-tests', nargs='*', default=None) + parser.add_argument('++ydx-file', default='') + parser.add_argument('++debug-root-map', default=None) + parser.add_argument('++embed', action='append', nargs='*') + parser.add_argument('++embed_xtest', action='append', nargs='*') args = parser.parse_args(args) - - arc_project_prefix = args.arc_project_prefix - std_lib_prefix = args.std_lib_prefix - vendor_prefix = args.vendor_prefix - vet_info_ext = args.vet_info_ext - vet_report_ext = args.vet_report_ext - - preprocess_args(args) - - try: - os.unlink(args.output) - except OSError: - pass - - # We are going to support only 'lib', 'exe' and 'cgo' build modes currently - # and as a result we are going to generate only one build node per module - # (or program) - dispatch = { - 'exe': do_link_exe, - 'dll': do_link_exe, - 'lib': do_link_lib, - 'test': do_link_test - } - - exit_code = 1 - try: - dispatch[args.mode](args) - exit_code = 0 - except KeyError: - sys.stderr.write('Unknown build mode [{}]...\n'.format(args.mode)) - except subprocess.CalledProcessError as e: - sys.stderr.write('{} returned non-zero exit code {}.\n{}\n'.format(' '.join(e.cmd), e.returncode, e.output)) - exit_code = e.returncode - except Exception as e: - sys.stderr.write('Unhandled exception [{}]...\n'.format(str(e))) - sys.exit(exit_code) + + arc_project_prefix = args.arc_project_prefix + std_lib_prefix = args.std_lib_prefix + vendor_prefix = args.vendor_prefix + vet_info_ext = args.vet_info_ext + vet_report_ext = args.vet_report_ext + + preprocess_args(args) + + try: + os.unlink(args.output) + except OSError: + pass + + # We are going to support only 'lib', 'exe' and 'cgo' build modes currently + # and as a result we are going to generate only one build node per module + # (or program) + dispatch = { + 'exe': do_link_exe, + 'dll': do_link_exe, + 'lib': do_link_lib, + 'test': do_link_test + } + + exit_code = 1 + try: + dispatch[args.mode](args) + exit_code = 0 + except KeyError: + sys.stderr.write('Unknown build mode [{}]...\n'.format(args.mode)) + except subprocess.CalledProcessError as e: + sys.stderr.write('{} returned non-zero exit code {}.\n{}\n'.format(' '.join(e.cmd), e.returncode, e.output)) + exit_code = e.returncode + except Exception as e: + sys.stderr.write('Unhandled exception [{}]...\n'.format(str(e))) + sys.exit(exit_code) diff --git a/build/scripts/link_asrc.py b/build/scripts/link_asrc.py index eec5fe09a8..704075f554 100644 --- a/build/scripts/link_asrc.py +++ b/build/scripts/link_asrc.py @@ -1,84 +1,84 @@ -import argparse -import itertools -import os -import tarfile - - -DELIM_JAVA = '__DELIM_JAVA__' -DELIM_RES = '__DELIM_RES__' -DELIM_ASSETS = '__DELIM_ASSETS__' -DELIM_AIDL = '__DELIM_AIDL__' - -DELIMS = ( - DELIM_JAVA, - DELIM_RES, - DELIM_ASSETS, - DELIM_AIDL, -) - -DESTS = { - DELIM_JAVA: 'src', - DELIM_RES: 'res', - DELIM_ASSETS: 'assets', - DELIM_AIDL: 'aidl', -} - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--asrcs', nargs='*') - parser.add_argument('--input', nargs='*') - parser.add_argument('--jsrcs', nargs='*') - parser.add_argument('--output', required=True) - parser.add_argument('--work', required=True) - - return parser.parse_args() - - -def main(): - args = parse_args() - - files = [] - parts = [] - - if args.input and len(args.input) > 0: - for x in args.input: - if x in DELIMS: - assert(len(parts) == 0 or len(parts[-1]) > 1) - parts.append([x]) - else: - assert(len(parts) > 0) - parts[-1].append(x) - assert(len(parts[-1]) > 1) - - if args.jsrcs and len(args.jsrcs): - src_dir = os.path.join(args.work, DESTS[DELIM_JAVA]) - os.makedirs(src_dir) - - for jsrc in filter(lambda x: x.endswith('.jsrc'), args.jsrcs): - with tarfile.open(jsrc, 'r') as tar: - names = tar.getnames() - if names and len(names) > 0: - parts.append([DELIM_JAVA, src_dir]) - parts[-1].extend(itertools.imap(lambda x: os.path.join(src_dir, x), names)) - tar.extractall(path=src_dir) - - if args.asrcs and len(args.asrcs): - for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.asrcs): - with tarfile.open(asrc, 'r') as tar: - files.extend(tar.getnames()) - tar.extractall(path=args.work) - - with tarfile.open(args.output, 'w') as out: - for part in parts: - dest = DESTS[part[0]] - prefix = part[1] - for f in part[2:]: - out.add(f, arcname=os.path.join(dest, os.path.relpath(f, prefix))) - - for f in files: - out.add(os.path.join(args.work, f), arcname=f) - - -if __name__ == '__main__': - main() +import argparse +import itertools +import os +import tarfile + + +DELIM_JAVA = '__DELIM_JAVA__' +DELIM_RES = '__DELIM_RES__' +DELIM_ASSETS = '__DELIM_ASSETS__' +DELIM_AIDL = '__DELIM_AIDL__' + +DELIMS = ( + DELIM_JAVA, + DELIM_RES, + DELIM_ASSETS, + DELIM_AIDL, +) + +DESTS = { + DELIM_JAVA: 'src', + DELIM_RES: 'res', + DELIM_ASSETS: 'assets', + DELIM_AIDL: 'aidl', +} + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--asrcs', nargs='*') + parser.add_argument('--input', nargs='*') + parser.add_argument('--jsrcs', nargs='*') + parser.add_argument('--output', required=True) + parser.add_argument('--work', required=True) + + return parser.parse_args() + + +def main(): + args = parse_args() + + files = [] + parts = [] + + if args.input and len(args.input) > 0: + for x in args.input: + if x in DELIMS: + assert(len(parts) == 0 or len(parts[-1]) > 1) + parts.append([x]) + else: + assert(len(parts) > 0) + parts[-1].append(x) + assert(len(parts[-1]) > 1) + + if args.jsrcs and len(args.jsrcs): + src_dir = os.path.join(args.work, DESTS[DELIM_JAVA]) + os.makedirs(src_dir) + + for jsrc in filter(lambda x: x.endswith('.jsrc'), args.jsrcs): + with tarfile.open(jsrc, 'r') as tar: + names = tar.getnames() + if names and len(names) > 0: + parts.append([DELIM_JAVA, src_dir]) + parts[-1].extend(itertools.imap(lambda x: os.path.join(src_dir, x), names)) + tar.extractall(path=src_dir) + + if args.asrcs and len(args.asrcs): + for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.asrcs): + with tarfile.open(asrc, 'r') as tar: + files.extend(tar.getnames()) + tar.extractall(path=args.work) + + with tarfile.open(args.output, 'w') as out: + for part in parts: + dest = DESTS[part[0]] + prefix = part[1] + for f in part[2:]: + out.add(f, arcname=os.path.join(dest, os.path.relpath(f, prefix))) + + for f in files: + out.add(os.path.join(args.work, f), arcname=f) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/mkdocs_builder_wrapper.py b/build/scripts/mkdocs_builder_wrapper.py index 7e10dfac07..74e0690044 100644 --- a/build/scripts/mkdocs_builder_wrapper.py +++ b/build/scripts/mkdocs_builder_wrapper.py @@ -1,35 +1,35 @@ -import os -import subprocess -import sys - - -def main(): - cmd = [] - build_root = sys.argv[1] - length = len(build_root) - is_dep = False - for arg in sys.argv[2:]: - if is_dep: - is_dep = False - if not arg.endswith('.tar.gz'): - continue - basename = os.path.basename(arg) - assert arg.startswith(build_root) and len(arg) > length + len(basename) and arg[length] in ('/', '\\') - cmd.extend(['--dep', '{}:{}:{}'.format(build_root, os.path.dirname(arg[length+1:]), basename)]) - elif arg == '--dep': - is_dep = True - else: - cmd.append(arg) - assert not is_dep - p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - if p.returncode: - if out: - sys.stderr.write('stdout:\n{}\n'.format(out)) - if err: - sys.stderr.write('stderr:\n{}\n'.format(err)) - sys.exit(p.returncode) - - -if __name__ == '__main__': - main() +import os +import subprocess +import sys + + +def main(): + cmd = [] + build_root = sys.argv[1] + length = len(build_root) + is_dep = False + for arg in sys.argv[2:]: + if is_dep: + is_dep = False + if not arg.endswith('.tar.gz'): + continue + basename = os.path.basename(arg) + assert arg.startswith(build_root) and len(arg) > length + len(basename) and arg[length] in ('/', '\\') + cmd.extend(['--dep', '{}:{}:{}'.format(build_root, os.path.dirname(arg[length+1:]), basename)]) + elif arg == '--dep': + is_dep = True + else: + cmd.append(arg) + assert not is_dep + p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if p.returncode: + if out: + sys.stderr.write('stdout:\n{}\n'.format(out)) + if err: + sys.stderr.write('stderr:\n{}\n'.format(err)) + sys.exit(p.returncode) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/postprocess_go_fbs.py b/build/scripts/postprocess_go_fbs.py index 325fa07ea6..6a93c7a7ba 100644 --- a/build/scripts/postprocess_go_fbs.py +++ b/build/scripts/postprocess_go_fbs.py @@ -1,72 +1,72 @@ -import argparse -import re -import os - - -# very simple regexp to find go import statement in the source code -# NOTE! only one-line comments are somehow considered -IMPORT_DECL=re.compile(r''' - \bimport - ( - \s+((\.|\w+)\s+)?"[^"]+" ( \s+//[^\n]* )? - | \s* \( \s* ( ( \s+ ((\.|\w+)\s+)? "[^"]+" )? ( \s* //[^\n]* )? )* \s* \) - )''', re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--input-dir', required=True) - parser.add_argument('--map', nargs='*', default=None) - - return parser.parse_args() - - -def process_go_file(file_name, import_map): - content = '' - with open(file_name, 'r') as f: - content = f.read() - - start = -1 - end = -1 - for it in IMPORT_DECL.finditer(content): - if start < 0: - start = it.start() - end = it.end() - - if start < 0: - return - - imports = content[start:end] - for namespace, path in import_map.iteritems(): - ns = namespace.split('.') - name = '__'.join(ns) - import_path = '/'.join(ns) - imports = imports.replace('{} "{}"'.format(name, import_path), '{} "a.yandex-team.ru/{}"'.format(name, path)) - - if imports != content[start:end]: - with open(file_name, 'w') as f: - f.write(content[:start]) - f.write(imports) - f.write(content[end:]) - - -def main(): - args = parse_args() - - if not args.map: - return - - raw_import_map = sorted(set(args.map)) - import_map = dict(z.split('=', 1) for z in raw_import_map) - if len(raw_import_map) != len(import_map): - for k, v in (z.split('=', 1) for z in raw_import_map): - if v != import_map[k]: - raise Exception('import map [{}] contains different values for key [{}]: [{}] and [{}].'.format(args.map, k, v, import_map[k])) - - for root, _, files in os.walk(args.input_dir): - for src in (f for f in files if f.endswith('.go')): - process_go_file(os.path.join(root, src), import_map) - - -if __name__ == '__main__': - main() +import argparse +import re +import os + + +# very simple regexp to find go import statement in the source code +# NOTE! only one-line comments are somehow considered +IMPORT_DECL=re.compile(r''' + \bimport + ( + \s+((\.|\w+)\s+)?"[^"]+" ( \s+//[^\n]* )? + | \s* \( \s* ( ( \s+ ((\.|\w+)\s+)? "[^"]+" )? ( \s* //[^\n]* )? )* \s* \) + )''', re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--input-dir', required=True) + parser.add_argument('--map', nargs='*', default=None) + + return parser.parse_args() + + +def process_go_file(file_name, import_map): + content = '' + with open(file_name, 'r') as f: + content = f.read() + + start = -1 + end = -1 + for it in IMPORT_DECL.finditer(content): + if start < 0: + start = it.start() + end = it.end() + + if start < 0: + return + + imports = content[start:end] + for namespace, path in import_map.iteritems(): + ns = namespace.split('.') + name = '__'.join(ns) + import_path = '/'.join(ns) + imports = imports.replace('{} "{}"'.format(name, import_path), '{} "a.yandex-team.ru/{}"'.format(name, path)) + + if imports != content[start:end]: + with open(file_name, 'w') as f: + f.write(content[:start]) + f.write(imports) + f.write(content[end:]) + + +def main(): + args = parse_args() + + if not args.map: + return + + raw_import_map = sorted(set(args.map)) + import_map = dict(z.split('=', 1) for z in raw_import_map) + if len(raw_import_map) != len(import_map): + for k, v in (z.split('=', 1) for z in raw_import_map): + if v != import_map[k]: + raise Exception('import map [{}] contains different values for key [{}]: [{}] and [{}].'.format(args.map, k, v, import_map[k])) + + for root, _, files in os.walk(args.input_dir): + for src in (f for f in files if f.endswith('.go')): + process_go_file(os.path.join(root, src), import_map) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/process_whole_archive_option.py b/build/scripts/process_whole_archive_option.py index a9c4ef676a..1736e2c869 100644 --- a/build/scripts/process_whole_archive_option.py +++ b/build/scripts/process_whole_archive_option.py @@ -12,17 +12,17 @@ class ProcessWholeArchiveOption(): self.start_wa_marker = '--start-wa' self.end_wa_marker = '--end-wa' - def _match_peer_lib(self, arg, ext): + def _match_peer_lib(self, arg, ext): key = None - if arg.endswith(ext): + if arg.endswith(ext): key = os.path.dirname(arg) return key if key and self.peers and key in self.peers else None def _match_lib(self, arg): return arg if self.libs and arg in self.libs else None - def _process_arg(self, arg, ext='.a'): - peer_key = self._match_peer_lib(arg, ext) + def _process_arg(self, arg, ext='.a'): + peer_key = self._match_peer_lib(arg, ext) lib_key = self._match_lib(arg) if peer_key: self.peers[peer_key] += 1 @@ -62,7 +62,7 @@ class ProcessWholeArchiveOption(): is_inside_wa_markers = False def add_prefix(arg, need_check_peers_and_libs): - key = self._process_arg(arg, '.lib') if need_check_peers_and_libs else arg + key = self._process_arg(arg, '.lib') if need_check_peers_and_libs else arg return whole_archive_prefix + arg if key else arg def add_whole_archive_prefix(arg, need_check_peers_and_libs): diff --git a/build/scripts/tar_directory.py b/build/scripts/tar_directory.py index a91889fa22..d8247625b6 100644 --- a/build/scripts/tar_directory.py +++ b/build/scripts/tar_directory.py @@ -36,9 +36,9 @@ def main(args): with tarfile.open(tar, 'r') as tar_file: tar_file.extractall(dest) else: - source = directory + source = directory with tarfile.open(tar, 'w') as out: - out.add(os.path.abspath(source), arcname=os.path.relpath(source, prefix) if prefix else source) + out.add(os.path.abspath(source), arcname=os.path.relpath(source, prefix) if prefix else source) if __name__ == '__main__': diff --git a/build/scripts/tar_sources.py b/build/scripts/tar_sources.py index 54e2839a69..40545c9b74 100644 --- a/build/scripts/tar_sources.py +++ b/build/scripts/tar_sources.py @@ -1,41 +1,41 @@ -import argparse -import os -import tarfile - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--exts', nargs='*', default=None) - parser.add_argument('--flat', action='store_true') - parser.add_argument('--input', required=True) - parser.add_argument('--output', required=True) - parser.add_argument('--prefix', default=None) - - return parser.parse_args() - - -def main(): - args = parse_args() - - py_srcs = [] - for root, _, files in os.walk(args.input): - for f in files: - if not args.exts or f.endswith(tuple(args.exts)): - py_srcs.append(os.path.join(root, f)) - - compression_mode = '' - if args.output.endswith(('.tar.gz', '.tgz')): - compression_mode = 'gz' - elif args.output.endswith('.bzip2'): - compression_mode = 'bz2' - - with tarfile.open(args.output, 'w:{}'.format(compression_mode)) as out: - for f in py_srcs: - arcname = os.path.basename(f) if args.flat else os.path.relpath(f, args.input) - if args.prefix: - arcname = os.path.join(args.prefix, arcname) - out.add(f, arcname=arcname) - - -if __name__ == '__main__': - main() +import argparse +import os +import tarfile + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--exts', nargs='*', default=None) + parser.add_argument('--flat', action='store_true') + parser.add_argument('--input', required=True) + parser.add_argument('--output', required=True) + parser.add_argument('--prefix', default=None) + + return parser.parse_args() + + +def main(): + args = parse_args() + + py_srcs = [] + for root, _, files in os.walk(args.input): + for f in files: + if not args.exts or f.endswith(tuple(args.exts)): + py_srcs.append(os.path.join(root, f)) + + compression_mode = '' + if args.output.endswith(('.tar.gz', '.tgz')): + compression_mode = 'gz' + elif args.output.endswith('.bzip2'): + compression_mode = 'bz2' + + with tarfile.open(args.output, 'w:{}'.format(compression_mode)) as out: + for f in py_srcs: + arcname = os.path.basename(f) if args.flat else os.path.relpath(f, args.input) + if args.prefix: + arcname = os.path.join(args.prefix, arcname) + out.add(f, arcname=arcname) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/ya.make b/build/scripts/ya.make index 710165e40d..d7f0fae2cf 100644 --- a/build/scripts/ya.make +++ b/build/scripts/ya.make @@ -16,19 +16,19 @@ TEST_SRCS( collect_java_srcs.py compile_cuda.py compile_java.py - compile_jsrc.py - compile_pysrc.py + compile_jsrc.py + compile_pysrc.py configure_file.py - copy_files_to_dir.py + copy_files_to_dir.py copy_to_dir.py coverage-info.py - cpp_flatc_wrapper.py + cpp_flatc_wrapper.py create_jcoverage_report.py - extract_asrc.py - extract_docs.py + extract_asrc.py + extract_docs.py extract_jacoco_report.py f2c.py - fail_module_cmd.py + fail_module_cmd.py fetch_from.py fetch_from_external.py fetch_from_mds.py @@ -39,20 +39,20 @@ TEST_SRCS( find_and_tar.py fix_msvc_output.py fs_tools.py - gen_aar_gradle_script.py + gen_aar_gradle_script.py gen_java_codenav_entry.py gen_java_codenav_protobuf.py gen_mx_table.py gen_py3_reg.py gen_py_reg.py - gen_test_apk_gradle_script.py + gen_test_apk_gradle_script.py gen_ub.py generate_pom.py - go_proto_wrapper.py - go_tool.py + go_proto_wrapper.py + go_tool.py ios_wrapper.py java_pack_to_file.py - link_asrc.py + link_asrc.py link_dyn_lib.py link_exe.py link_fat_obj.py @@ -61,12 +61,12 @@ TEST_SRCS( merge_coverage_data.py merge_files.py mkdir.py - mkdocs_builder_wrapper.py + mkdocs_builder_wrapper.py mkver.py pack_ios.py pack_jcoverage_resources.py perl_wrapper.py - postprocess_go_fbs.py + postprocess_go_fbs.py preprocess.py py_compile.py run_ios_simulator.py @@ -79,7 +79,7 @@ TEST_SRCS( stdout2stderr.py symlink.py tar_directory.py - tar_sources.py + tar_sources.py tared_protoc.py touch.py unpacking_jtest_runner.py diff --git a/build/sysincl/android.yml b/build/sysincl/android.yml index 97cfbf38d2..26347da232 100644 --- a/build/sysincl/android.yml +++ b/build/sysincl/android.yml @@ -2,13 +2,13 @@ - android/asset_manager.h - android/asset_manager_jni.h - android/dlext.h - - android/log.h - - android/native_window_jni.h - - cpu-features.h: contrib/libs/android_cpufeatures/cpu-features.h + - android/log.h + - android/native_window_jni.h + - cpu-features.h: contrib/libs/android_cpufeatures/cpu-features.h - ifaddrs.h: contrib/libs/libc_compat/include/ifaddrs/ifaddrs.h - jni.h: contrib/libs/jdk/include/jni.h - - vulkan/vulkan.h - - vulkan/vk_sdk_platform.h + - vulkan/vulkan.h + - vulkan/vk_sdk_platform.h - EGL/egl.h - EGL/eglext.h - GLES2/gl2.h diff --git a/build/sysincl/darwin.yml b/build/sysincl/darwin.yml index 582c7e1202..473c314f1c 100644 --- a/build/sysincl/darwin.yml +++ b/build/sysincl/darwin.yml @@ -73,7 +73,7 @@ - mach/mach_vm.h - mach/machine.h - mach/machine/vm_param.h - - mach/processor_info.h + - mach/processor_info.h - mach/semaphore.h - mach/shared_memory_server.h - mach/shared_region.h diff --git a/build/sysincl/libc-musl-libcxx.yml b/build/sysincl/libc-musl-libcxx.yml index 539ce8e9aa..e6dfbca366 100644 --- a/build/sysincl/libc-musl-libcxx.yml +++ b/build/sysincl/libc-musl-libcxx.yml @@ -2,5 +2,5 @@ includes: - inttypes.h: contrib/libs/cxxsupp/libcxx/include/inttypes.h - string.h: contrib/libs/cxxsupp/libcxx/include/string.h - - stddef.h: contrib/libs/cxxsupp/libcxx/include/stddef.h + - stddef.h: contrib/libs/cxxsupp/libcxx/include/stddef.h - stdint.h: contrib/libs/cxxsupp/libcxx/include/stdint.h diff --git a/build/sysincl/libc-to-musl.yml b/build/sysincl/libc-to-musl.yml index 810dd8d697..db5cf6da1b 100644 --- a/build/sysincl/libc-to-musl.yml +++ b/build/sysincl/libc-to-musl.yml @@ -6,7 +6,7 @@ # or some combination of them depending on the build flags. # Musl has some internal header replacements. We will just resolve to both. -- source_filter: "^(contrib/libs/musl|contrib/libs/cxxsupp/libcxx/include/__config)" +- source_filter: "^(contrib/libs/musl|contrib/libs/cxxsupp/libcxx/include/__config)" includes: - arpa/inet.h: - contrib/libs/musl/include/arpa/inet.h @@ -67,7 +67,7 @@ - contrib/libs/musl/src/include/wchar.h - inttypes.h: contrib/libs/musl/include/inttypes.h - - stddef.h: contrib/libs/musl/include/stddef.h + - stddef.h: contrib/libs/musl/include/stddef.h - stdint.h: contrib/libs/musl/include/stdint.h diff --git a/build/sysincl/linux.yml b/build/sysincl/linux.yml index a92a09bb9c..083ed4d039 100644 --- a/build/sysincl/linux.yml +++ b/build/sysincl/linux.yml @@ -44,7 +44,7 @@ - sys/cdefs.h - sys/memfd.h - sys/queue.h - - sys/platform/ppc.h + - sys/platform/ppc.h - sys/socketvar.h - sys/sysctl.h - sys/unistd.h diff --git a/build/sysincl/misc.yml b/build/sysincl/misc.yml index e9e6095888..f0fe93846d 100644 --- a/build/sysincl/misc.yml +++ b/build/sysincl/misc.yml @@ -26,17 +26,17 @@ - includes: - cudnn.h: contrib/libs/nvidia/cudnn/cudnn.h -# _cgo_export.h is generated into build dir of go package which uses cgo -# and we are unable to resolve it correctly to whcih build dir to resolve -# in the case when tests are also built for this package -- includes: - - _cgo_export.h - +# _cgo_export.h is generated into build dir of go package which uses cgo +# and we are unable to resolve it correctly to whcih build dir to resolve +# in the case when tests are also built for this package +- includes: + - _cgo_export.h + # Resolve jni.h from swig/Lib/java/javahead.swg when building non-java .swg # since they do not peerdir contrib/libs/jdk. # Resolve Python.h from swig/Lib/python/pyruntime.swg when building non-python .swg # since they do not peerdir contrib/libs/python. -- source_filter: "[.]swg([.](h|c(c|pp|xx)?))?$" +- source_filter: "[.]swg([.](h|c(c|pp|xx)?))?$" includes: - jni.h: contrib/libs/jdk/include/jni.h - Python.h: contrib/libs/python/Include/Python.h diff --git a/build/sysincl/unsorted.yml b/build/sysincl/unsorted.yml index a889b923a0..8c8357adde 100644 --- a/build/sysincl/unsorted.yml +++ b/build/sysincl/unsorted.yml @@ -1,4 +1,4 @@ -- source_filter: "^contrib(?!/restricted/gstreamer/gst/parse)" +- source_filter: "^contrib(?!/restricted/gstreamer/gst/parse)" includes: - port.h - types.h @@ -247,10 +247,10 @@ - BaseTsd.h - iphlpapi.h -- source_filter: "^(?!contrib/python/line_profiler/)" - includes: - - timers.h - +- source_filter: "^(?!contrib/python/line_profiler/)" + includes: + - timers.h + - includes: - cpu-features.h - cuda/include/cuComplex.h diff --git a/build/ya.conf.json b/build/ya.conf.json index 5f7cc875d6..8a6ef47514 100644 --- a/build/ya.conf.json +++ b/build/ya.conf.json @@ -296,18 +296,18 @@ "news": { "description": "Run news team tools" }, - "go": { - "description": "Run go tool (1.17.6)" - }, - "gofmt": { - "description": "Run gofmt tool (1.17.6)" - }, - "go_1.18beta2": { - "description": "Run go tool (1.18beta2)" - }, - "gofmt_1.18beta2": { - "description": "Run gofmt tool (1.18beta2)" - }, + "go": { + "description": "Run go tool (1.17.6)" + }, + "gofmt": { + "description": "Run gofmt tool (1.17.6)" + }, + "go_1.18beta2": { + "description": "Run go tool (1.18beta2)" + }, + "gofmt_1.18beta2": { + "description": "Run gofmt tool (1.18beta2)" + }, "godoc": { "description": "Arcadia version of godoc" }, @@ -320,9 +320,9 @@ "swagger": { "description": "Run go-swagger" }, - "dlv": { - "description": "Debugger for the Go programming language" - }, + "dlv": { + "description": "Debugger for the Go programming language" + }, "node-search": { "description": "Autocheck data inspector tool", "visible": false @@ -1064,13 +1064,13 @@ "arch": "aarch64" }, "default": true - }, - { - "host": { - "os": "LINUX", - "arch": "ppc64le" - }, - "default": true + }, + { + "host": { + "os": "LINUX", + "arch": "ppc64le" + }, + "default": true } ] }, @@ -1215,41 +1215,41 @@ } ] }, - "dlv": { - "tools": { - "dlv": { - "bottle": "delve", - "executable": "dlv" - } - }, - "platforms": [ - { - "host": { - "os": "LINUX" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "default": true - }, - { - "host": { - "os": "DARWIN", - "arch": "arm64" - }, - "default": true - }, - { - "host": { - "os": "WIN" - }, - "default": true - } - ] - }, + "dlv": { + "tools": { + "dlv": { + "bottle": "delve", + "executable": "dlv" + } + }, + "platforms": [ + { + "host": { + "os": "LINUX" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "default": true + }, + { + "host": { + "os": "DARWIN", + "arch": "arm64" + }, + "default": true + }, + { + "host": { + "os": "WIN" + }, + "default": true + } + ] + }, "cue": { "tools": { "cue": { @@ -2731,9 +2731,9 @@ "os": "DARWIN" }, "default": true - }, - { - "host": { + }, + { + "host": { "os": "DARWIN", "arch": "arm64" }, @@ -2741,10 +2741,10 @@ }, { "host": { - "os": "LINUX", - "arch": "ppc64le" - }, - "default": true + "os": "LINUX", + "arch": "ppc64le" + }, + "default": true } ], "env": { @@ -2778,13 +2778,13 @@ "os": "DARWIN" }, "default": true - }, - { - "host": { - "os": "LINUX", - "arch": "ppc64le" - }, - "default": true + }, + { + "host": { + "os": "LINUX", + "arch": "ppc64le" + }, + "default": true } ] }, @@ -2827,13 +2827,13 @@ "arch": "aarch64" }, "default": true - }, - { - "host": { - "os": "LINUX", - "arch": "ppc64le" - }, - "default": true + }, + { + "host": { + "os": "LINUX", + "arch": "ppc64le" + }, + "default": true } ] }, @@ -4689,7 +4689,7 @@ "default": true } ] - }, + }, "apphost": { "tools": { "apphost": { @@ -4778,22 +4778,22 @@ } ] }, - "golang_1_17_6": { - "tools": { - "golang": { - "bottle": "golang_1.17.6", - "executable": "golang" + "golang_1_17_6": { + "tools": { + "golang": { + "bottle": "golang_1.17.6", + "executable": "golang" }, - "go": { - "bottle": "golang_1.17.6", - "executable": "go" + "go": { + "bottle": "golang_1.17.6", + "executable": "go" }, - "gofmt": { - "bottle": "golang_1.17.6", - "executable": "gofmt" + "gofmt": { + "bottle": "golang_1.17.6", + "executable": "gofmt" } - }, - "platforms": [ + }, + "platforms": [ { "host": { "os": "LINUX" @@ -4808,39 +4808,39 @@ }, { "host": { - "os": "DARWIN", - "arch": "arm64" - }, - "default": true - }, - { - "host": { + "os": "DARWIN", + "arch": "arm64" + }, + "default": true + }, + { + "host": { "os": "WIN" }, "default": true } - ], - "params": { - "type": "golang", - "version": "1.17.6" - } + ], + "params": { + "type": "golang", + "version": "1.17.6" + } }, - "golang_1_18beta2": { - "tools": { - "golang_1.18beta2": { - "bottle": "golang_1.18beta2", - "executable": "golang_1.18beta2" + "golang_1_18beta2": { + "tools": { + "golang_1.18beta2": { + "bottle": "golang_1.18beta2", + "executable": "golang_1.18beta2" }, - "go_1.18beta2": { - "bottle": "golang_1.18beta2", - "executable": "go_1.18beta2" + "go_1.18beta2": { + "bottle": "golang_1.18beta2", + "executable": "go_1.18beta2" }, - "gofmt_1.18beta2": { - "bottle": "golang_1.18beta2", - "executable": "gofmt_1.18beta2" + "gofmt_1.18beta2": { + "bottle": "golang_1.18beta2", + "executable": "gofmt_1.18beta2" } - }, - "platforms": [ + }, + "platforms": [ { "host": { "os": "LINUX" @@ -4855,23 +4855,23 @@ }, { "host": { - "os": "DARWIN", - "arch": "arm64" - }, - "default": true - }, - { - "host": { + "os": "DARWIN", + "arch": "arm64" + }, + "default": true + }, + { + "host": { "os": "WIN" }, "default": true } - ], - "params": { - "type": "golang", - "version": "1.18beta2" - } - }, + ], + "params": { + "type": "golang", + "version": "1.18beta2" + } + }, "godoc": { "tools": { "godoc": { @@ -5858,19 +5858,19 @@ ] } }, - "delve": { - "formula": { - "sandbox_id": [ + "delve": { + "formula": { + "sandbox_id": [ 1192022937 - ], - "match": "delve" - }, - "executable": { - "dlv": [ - "dlv" - ] - } - }, + ], + "match": "delve" + }, + "executable": { + "dlv": [ + "dlv" + ] + } + }, "cue": { "formula": { "sandbox_id": [ @@ -7325,7 +7325,7 @@ "crypta" ] } - }, + }, "apphost": { "formula": { "sandbox_id": 1210601039, @@ -7376,47 +7376,47 @@ ] } }, - "golang_1.17.6": { - "formula": { + "golang_1.17.6": { + "formula": { "sandbox_id": [ - 1178356987, - 1178357306, - 1178357717, - 1178358055 - ], - "match": "GOLANG" - }, - "executable": { - "go": [ + 1178356987, + 1178357306, + 1178357717, + 1178358055 + ], + "match": "GOLANG" + }, + "executable": { + "go": [ "bin", "go" ], - "gofmt": [ + "gofmt": [ "bin", "gofmt" ] - } - }, - "golang_1.18beta2": { - "formula": { + } + }, + "golang_1.18beta2": { + "formula": { "sandbox_id": [ - 1206631393, - 1206631765, - 1206632232, - 1206632597 - ], - "match": "GOLANG" - }, - "executable": { - "go_1.18beta2": [ + 1206631393, + 1206631765, + 1206632232, + 1206632597 + ], + "match": "GOLANG" + }, + "executable": { + "go_1.18beta2": [ "bin", "go" ], - "gofmt_1.18beta2": [ + "gofmt_1.18beta2": [ "bin", "gofmt" ] - } + } }, "qemu": { "formula": { diff --git a/build/ya.make b/build/ya.make index 407b8f13e0..5f561fdef4 100644 --- a/build/ya.make +++ b/build/ya.make @@ -23,14 +23,14 @@ RECURSE( conf_fatal_error config docs/empty - external_resources + external_resources platform/java platform/local_so platform/perl platform/python platform/python/ldflags plugins - prebuilt + prebuilt scripts tests tests_slow diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 081833998b..2b254dfaa2 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -15,7 +15,7 @@ ANDROID_FAKEID=8821472 CLANG_TIDY_FAKEID=8625699 CURDIR=. -MODDIR=. +MODDIR=. BINDIR=bin:/ SRCDIR= YMAKE=ymake @@ -44,14 +44,14 @@ when ($OS_WINDOWS != "yes") { USE_GLOBAL_CMD=yes } -YMAKE_RESOURCE_BIN=${YMAKE_RESOURCE_GLOBAL}/ymake -YMAKE_RESOURCE_DIR=build/external_resources/ymake -when ($USE_YMAKE_RESOURCE == "yes") { - PEERDIR+=${YMAKE_RESOURCE_DIR} -} - -__COMMA__=${comma:""} - +YMAKE_RESOURCE_BIN=${YMAKE_RESOURCE_GLOBAL}/ymake +YMAKE_RESOURCE_DIR=build/external_resources/ymake +when ($USE_YMAKE_RESOURCE == "yes") { + PEERDIR+=${YMAKE_RESOURCE_DIR} +} + +__COMMA__=${comma:""} + ARCADIA_TEST_ROOT=../arcadia_tests_data/ DEFAULT_REQUIREMENTS=network:restricted cpu:1 ram:32 CC_REQUIREMENTS=$DEFAULT_REQUIREMENTS @@ -62,31 +62,31 @@ PY_REQUIREMENTS=$DEFAULT_REQUIREMENTS BISON_DATA_DIR=contrib/tools/bison/bison/data CPP_BISON_SKELS=${BISON_DATA_DIR}/glr.cc ${BISON_DATA_DIR}/lalr1.cc ${BISON_DATA_DIR}/yacc.c ${BISON_DATA_DIR}/stack.hh ${BISON_DATA_DIR}/variant.hh ${BISON_DATA_DIR}/c++.m4 ${BISON_DATA_DIR}/c++-skel.m4 -USE_PREBUILT_TOOLS=yes +USE_PREBUILT_TOOLS=yes when ($OPENSOURCE == "yes") { - USE_PREBUILT_TOOLS=no -} - + USE_PREBUILT_TOOLS=no +} + FAIL_PY2=no -_PREBUILT_TOOLS_ROOT=build/prebuilt -_TOOL_PROTOC_GEN_GO=vendor/github.com/golang/protobuf/protoc-gen-go -_TOOL_RESCOMPILER=tools/rescompiler -_TOOL_RESCOMPRESSOR=tools/rescompressor -_TOOL_RORESCOMPILER=tools/rorescompiler - -when ($HOST_ARCH_X86_64 == "yes") { - when ($HOST_OS_DARWIN == "yes" || $HOST_OS_LINUX == "yes" || $HOST_OS_WINDOWS == "yes") { - VALID_HOST_PLATFORM_FOR_COMMON_PREBUILT_TOOLS=yes - - when ($USE_PREBUILT_TOOLS == "yes" && $ARCH_X86_64 == "yes") { - _TOOL_PROTOC_GEN_GO=${_PREBUILT_TOOLS_ROOT}/vendor/github.com/golang/protobuf/protoc-gen-go - } - } -} - -FAIL_MODULE_CMD=$YMAKE_PYTHON ${input:"build/scripts/fail_module_cmd.py"} $TARGET ${kv;hide:"p ER"} ${kv;hide:"pc red"} - +_PREBUILT_TOOLS_ROOT=build/prebuilt +_TOOL_PROTOC_GEN_GO=vendor/github.com/golang/protobuf/protoc-gen-go +_TOOL_RESCOMPILER=tools/rescompiler +_TOOL_RESCOMPRESSOR=tools/rescompressor +_TOOL_RORESCOMPILER=tools/rorescompiler + +when ($HOST_ARCH_X86_64 == "yes") { + when ($HOST_OS_DARWIN == "yes" || $HOST_OS_LINUX == "yes" || $HOST_OS_WINDOWS == "yes") { + VALID_HOST_PLATFORM_FOR_COMMON_PREBUILT_TOOLS=yes + + when ($USE_PREBUILT_TOOLS == "yes" && $ARCH_X86_64 == "yes") { + _TOOL_PROTOC_GEN_GO=${_PREBUILT_TOOLS_ROOT}/vendor/github.com/golang/protobuf/protoc-gen-go + } + } +} + +FAIL_MODULE_CMD=$YMAKE_PYTHON ${input:"build/scripts/fail_module_cmd.py"} $TARGET ${kv;hide:"p ER"} ${kv;hide:"pc red"} + when ($TIDY == "yes") { when ($TIDY_EXPORT_FIXES=="") { TIDY_EXPORT_FIXES="no" @@ -114,28 +114,28 @@ otherwise { when ($CODENAVIGATION && $NOCODENAVIGATION != "yes") { PY_PROGRAM_LINK_EXE=$LINK_EXE ${kv;hide:"pyndex $TARGET"} YNDEXER_ARGS=$YMAKE_PYTHON ${input:"build/scripts/yndexer.py"} $CPPYNDEXER_RESOURCE_GLOBAL/yndexer 1500 $(SOURCE_ROOT) $ARCADIA_BUILD_ROOT ${input:SRC} - YNDEXER_OUTPUT=${output;noauto;suf=${OBJ_CROSS_SUF}.ydx.pb2:SRC} -} -otherwise { + YNDEXER_OUTPUT=${output;noauto;suf=${OBJ_CROSS_SUF}.ydx.pb2:SRC} +} +otherwise { PY_PROGRAM_LINK_EXE=$LINK_EXE - YNDEXER_ARGS= + YNDEXER_ARGS= YNDEXER_OUTPUT= -} +} COVERAGE_FLAGS= -EXTRA_OUTPUT= -when ($CLANG == "yes" || $GCC == "yes") { - when ($BUILD_TYPE == "COVERAGE" || $GCOV_COVERAGE) { - COVERAGE_FLAGS=-fprofile-arcs -ftest-coverage - EXTRA_OUTPUT=${output;noauto;hide;suf=${OBJ_CROSS_SUF}${COMPILE_OUT_SUFFIX}.gcno:SRC} - } -} - -when ($OS_CYGWIN == "yes") { - CFLAGS+=-D_LDBL_EQ_DBL=1 -U__STRICT_ANSI__ - USE_ASMLIB=no - FSTACK= -} +EXTRA_OUTPUT= +when ($CLANG == "yes" || $GCC == "yes") { + when ($BUILD_TYPE == "COVERAGE" || $GCOV_COVERAGE) { + COVERAGE_FLAGS=-fprofile-arcs -ftest-coverage + EXTRA_OUTPUT=${output;noauto;hide;suf=${OBJ_CROSS_SUF}${COMPILE_OUT_SUFFIX}.gcno:SRC} + } +} + +when ($OS_CYGWIN == "yes") { + CFLAGS+=-D_LDBL_EQ_DBL=1 -U__STRICT_ANSI__ + USE_ASMLIB=no + FSTACK= +} CFLAGS+=$COVERAGE_FLAGS LDFLAGS+=$COVERAGE_FLAGS @@ -146,7 +146,7 @@ NO_MAPREDUCE= when ($NO_MAPREDUCE == "yes") { C_DEFINES+=-DNO_MAPREDUCE -} +} when ($OS_ANDROID == "yes") { PIE=yes @@ -168,29 +168,29 @@ when ($MAPSMOBI_BUILD_TARGET == "yes" && $OS_IOS == "yes") { # # USE_STL_SYSTEM=yes is a regular way to select system standard C++ library. # -when ($USE_STL_SYSTEM == "yes") { - USE_INTERNAL_STL=no -} - -when ($USE_INTERNAL_STL == "no") { - USE_STL_SYSTEM=yes -} -otherwise { - USE_INTERNAL_STL=yes +when ($USE_STL_SYSTEM == "yes") { + USE_INTERNAL_STL=no +} + +when ($USE_INTERNAL_STL == "no") { + USE_STL_SYSTEM=yes +} +otherwise { + USE_INTERNAL_STL=yes # TODO: Extract to conf/sysincl.conf - # This trigger doesn't work for module level since SYSINCL is processed at - # configuration stage (This means that NO_RUNTIME() macro called in ya.make - # won't affect SYSINCL and the only way to make this trigger work correctly - # is to define configuration varaible NORUNTIME (-DNORUNTIME) on the command - # line when `ya make ...` is invoked. - when ($NORUNTIME != "yes") { - SYSINCL+=build/sysincl/stl-to-libcxx.yml - when ($MUSL == "yes") { - SYSINCL+=build/sysincl/libc-musl-libcxx.yml - } - } -} - + # This trigger doesn't work for module level since SYSINCL is processed at + # configuration stage (This means that NO_RUNTIME() macro called in ya.make + # won't affect SYSINCL and the only way to make this trigger work correctly + # is to define configuration varaible NORUNTIME (-DNORUNTIME) on the command + # line when `ya make ...` is invoked. + when ($NORUNTIME != "yes") { + SYSINCL+=build/sysincl/stl-to-libcxx.yml + when ($MUSL == "yes") { + SYSINCL+=build/sysincl/libc-musl-libcxx.yml + } + } +} + # tag:linux-specific when ($OS_LINUX && $OS_SDK == "ubuntu-14" && $MUSL != "yes") { USE_UBUNTU_COMPATIBILITY=yes @@ -200,16 +200,16 @@ USE_ARCADIA_PYTHON=yes USE_ARCADIA_LIBM=no USE_EAT_MY_DATA=no -HAVE_MKL= -when ($HAVE_MKL == "") { - when ($OS_LINUX && $ARCH_X86_64 && !$SANITIZER_TYPE) { - HAVE_MKL=yes - } - otherwise { - HAVE_MKL=no - } -} - +HAVE_MKL= +when ($HAVE_MKL == "") { + when ($OS_LINUX && $ARCH_X86_64 && !$SANITIZER_TYPE) { + HAVE_MKL=yes + } + otherwise { + HAVE_MKL=no + } +} + SFDL_TMP_OUT= ${output;tmp:SRC.tmp} # tag:perl-specific @@ -232,46 +232,46 @@ otherwise { # tag:perl-specific PERL_LD_LIBRARY_PATH= PERL_INCLUDE= -USE_PERL_SYSTEM=yes -when ($USE_PERL_SYSTEM == "yes") { - select ($PERL_SDK) { - "ubuntu-12" ? { - PERL_VERSION=5.14 - PERL_ROOT=${SYSTEM_PERL_514_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH= - } - "ubuntu-14" ? { - PERL_VERSION=5.18 - PERL_ROOT=${SYSTEM_PERL_518_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH= - } - "ubuntu-16" ? { - PERL_VERSION=5.22 - PERL_ROOT=${SYSTEM_PERL_522_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH=/x86_64-linux-gnu - } - "ubuntu-18" ? { - PERL_VERSION=5.26 - PERL_ROOT=${SYSTEM_PERL_526_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH=/x86_64-linux-gnu - } - "ubuntu-20" ? { - PERL_VERSION=5.30 - PERL_ROOT=${SYSTEM_PERL_530_RESOURCE_GLOBAL}/usr - PERL_LIB_ARCH=/x86_64-linux-gnu - } - } - - PERL=${PERL_ROOT}/bin/perl - PERL_ARCHLIB=${PERL_ROOT}/lib$PERL_LIB_ARCH/perl/${PERL_VERSION} - PERL_PRIVLIB=${PERL_ROOT}/share/perl/${PERL_VERSION} - PERL_LIBS=${PERL_ROOT}/lib${PERL_LIB_ARCH} - PERL_LD_LIBRARY_PATH=${env:"LD_LIBRARY_PATH=${PERL_ROOT}/lib"} - - # Perl searches it's modules in INC@ paths. They can not be sysrooted or disabled (at least I haven't found a way), - # so default Perl module directories should be prepended to perl command lines when using non-local perl. - PERL_INCLUDE=-I${PERL_ARCHLIB} -I${PERL_PRIVLIB} -} +USE_PERL_SYSTEM=yes +when ($USE_PERL_SYSTEM == "yes") { + select ($PERL_SDK) { + "ubuntu-12" ? { + PERL_VERSION=5.14 + PERL_ROOT=${SYSTEM_PERL_514_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH= + } + "ubuntu-14" ? { + PERL_VERSION=5.18 + PERL_ROOT=${SYSTEM_PERL_518_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH= + } + "ubuntu-16" ? { + PERL_VERSION=5.22 + PERL_ROOT=${SYSTEM_PERL_522_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH=/x86_64-linux-gnu + } + "ubuntu-18" ? { + PERL_VERSION=5.26 + PERL_ROOT=${SYSTEM_PERL_526_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH=/x86_64-linux-gnu + } + "ubuntu-20" ? { + PERL_VERSION=5.30 + PERL_ROOT=${SYSTEM_PERL_530_RESOURCE_GLOBAL}/usr + PERL_LIB_ARCH=/x86_64-linux-gnu + } + } + + PERL=${PERL_ROOT}/bin/perl + PERL_ARCHLIB=${PERL_ROOT}/lib$PERL_LIB_ARCH/perl/${PERL_VERSION} + PERL_PRIVLIB=${PERL_ROOT}/share/perl/${PERL_VERSION} + PERL_LIBS=${PERL_ROOT}/lib${PERL_LIB_ARCH} + PERL_LD_LIBRARY_PATH=${env:"LD_LIBRARY_PATH=${PERL_ROOT}/lib"} + + # Perl searches it's modules in INC@ paths. They can not be sysrooted or disabled (at least I haven't found a way), + # so default Perl module directories should be prepended to perl command lines when using non-local perl. + PERL_INCLUDE=-I${PERL_ARCHLIB} -I${PERL_PRIVLIB} +} PERL_DEFAULT_PEERDIR=yes # tag:perl-specific @@ -287,9 +287,9 @@ XSUBPPFLAGS= ARCH_TOOL=${tool:"tools/archiver"} # tag:tool-specific tag:proto -PROTOC=${tool:"contrib/tools/protoc"} -PROTOC_STYLEGUIDE_OUT=--cpp_styleguide_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE -PROTOC_PLUGIN_STYLEGUIDE=--plugin=protoc-gen-cpp_styleguide=${tool:"contrib/tools/protoc/plugins/cpp_styleguide"} +PROTOC=${tool:"contrib/tools/protoc"} +PROTOC_STYLEGUIDE_OUT=--cpp_styleguide_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE +PROTOC_PLUGIN_STYLEGUIDE=--plugin=protoc-gen-cpp_styleguide=${tool:"contrib/tools/protoc/plugins/cpp_styleguide"} PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf/src USE_VANILLA_PROTOC=no @@ -311,8 +311,8 @@ ${output_include;hide:"contrib/libs/python/Include/Python.h"} \ ${output_include;hide:"contrib/libs/python/Include/pythread.h"} \ ${output_include;hide:"contrib/libs/python/Include/structmember.h"} \ ${output_include;hide:"contrib/libs/python/Include/traceback.h"} \ -${output_include;hide:"contrib/tools/cython/generated_c_headers.h"} \ -${output_include;hide:"omp.h"} +${output_include;hide:"contrib/tools/cython/generated_c_headers.h"} \ +${output_include;hide:"omp.h"} # tag:cython-specific CYTHON_CPP_OUTPUT_INCLUDES=${output_include;hide:"contrib/tools/cython/generated_cpp_headers.h"} @@ -350,27 +350,27 @@ FATAL_ERROR_MESSAGE= PYTHON_DISTR="default" when ($USE_SYSTEM_PYTHON) { USE_ARCADIA_PYTHON=no - select ($USE_SYSTEM_PYTHON) { - "2.7" ? { + select ($USE_SYSTEM_PYTHON) { + "2.7" ? { _SYSTEM_PYTHON27=yes PY_VERSION=2.7 PY_FRAMEWORK_VERSION=2.7 - } + } "3.4" ? { _SYSTEM_PYTHON34=yes PY_VERSION=3.4m PY_FRAMEWORK_VERSION=3.4 } - "3.5" ? { + "3.5" ? { _SYSTEM_PYTHON35=yes PY_VERSION=3.5m PY_FRAMEWORK_VERSION=3.5 - } - "3.6" ? { + } + "3.6" ? { _SYSTEM_PYTHON36=yes PY_VERSION=3.6m PY_FRAMEWORK_VERSION=3.6 - } + } "3.7" ? { _SYSTEM_PYTHON37=yes PY_VERSION=3.7m @@ -405,21 +405,21 @@ when ($HOST_OS_WINDOWS == "yes") { } # tag:python-specific -when ($USE_ARCADIA_PYTHON == "no") { +when ($USE_ARCADIA_PYTHON == "no") { SYSINCL+=build/sysincl/python.yml -} +} # tag:allocator DEFAULT_ALLOCATOR=LF # tag:allocator -when ($OS_ANDROID == "yes" || $MSVC == "yes") { - DEFAULT_ALLOCATOR=J -} +when ($OS_ANDROID == "yes" || $MSVC == "yes") { + DEFAULT_ALLOCATOR=J +} # tag:allocator -when ($OS_CYGWIN == "yes" || $ARCH_PPC64LE == "yes") { - DEFAULT_ALLOCATOR=SYSTEM +when ($OS_CYGWIN == "yes" || $ARCH_PPC64LE == "yes") { + DEFAULT_ALLOCATOR=SYSTEM } # tag:allocator @@ -428,12 +428,12 @@ when ($OS_DARWIN == "yes") { } # tag:allocator -when ($SANITIZER_TYPE) { - when ($SANITIZER_TYPE != "no") { - DEFAULT_ALLOCATOR=SYSTEM - } -} - +when ($SANITIZER_TYPE) { + when ($SANITIZER_TYPE != "no") { + DEFAULT_ALLOCATOR=SYSTEM + } +} + # tag:internal ### @usage: CHECK_CONFIG_H(<conf_header>) # internal ### @@ -441,11 +441,11 @@ when ($SANITIZER_TYPE) { ### The check is needed to avoid conflicts on certain types and functions available in arcadia. ### ### @see https://a.yandex-team.ru/arc/trunk/arcadia/build/scripts/check_config_h.py for exact details -macro CHECK_CONFIG_H(Conf) { +macro CHECK_CONFIG_H(Conf) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/check_config_h.py"} ${input;rootrel:Conf} ${output;nopath;noext:Conf.config.cpp} ${kv;hide:"p CH"} ${kv;hide:"pc yellow"} - OUTPUT_INCLUDES=$Conf -} - + OUTPUT_INCLUDES=$Conf +} + REQUIRED_TRANSITIVE_PEERS= ### @usage REQUIRES(dirs...) ### @@ -496,7 +496,7 @@ CPP_PROTO_CMDLINE= CPP_PROTO_OPTS= CPP_PROTO_OUTS= CPP_PROTO_SUFFIXES=.pb.h .pb.cc -CPP_PROTO_PLUGINS= +CPP_PROTO_PLUGINS= # tag:proto tag:cpp-specific CPP_EV_OPTS=--plugin=protoc-gen-event2cpp=${tool:"tools/event2cpp"} --event2cpp_out=$ARCADIA_BUILD_ROOT -I=$ARCADIA_ROOT/library/cpp/eventlog @@ -545,29 +545,29 @@ macro RESOURCE(Args...) { } # tag:internal -### @usage: _ORDER_ADDINCL([BUILD ...] [SOURCE ...] Args...) # internal +### @usage: _ORDER_ADDINCL([BUILD ...] [SOURCE ...] Args...) # internal ### -### Order and filter ADDINCLs (Args - is intentionally omitted in ADDINCL macro) -macro _ORDER_ADDINCL(BUILD[], SOURCE[], ARGS...) { - ADDINCL($BUILD $SOURCE) -} - +### Order and filter ADDINCLs (Args - is intentionally omitted in ADDINCL macro) +macro _ORDER_ADDINCL(BUILD[], SOURCE[], ARGS...) { + ADDINCL($BUILD $SOURCE) +} + # tag:proto ### @usage: PROTO_ADDINCL([GLOBAL] [WITH_GEN] Path) -### +### ### This macro introduces proper ADDINCLs for .proto-files found in sources and ### .cpp/.h generated files, supplying them to appropriate commands and allowing ### proper dependency resolution at configure-time. ### ### Note: you normally shouldn't use this macro. ADDINCLs should be sent to user ### from dependency via PROTO_NAMESPACE macro -macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { - _ORDER_ADDINCL($WITH_GEN $GLOBAL FOR proto ${ARCADIA_BUILD_ROOT}/$Path SOURCE $GLOBAL FOR proto ${ARCADIA_ROOT}/$Path) +macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { + _ORDER_ADDINCL($WITH_GEN $GLOBAL FOR proto ${ARCADIA_BUILD_ROOT}/$Path SOURCE $GLOBAL FOR proto ${ARCADIA_ROOT}/$Path) ADDINCL($GLOBAL ${ARCADIA_BUILD_ROOT}/$Path) } # tag:proto -### @usage: PROTO_NAMESPACE([GLOBAL] [WITH_GEN] Namespace) +### @usage: PROTO_NAMESPACE([GLOBAL] [WITH_GEN] Namespace) ### ### Defines protobuf namespace (import/export path prefix) which should be used for imports and ### which defines output path for .proto generation. @@ -576,11 +576,11 @@ macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { ### for both .cpp headers includes and .proto imports. If .proto expected to be used outsed of the ### processing module use GLOBAL to send proper ADDINCLs to all (transitive) users. PEERDIR to ### PROTO_LIBRARY with PROTO_NAMESPACE(GLOBAL ) is enough at user side to correctly use the library. -### If generated .proto files are going to be used for building a module than use of WITH_GEN -### parameter will add appropriate dir from the build root for .proto files search. -macro PROTO_NAMESPACE(GLOBAL?"GLOBAL":"", WITH_GEN?"WITH_GEN":"", Namespace) { +### If generated .proto files are going to be used for building a module than use of WITH_GEN +### parameter will add appropriate dir from the build root for .proto files search. +macro PROTO_NAMESPACE(GLOBAL?"GLOBAL":"", WITH_GEN?"WITH_GEN":"", Namespace) { SET(PROTO_NAMESPACE $Namespace) - PROTO_ADDINCL($GLOBAL $WITH_GEN $Namespace) + PROTO_ADDINCL($GLOBAL $WITH_GEN $Namespace) } # tag:proto tag:internal tag:python-specific @@ -713,60 +713,60 @@ macro USE_SKIFF() { } # tag:go-specific -_GO_COMMON_GOOGLE_APIS = \ -vendor/google.golang.org/genproto/googleapis/api/annotations \ -vendor/google.golang.org/genproto/googleapis/api/configchange \ -vendor/google.golang.org/genproto/googleapis/api/distribution \ -vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1 \ -vendor/google.golang.org/genproto/googleapis/api/expr/v1beta1 \ -vendor/google.golang.org/genproto/googleapis/api/httpbody \ -vendor/google.golang.org/genproto/googleapis/api/label \ -vendor/google.golang.org/genproto/googleapis/api/metric \ -vendor/google.golang.org/genproto/googleapis/api/monitoredres \ -vendor/google.golang.org/genproto/googleapis/api/serviceconfig \ -vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1 \ -vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/admin/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/credentials/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/v1/logging \ -vendor/google.golang.org/genproto/googleapis/logging/type \ -vendor/google.golang.org/genproto/googleapis/logging/v2 \ -vendor/google.golang.org/genproto/googleapis/rpc/code \ -vendor/google.golang.org/genproto/googleapis/rpc/errdetails \ -vendor/google.golang.org/genproto/googleapis/rpc/status \ -vendor/google.golang.org/genproto/googleapis/type/calendarperiod \ -vendor/google.golang.org/genproto/googleapis/type/color \ -vendor/google.golang.org/genproto/googleapis/type/date \ -vendor/google.golang.org/genproto/googleapis/type/dayofweek \ -vendor/google.golang.org/genproto/googleapis/type/expr \ -vendor/google.golang.org/genproto/googleapis/type/fraction \ -vendor/google.golang.org/genproto/googleapis/type/latlng \ -vendor/google.golang.org/genproto/googleapis/type/money \ -vendor/google.golang.org/genproto/googleapis/type/postaladdress \ -vendor/google.golang.org/genproto/googleapis/type/quaternion \ -vendor/google.golang.org/genproto/googleapis/type/timeofday - +_GO_COMMON_GOOGLE_APIS = \ +vendor/google.golang.org/genproto/googleapis/api/annotations \ +vendor/google.golang.org/genproto/googleapis/api/configchange \ +vendor/google.golang.org/genproto/googleapis/api/distribution \ +vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1 \ +vendor/google.golang.org/genproto/googleapis/api/expr/v1beta1 \ +vendor/google.golang.org/genproto/googleapis/api/httpbody \ +vendor/google.golang.org/genproto/googleapis/api/label \ +vendor/google.golang.org/genproto/googleapis/api/metric \ +vendor/google.golang.org/genproto/googleapis/api/monitoredres \ +vendor/google.golang.org/genproto/googleapis/api/serviceconfig \ +vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1 \ +vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/admin/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/credentials/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/v1/logging \ +vendor/google.golang.org/genproto/googleapis/logging/type \ +vendor/google.golang.org/genproto/googleapis/logging/v2 \ +vendor/google.golang.org/genproto/googleapis/rpc/code \ +vendor/google.golang.org/genproto/googleapis/rpc/errdetails \ +vendor/google.golang.org/genproto/googleapis/rpc/status \ +vendor/google.golang.org/genproto/googleapis/type/calendarperiod \ +vendor/google.golang.org/genproto/googleapis/type/color \ +vendor/google.golang.org/genproto/googleapis/type/date \ +vendor/google.golang.org/genproto/googleapis/type/dayofweek \ +vendor/google.golang.org/genproto/googleapis/type/expr \ +vendor/google.golang.org/genproto/googleapis/type/fraction \ +vendor/google.golang.org/genproto/googleapis/type/latlng \ +vendor/google.golang.org/genproto/googleapis/type/money \ +vendor/google.golang.org/genproto/googleapis/type/postaladdress \ +vendor/google.golang.org/genproto/googleapis/type/quaternion \ +vendor/google.golang.org/genproto/googleapis/type/timeofday + # tag:go-specific -_COMMON_GOOGLE_APIS=None - +_COMMON_GOOGLE_APIS=None + # tag:go-specific ### @usage: USE_COMMON_GOOGLE_APIS([apis...]) -### +### ### Use common-google-apis library set. Pass optional apis list to be used or use them all. ### This macro is properly handled for all languages including Go, where apis come in ## pregenerated form. In other languages apis are generated from sources in Arcadia. -macro USE_COMMON_GOOGLE_APIS(APIS...) { - SET(_COMMON_GOOGLE_APIS ${pre=vendor/google.golang.org/genproto/googleapis/:APIS}) -} - +macro USE_COMMON_GOOGLE_APIS(APIS...) { + SET(_COMMON_GOOGLE_APIS ${pre=vendor/google.golang.org/genproto/googleapis/:APIS}) +} + # tag:go-specific tag:proto -GO_PROTO_GEN_TOOL=$_TOOL_PROTOC_GEN_GO -GO_PROTO_GEN_PLUGINS= -GO_PROTO_PACKAGE_MAP= -GO_PROTO_OPTS=$_GO_PROTOC_PLUGIN_ARGS_BASE(go $GO_PROTO_GEN_TOOL MAP $GO_PROTO_PACKAGE_MAP PLUGINS $GO_PROTO_GEN_PLUGINS) -GO_PROTO_OUTS= - +GO_PROTO_GEN_TOOL=$_TOOL_PROTOC_GEN_GO +GO_PROTO_GEN_PLUGINS= +GO_PROTO_PACKAGE_MAP= +GO_PROTO_OPTS=$_GO_PROTOC_PLUGIN_ARGS_BASE(go $GO_PROTO_GEN_TOOL MAP $GO_PROTO_PACKAGE_MAP PLUGINS $GO_PROTO_GEN_PLUGINS) +GO_PROTO_OUTS= + # tag:go-specific tag:proto GO_PROTOBUF_IMPORTS=\ ${GOSTD}/sync \ @@ -780,7 +780,7 @@ GO_PROTOBUF_IMPORTS=\ vendor/google.golang.org/protobuf/reflect/protoreflect # tag:go-specific tag:proto -GO_PROTOBUF_WELLKNOWN_TYPES=\ +GO_PROTOBUF_WELLKNOWN_TYPES=\ vendor/google.golang.org/protobuf/types/known/anypb \ vendor/google.golang.org/protobuf/types/known/apipb \ vendor/google.golang.org/protobuf/types/known/durationpb \ @@ -791,48 +791,48 @@ GO_PROTOBUF_WELLKNOWN_TYPES=\ vendor/google.golang.org/protobuf/types/known/timestamppb \ vendor/google.golang.org/protobuf/types/known/typepb \ vendor/google.golang.org/protobuf/types/known/wrapperspb - + # tag:go-specific tag:proto -### @usage: GO_PROTO_PLUGIN(Name Ext Tool [DEPS dependencies...]) -### -### Define protoc plugin for GO with given Name that emits extra output with provided extension -### Ext using Tool. Extra dependencies are passed via DEPS. -macro GO_PROTO_PLUGIN(NAME, EXT, TOOL, DEPS[]) { - SET_APPEND(GO_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL)) - SET_APPEND(GO_PROTO_OUTS \${output;hide;noauto;norel;nopath;noext;suf=$EXT:File}) - PEERDIR(${DEPS}) -} - +### @usage: GO_PROTO_PLUGIN(Name Ext Tool [DEPS dependencies...]) +### +### Define protoc plugin for GO with given Name that emits extra output with provided extension +### Ext using Tool. Extra dependencies are passed via DEPS. +macro GO_PROTO_PLUGIN(NAME, EXT, TOOL, DEPS[]) { + SET_APPEND(GO_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL)) + SET_APPEND(GO_PROTO_OUTS \${output;hide;noauto;norel;nopath;noext;suf=$EXT:File}) + PEERDIR(${DEPS}) +} + # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE_IMPL(Name, Tool, PLUGINS...) { +macro _GO_PROTOC_PLUGIN_ARGS_BASE_IMPL(Name, Tool, PLUGINS...) { .CMD=--plugin=protoc-gen-${Name}=${tool:Tool} --${Name}_out=${join=|:PLUGINS}:${ARCADIA_BUILD_ROOT}/$PROTO_NAMESPACE -} +} # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE_PROXY(Name, Tool, MAP[], PLUGINS[]) { - .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_IMPL($Name $Tool $MAP ${pre=plugins=:PLUGINS}) -} - +macro _GO_PROTOC_PLUGIN_ARGS_BASE_PROXY(Name, Tool, MAP[], PLUGINS[]) { + .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_IMPL($Name $Tool $MAP ${pre=plugins=:PLUGINS}) +} + # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE(Name, Tool, MAP[], PLUGINS[]) { - .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_PROXY($Name $Tool MAP ${pre=M:MAP} PLUGINS ${join=|:PLUGINS}) -} - +macro _GO_PROTOC_PLUGIN_ARGS_BASE(Name, Tool, MAP[], PLUGINS[]) { + .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_PROXY($Name $Tool MAP ${pre=M:MAP} PLUGINS ${join=|:PLUGINS}) +} + # tag:go-specific tag:proto GO_PROTO_CMDLINE=${cwd;rootdir;input:File} $YMAKE_PYTHON ${input:"build/scripts/go_proto_wrapper.py"} $GO_ARCADIA_PROJECT_PREFIX $GO_CONTRIB_PROJECT_PREFIX ./$PROTO_NAMESPACE $PROTOC -I=./$PROTO_NAMESPACE -I=$ARCADIA_ROOT/$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_BUILD_ROOT -I=$PROTOBUF_PATH ${input;rootrel:File} - + # tag:go-specific tag:proto macro _GO_PROTO_CMD_IMPL(File, OPTS[], OUTS[]) { - .CMD=$GO_PROTO_CMDLINE $OPTS $OUTS ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} + .CMD=$GO_PROTO_CMDLINE $OPTS $OUTS ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} .PEERDIR=${GO_PROTOBUF_IMPORTS} ${GO_PROTOBUF_WELLKNOWN_TYPES} .ADDINCL=FOR proto contrib/libs/protobuf/src -} - +} + # tag:go-specific tag:proto -macro _GO_PROTO_CMD(File) { - .CMD=$_GO_PROTO_CMD_IMPL($File OPTS $GO_PROTO_OPTS OUTS $GO_PROTO_OUTS) -} - +macro _GO_PROTO_CMD(File) { + .CMD=$_GO_PROTO_CMD_IMPL($File OPTS $GO_PROTO_OPTS OUTS $GO_PROTO_OUTS) +} + # tag:proto ### @usage: YP_PROTO_YSON(Files... OUT_OPTS Opts...) ### @@ -899,7 +899,7 @@ macro _PY_PROTO_CMD_BASE(File, Suf, Args...) { # tag:proto tag:python-specific macro _PY_PROTO_CMD(File) { .CMD=${cwd;rootdir;input:File} $_PY_PROTO_CMD_BASE($File _pb2.py $PY_PROTO_OPTS $PY_PROTO_OUTS $PY_PROTO_MYPY_PLUGIN) -} +} # tag:proto tag:python-specific macro _PY_PROTO_CMD_INTERNAL(File) { @@ -935,7 +935,7 @@ otherwise { # tag:proto tag:java-specific macro _JAVA_PROTO_CMD(File) { .CMD=${cwd;rootdir;input:File} $YMAKE_PYTHON ${input:"build/scripts/tared_protoc.py"} --tar-output ${output;norel;nopath;noext;suf=.jsrc:File} --protoc-out-dir $ARCADIA_BUILD_ROOT/java_out $PROTOC -I=./$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_ROOT $_JAVA_PROTO_OUT_ARG$ARCADIA_BUILD_ROOT/java_out ${input;rootrel:File} ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} $JAVA_PROTO_ARGS -} +} # tag:proto tag:perl-specific tag:deprecated @@ -943,24 +943,24 @@ macro _JAVA_PROTO_CMD(File) { ### ### Generate Perl code from protobuf. ### In order to use this macro one should predict all outputs protoc will emit from input_proto file and enlist those as outputs. -macro XS_PROTO(File, Dir, Outputs...) { +macro XS_PROTO(File, Dir, Outputs...) { .CMD=$PROTOC -I=${ARCADIA_ROOT}/${Dir} ${pre=-I=:_PROTO__INCLUDE} -I=${ARCADIA_ROOT} -I=${PROTOBUF_PATH} --perlxs_out=${BINDIR} ${input:File} ${hide;output:Outputs} ${output_include;hide;nopath;noext;suf=.pb.h:File} - PEERDIR(${Dir}) - ADDINCL(${ARCADIA_BUILD_ROOT}/${Dir}) + PEERDIR(${Dir}) + ADDINCL(${ARCADIA_BUILD_ROOT}/${Dir}) } # tag:proto tag:fbs ### @usage: PROTO2FBS(InputProto) ### ### Produce flatbuf schema out of protobuf description. -macro PROTO2FBS(File) { +macro PROTO2FBS(File) { .CMD=${cwd:BINDIR} ${tool:"contrib/tools/flatc"} -I . -I ${ARCADIA_ROOT} --proto ${input:File} ${output;hide;nopath;noext:File.fbs} ${kv;hide:"p FBS"} ${kv;hide:"pc yellow"} -} +} # tag:proto tag:python-specific -when ($PY_PROTOS_FOR == "yes") { - PEERDIR+=contrib/libs/protobuf/python -} +when ($PY_PROTOS_FOR == "yes") { + PEERDIR+=contrib/libs/protobuf/python +} # tag:python-specific macro _PY_EVLOG_CMD_BASE(File, Suf, Args...) { @@ -988,9 +988,9 @@ macro _JAVA_EVLOG_CMD(File) { RUN_NO_SANITIZE=$YMAKE_PYTHON ${input:"build/scripts/run_tool.py"} -- # tag:sanitize -when ($IS_CROSS_SANITIZE) { - RUN_NO_SANITIZE= -} +when ($IS_CROSS_SANITIZE) { + RUN_NO_SANITIZE= +} YIELD=$YMAKE_PYTHON ${input:"build/scripts/yield_line.py"} -- ${BINDIR}/__args XARGS=$YMAKE_PYTHON ${input:"build/scripts/xargs.py"} -- ${BINDIR}/__args @@ -1000,15 +1000,15 @@ RESPFILE_CMD=$YMAKE_PYTHON ${input:"build/scripts/writer.py"} FS_TOOLS=$YMAKE_PYTHON ${input:"build/scripts/fs_tools.py"} COPY_CMD=$FS_TOOLS copy -LINK_OR_COPY_CMD=$FS_TOOLS link_or_copy +LINK_OR_COPY_CMD=$FS_TOOLS link_or_copy REMOVE_FILE=$FS_TOOLS remove MOVE_FILE=$FS_TOOLS rename # tag:allocator tag:windows-specific MSVC_DYNAMICBASE=/DYNAMICBASE -when ($ALLOCATOR == "LF") { - MSVC_DYNAMICBASE=/DYNAMICBASE:NO -} +when ($ALLOCATOR == "LF") { + MSVC_DYNAMICBASE=/DYNAMICBASE:NO +} # tag:sanitize SANITIZER_CFLAGS= @@ -1018,7 +1018,7 @@ SANITIZER_CFLAGS= ### ### Emit GRPC code for all .proto files in a PROTO_LIBRARY. ### This works for all available PROTO_LIBRARY versions (C++, Python 2.x, Pyton 3.x, Java and Go). -macro GRPC() { +macro GRPC() { # C++ CPP_PROTO_PLUGIN2(grpc_cpp contrib/tools/protoc/plugins/grpc_cpp .grpc.pb.cc .grpc.pb.h DEPS contrib/libs/grpc) @@ -1030,70 +1030,70 @@ macro GRPC() { } # tag:fbs -FLATC_FLAGS_VALUE= -### @usage: FLATC_FLAGS(flags...) -### -### Add flags to flatc command line -macro FLATC_FLAGS(FLAGS...) { - SET_APPEND(FLATC_FLAGS_VALUE $FLAGS) -} +FLATC_FLAGS_VALUE= +### @usage: FLATC_FLAGS(flags...) +### +### Add flags to flatc command line +macro FLATC_FLAGS(FLAGS...) { + SET_APPEND(FLATC_FLAGS_VALUE $FLAGS) +} # tag:fbs -_PY_FBS_DEPS=contrib/python/flatbuffers - +_PY_FBS_DEPS=contrib/python/flatbuffers + # tag:fbs tag:internal -### @usage: FBS_TO_PYSRC(output_base_name fbs_files...) # internal -### -### Create a tar archive of .py files generated by flatc for Python. Output tar -### archive will have .fbs.pysrc extension. This .fbs.pysrc extension is specially -### processed when --add-flatbuf-result flag is specified on the command line -### for 'ya make ...' (tar archive is extracted to output directory). -macro FBS_TO_PYSRC(OUT_NAME, IN_FBS_FILES...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} -} - +### @usage: FBS_TO_PYSRC(output_base_name fbs_files...) # internal +### +### Create a tar archive of .py files generated by flatc for Python. Output tar +### archive will have .fbs.pysrc extension. This .fbs.pysrc extension is specially +### processed when --add-flatbuf-result flag is specified on the command line +### for 'ya make ...' (tar archive is extracted to output directory). +macro FBS_TO_PYSRC(OUT_NAME, IN_FBS_FILES...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} +} + # tag:fbs tag:go-specific -# Implicit dependencies of generated code for Go -_GO_FLATC_IMPORTS=\ - ${GOSTD}/strconv \ - vendor/github.com/google/flatbuffers/go - +# Implicit dependencies of generated code for Go +_GO_FLATC_IMPORTS=\ + ${GOSTD}/strconv \ + vendor/github.com/google/flatbuffers/go + # tag:fbs tag:cpp-specific -macro _CPP_FLATC_CMD(SRC, SRCFLAGS...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --yandex-maps-iter --gen-object-api --filename-suffix .fbs ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;hide;noext;norel:SRC.iter.fbs.h} ${output;noauto;hide;noext;norel:SRC.bfbs} ${kv;hide:"p FL"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/flatbuffers -} - +macro _CPP_FLATC_CMD(SRC, SRCFLAGS...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --yandex-maps-iter --gen-object-api --filename-suffix .fbs ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;hide;noext;norel:SRC.iter.fbs.h} ${output;noauto;hide;noext;norel:SRC.bfbs} ${kv;hide:"p FL"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/libs/flatbuffers +} + # tag:fbs tag:cpp-specific -macro _CPP_FLATC64_CMD(SRC, SRCFLAGS...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc64"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --filename-suffix .fbs64 ${FLATC_FLAGS_VALUE} -I ${ARCADIA_ROOT} -I ${ARCADIA_BUILD_ROOT} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;noauto;hide;noext;norel:SRC.bfbs64} ${kv;hide:"p FL64"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/flatbuffers64 -} - +macro _CPP_FLATC64_CMD(SRC, SRCFLAGS...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc64"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --filename-suffix .fbs64 ${FLATC_FLAGS_VALUE} -I ${ARCADIA_ROOT} -I ${ARCADIA_BUILD_ROOT} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;noauto;hide;noext;norel:SRC.bfbs64} ${kv;hide:"p FL64"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/libs/flatbuffers64 +} + # tag:fbs tag:go-specific tag:internal -### @usage: _GO_FLATC_CMD(fbs_file flags...) # internal -### -### Create a tar archive of .go files generated by flatc for Go. Output tar archive -### wiil have .fbs.gosrc extension. This .fbs.gosrc is specially processed when -### --add-protobuf-result flag is specified on the command line for 'ya make ...' -### (tar archive is extracted to output directory). -macro _GO_FLATC_CMD(SRC, PACKAGE_NAME) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --go --gen-mutable --go-namespace ${PACKAGE_NAME} ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR}/_generated ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/postprocess_go_fbs.py"} --input-dir ${BINDIR} --map $_FBS_NAMESPACE_MAP_GLOBAL && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --flat --input ${BINDIR}/_generated --output ${output;noext;tared:SRC.fbs.gosrc} --exts .go ${kv;hide:"p FG"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} - .PEERDIR=${_GO_FLATC_IMPORTS} -} - +### @usage: _GO_FLATC_CMD(fbs_file flags...) # internal +### +### Create a tar archive of .go files generated by flatc for Go. Output tar archive +### wiil have .fbs.gosrc extension. This .fbs.gosrc is specially processed when +### --add-protobuf-result flag is specified on the command line for 'ya make ...' +### (tar archive is extracted to output directory). +macro _GO_FLATC_CMD(SRC, PACKAGE_NAME) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --go --gen-mutable --go-namespace ${PACKAGE_NAME} ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR}/_generated ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/postprocess_go_fbs.py"} --input-dir ${BINDIR} --map $_FBS_NAMESPACE_MAP_GLOBAL && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --flat --input ${BINDIR}/_generated --output ${output;noext;tared:SRC.fbs.gosrc} --exts .go ${kv;hide:"p FG"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} + .PEERDIR=${_GO_FLATC_IMPORTS} +} + # tag:fbs tag:java-specific tag:internal -### @usage: _JAVA_FLATC_CMD(fbs_file) # internal -### -### Create a tar archive of .java files generated by flatc for Java. Output tar -### acrchive will have .fbs.jsrc extension. Files with .fbs.jsrc extension will -### be added to results when --add-flatbuf-result flag is specified on the command -### line for 'ya make ...' -macro _JAVA_FLATC_CMD(SRC) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --java --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --input $BINDIR --output ${output;nopath;noext:SRC.fbs.jsrc} --exts .java ${kv;hide:"p FJ"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION} -} - +### @usage: _JAVA_FLATC_CMD(fbs_file) # internal +### +### Create a tar archive of .java files generated by flatc for Java. Output tar +### acrchive will have .fbs.jsrc extension. Files with .fbs.jsrc extension will +### be added to results when --add-flatbuf-result flag is specified on the command +### line for 'ya make ...' +macro _JAVA_FLATC_CMD(SRC) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --java --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --input $BINDIR --output ${output;nopath;noext:SRC.fbs.jsrc} --exts .java ${kv;hide:"p FJ"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION} +} + # variables must be defined for all module types to make generate_mf.py work MODULE_PREFIX= MODULE_SUFFIX= @@ -1119,11 +1119,11 @@ when (!$ARCADIA_PYTHON_UNICODE_SIZE) { ### The base of all modules describing default bare minimum for all modules. ### To avoid surprises, all buildable modules are better to be inherited from it or its descendants. module _BARE_UNIT { - .EXTS=.* - .CMD=TOUCH_UNIT - .IGNORED=GO_PROTO_PLUGIN - .NODE_TYPE=Bundle - .PEERDIR_POLICY=as_include + .EXTS=.* + .CMD=TOUCH_UNIT + .IGNORED=GO_PROTO_PLUGIN + .NODE_TYPE=Bundle + .PEERDIR_POLICY=as_include .RESTRICTED=GRPC USE_SKIFF INDUCED_DEPS FUZZ_DICTS FUZZ_OPTS PACK DOCS_DIR DOCS_CONFIG DOCS_VARS YT_SPEC USE_CXX USE_UTIL WHOLE_ARCHIVE PRIMARY_OUTPUT SECONDARY_OUTPUT DEPENDENCY_MANAGEMENT EXCLUDE NO_DOCTESTS EMBED_JAVA_VCS_INFO RESOURCE_FILES PACK_GLOBALS_IN_LIBRARY EXPOSE GLOBAL_DEPS .FINAL_TARGET=no @@ -1146,50 +1146,50 @@ module _BASE_UNIT: _BARE_UNIT { .GLOBAL=_FBS_NAMESPACE_MAP PEERDIR_TAGS=CPP_PROTO CPP_FBS CPP_SSQLS CPP_IDL PY2 PY2_NATIVE YQL_UDF_STATIC __EMPTY__ DLL_LIB - + CPP_PROTO_CMDLINE=${cwd;rootdir;input:File} $PROTOC -I=./$PROTO_NAMESPACE -I=$ARCADIA_ROOT/$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_BUILD_ROOT -I=$PROTOBUF_PATH --cpp_out=${CPP_PROTO_PLUGINS}$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE $PROTOC_STYLEGUIDE_OUT $PROTOC_PLUGIN_STYLEGUIDE ${input;rootrel:File} CPP_PROTO_OUTS+=${output;hide;norel;nopath;noext:File.pb.cc} ${output;main;hide;norel;nopath;noext:File.pb.h} CPP_EV_OUTS+=${output;hide;norel:File.pb.cc} ${output;hide;norel:File.pb.h} - when ($PY_PROTOS_FOR == "yes") { + when ($PY_PROTOS_FOR == "yes") { MACRO_ALIAS(EVLOG_CMD _PY_EVLOG_CMD) MACRO_ALIAS(PROTO_CMD _PY_PROTO_CMD) - } - otherwise { + } + otherwise { MACRO_ALIAS(EVLOG_CMD _CPP_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _CPP_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _CPP_FLATC_CMD) when ($BUILD_PROTO_AS_EVLOG == "yes") { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_EVLOG_CMD) } otherwise { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_CMD) } - when ($USE_VANILLA_PROTOC == "yes") { - PROTOC=${tool:"contrib/tools/protoc_std"} - PROTOC_STYLEGUIDE_OUT= - PROTOC_PLUGIN_STYLEGUIDE= - PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf_std - MACRO_ALIAS(PROTO_CMD _CPP_VANILLA_PROTO_CMD) - } - } + when ($USE_VANILLA_PROTOC == "yes") { + PROTOC=${tool:"contrib/tools/protoc_std"} + PROTOC_STYLEGUIDE_OUT= + PROTOC_PLUGIN_STYLEGUIDE= + PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf_std + MACRO_ALIAS(PROTO_CMD _CPP_VANILLA_PROTO_CMD) + } + } SANITIZER_DEFINED=no when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { CFLAGS+=-fsanitize=$SANITIZER_TYPE -D${SANITIZER_TYPE}_sanitizer_enabled $SANITIZER_CFLAGS -fno-omit-frame-pointer LDFLAGS+=-fsanitize=$SANITIZER_TYPE - SANITIZER_DEFINED=yes + SANITIZER_DEFINED=yes when ($CLANG) { CFLAGS+=-fsanitize-blacklist=${input:"build/sanitize-blacklist.txt"} LDFLAGS+=-fsanitize-blacklist=${input:"build/sanitize-blacklist.txt"} } - } + } - when ($SANITIZE_COVERAGE && $SANITIZE_COVERAGE != "no") { - CFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE - LDFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE - } + when ($SANITIZE_COVERAGE && $SANITIZE_COVERAGE != "no") { + CFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE + LDFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE + } when ($CLANG_COVERAGE && $CLANG_COVERAGE != "no") { CFLAGS+=-fprofile-instr-generate -fcoverage-mapping -DCLANG_COVERAGE @@ -1200,20 +1200,20 @@ module _BASE_UNIT: _BARE_UNIT { CFLAGS+=-DNLG_COVERAGE } - when ($GCC) { - select ($SANITIZER_TYPE) { - "address" ? { - LDFLAGS+=-static-libasan - } - "undefined" ? { - LDFLAGS+=-static-libubsan - } - "thread" ? { + when ($GCC) { + select ($SANITIZER_TYPE) { + "address" ? { + LDFLAGS+=-static-libasan + } + "undefined" ? { + LDFLAGS+=-static-libubsan + } + "thread" ? { PIE=yes LDFLAGS+=-static-libtsan - } - } - } + } + } + } when ($HARDENING == "yes") { when ($CLANG) { @@ -1223,16 +1223,16 @@ module _BASE_UNIT: _BARE_UNIT { } } - when ($USE_LTO == "yes") { - when ($GCC) { - CFLAGS+=-flto -fno-fat-lto-objects - LDFLAGS+=-flto - } - when ($CLANG) { + when ($USE_LTO == "yes") { + when ($GCC) { + CFLAGS+=-flto -fno-fat-lto-objects + LDFLAGS+=-flto + } + when ($CLANG) { CFLAGS+=-flto LDFLAGS+=-flto - } - } + } + } when ($USE_THINLTO == "yes") { when ($GCC) { @@ -1246,20 +1246,20 @@ module _BASE_UNIT: _BARE_UNIT { } - when ($CLANG) { - when ($PGO_ADD == "yes") { - CFLAGS+=-fprofile-instr-generate - LDFLAGS+=-fprofile-instr-generate - } - when ($PGO_PATH) { - CFLAGS+=-fprofile-instr-use=$PGO_PATH -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date - LDFLAGS+=-fprofile-instr-use=$PGO_PATH - } - } + when ($CLANG) { + when ($PGO_ADD == "yes") { + CFLAGS+=-fprofile-instr-generate + LDFLAGS+=-fprofile-instr-generate + } + when ($PGO_PATH) { + CFLAGS+=-fprofile-instr-use=$PGO_PATH -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date + LDFLAGS+=-fprofile-instr-use=$PGO_PATH + } + } when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { - PEERDIR+=$COMPILER_PLATFORM - } + PEERDIR+=$COMPILER_PLATFORM + } when ($OS_LINUX && $NEED_PLATFORM_PEERDIRS == "yes") { PEERDIR+=contrib/libs/linux-headers @@ -1288,21 +1288,21 @@ module _BASE_UNIT: _BARE_UNIT { PEERDIR+=util } - when ($MUSL == "yes") { + when ($MUSL == "yes") { CFLAGS += -D_musl_ LINK_DYN_LIB_FLAGS += --musl LINK_SCRIPT_EXE_FLAGS += --musl PEERDIR+=contrib/libs/musl/include - } + } # g++ has proxy C-headers which are incompatible with libc++ proxy C-headers. # The same problem exists for clang toolchain. On the other hand, the problem # doesn't affect cl since it has united C/C++ library and doesn't need # proxy C-headers. # Disable all C++ headers including proxy C-headers when we use libc++. - when ($USE_INTERNAL_STL == "yes" && $MSVC != "yes") { - CXXFLAGS += -nostdinc++ - } + when ($USE_INTERNAL_STL == "yes" && $MSVC != "yes") { + CXXFLAGS += -nostdinc++ + } when ($CODENAVIGATION && $NOCODENAVIGATION != "yes") { PEERDIR += build/external_resources/codenavigation @@ -1334,8 +1334,8 @@ module _BASE_UNIT: _BARE_UNIT { _REGISTER_NO_CHECK_IMPORTS() - DEFAULT(PACKAGE_PREFIX_ARGS) - + DEFAULT(PACKAGE_PREFIX_ARGS) + DEFAULT(BYACC_FLAGS -v) DEFAULT(SWIG_LANG python) DEFAULT(BISON_FLAGS -v) @@ -1346,44 +1346,44 @@ module _BASE_UNIT: _BARE_UNIT { } } -_LINKER_ID= -# GCC does not support -fuse-ld with an executable path, only -# -fuse-ld=bfd or -fuse-ld=gold (or -fuse-ld=lld in later versions). -when ($_LINKER_ID != "" && $_DEFAULT_LINKER_ID != "" && $CLANG == "yes" && $NEED_PLATFORM_PEERDIRS == "yes") { - when ($_LINKER_ID in [ "bfd", "gold", "lld" ]) { - PEERDIR+=build/platform/${_LINKER_ID} - } -} - -macro _USE_LINKER_IMPL(LINKER_ID...) { - SET(_LINKER_ID $LINKER_ID) -} - -macro _USE_LINKER() { - _USE_LINKER_IMPL($_DEFAULT_LINKER_ID) -} - -### @usage: USE_LINKER_BFD() -### Use bfd linker for a program. This doesn't work in libraries -macro USE_LINKER_BFD() { - _USE_LINKER_IMPL(bfd) -} -### @usage: USE_LINKER_GOLD() -### Use gold linker for a program. This doesn't work in libraries -macro USE_LINKER_GOLD() { - _USE_LINKER_IMPL(gold) -} -### @usage: USE_LINKER_LLD() -### Use lld linker for a program. This doesn't work in libraries -macro USE_LINKER_LLD() { - _USE_LINKER_IMPL(lld) -} - -COMMON_LINK_SETTINGS= +_LINKER_ID= +# GCC does not support -fuse-ld with an executable path, only +# -fuse-ld=bfd or -fuse-ld=gold (or -fuse-ld=lld in later versions). +when ($_LINKER_ID != "" && $_DEFAULT_LINKER_ID != "" && $CLANG == "yes" && $NEED_PLATFORM_PEERDIRS == "yes") { + when ($_LINKER_ID in [ "bfd", "gold", "lld" ]) { + PEERDIR+=build/platform/${_LINKER_ID} + } +} + +macro _USE_LINKER_IMPL(LINKER_ID...) { + SET(_LINKER_ID $LINKER_ID) +} + +macro _USE_LINKER() { + _USE_LINKER_IMPL($_DEFAULT_LINKER_ID) +} + +### @usage: USE_LINKER_BFD() +### Use bfd linker for a program. This doesn't work in libraries +macro USE_LINKER_BFD() { + _USE_LINKER_IMPL(bfd) +} +### @usage: USE_LINKER_GOLD() +### Use gold linker for a program. This doesn't work in libraries +macro USE_LINKER_GOLD() { + _USE_LINKER_IMPL(gold) +} +### @usage: USE_LINKER_LLD() +### Use lld linker for a program. This doesn't work in libraries +macro USE_LINKER_LLD() { + _USE_LINKER_IMPL(lld) +} + +COMMON_LINK_SETTINGS= LINK_ADDITIONAL_SECTIONS= LINK_ADDITIONAL_SECTIONS_COMMAND= -when ($COMMON_LINK_SETTINGS == "yes") { +when ($COMMON_LINK_SETTINGS == "yes") { when ($_LINKER_ID == "lld" || $_LINKER_ID == "gold") { LDFLAGS += -Wl,--gdb-index } @@ -1404,28 +1404,28 @@ when ($COMMON_LINK_SETTINGS == "yes") { LDFLAGS+=-Wl,-Map=${output;rootrel;pre=$MODULE_PREFIX;suf=.map.$_LINKER_ID:REALPRJNAME} } - when ($USE_MKL == "yes") { - NOPLATFORM=yes - } + when ($USE_MKL == "yes") { + NOPLATFORM=yes + } when (($USE_EAT_MY_DATA == "yes") && ($WIN32 != "yes") && ($DARWIN != "yes") && ($OS_ANDROID != "yes") && ($OS_IOS != "yes")) { PEERDIR+=contrib/libs/libeatmydata/autocheck_wrapper - } + } - when ($USE_ARCADIA_LIBM == "yes") { - PEERDIR+=contrib/libs/libm - } - when ($USE_ARCADIA_LIBM == "no") { + when ($USE_ARCADIA_LIBM == "yes") { + PEERDIR+=contrib/libs/libm + } + when ($USE_ARCADIA_LIBM == "no") { C_SYSTEM_LIBRARIES+=-lm - } + } when (($MUSL != "yes" && $WITH_VALGRIND == "yes") || $SANITIZER_DEFINED == "yes") { when ($ALLOCATOR in [ "TCMALLOC", "TCMALLOC_SMALL_BUT_SLOW", "TCMALLOC_NUMA_256K", "TCMALLOC_NUMA_LARGE_PAGES", "TCMALLOC_256K", "GOOGLE", "J", "LF", "LF_YT", "LF_DBG", "B", "BM", "C", "LOCKLESS", "YT", "MIM", "HU" ]) { PEERDIR+=library/cpp/malloc/system - } - } - otherwise { - select ($ALLOCATOR) { + } + } + otherwise { + select ($ALLOCATOR) { "MIM" ? { PEERDIR+=library/cpp/malloc/mimalloc } @@ -1452,59 +1452,59 @@ when ($COMMON_LINK_SETTINGS == "yes") { PEERDIR+=library/cpp/malloc/tcmalloc PEERDIR+=contrib/libs/tcmalloc/default } - "GOOGLE" ? { + "GOOGLE" ? { PEERDIR+=library/cpp/malloc/galloc - } - "J" ? { - when ($WIN32 == "yes") { + } + "J" ? { + when ($WIN32 == "yes") { PEERDIR+=library/cpp/malloc/system - } - otherwise { + } + otherwise { PEERDIR+=library/cpp/malloc/jemalloc - } - } - "LF" ? { + } + } + "LF" ? { PEERDIR+=library/cpp/lfalloc - } - "LF_YT" ? { + } + "LF_YT" ? { PEERDIR+=library/cpp/lfalloc/yt - } - "LF_DBG" ? { + } + "LF_DBG" ? { PEERDIR+=library/cpp/lfalloc/dbg - } - "B" ? { + } + "B" ? { PEERDIR+=library/cpp/balloc - } + } "BM" ? { PEERDIR+=library/cpp/balloc_market } "C" ? { PEERDIR+=library/cpp/malloc/calloc } - "LOCKLESS" ? { + "LOCKLESS" ? { PEERDIR+=library/cpp/malloc/lockless - } + } "YT" ? { PEERDIR+=library/cpp/ytalloc/impl } - } - } - - when ($ALLOCATOR == "SYSTEM") { + } + } + + when ($ALLOCATOR == "SYSTEM") { PEERDIR+=library/cpp/malloc/system - } + } when ($WERROR != "no") { - when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { + when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { C_WARNING_OPTS += $WERROR_FLAG - } - } + } + } - when ($ICC == "yes") { - PEERDIR+=contrib/libs/intel/core - } - when ($WITH_VALGRIND == "yes") { - PEERDIR+=contrib/libs/valgrind - } + when ($ICC == "yes") { + PEERDIR+=contrib/libs/intel/core + } + when ($WITH_VALGRIND == "yes") { + PEERDIR+=contrib/libs/valgrind + } } when ($EMBED_LINKER_MAP == "yes" || $EMBED_LINKER_CREF == "yes") { @@ -1535,64 +1535,64 @@ macro WITH_DYNAMIC_LIBS() { } # tag:internal -### $usage: REAL_LINK_EXE_IMPL(peers...) # internal -macro REAL_LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: REAL_LINK_EXE_IMPL(peers...) # internal +macro REAL_LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$REAL_LINK_EXE_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: REAL_LINK_EXEC_DYN_LIB_IMPL(peers...) # internal -macro REAL_LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { - .CMD=$REAL_LINK_EXEC_DYN_LIB_CMDLINE -} - +### $usage: REAL_LINK_EXEC_DYN_LIB_IMPL(peers...) # internal +macro REAL_LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { + .CMD=$REAL_LINK_EXEC_DYN_LIB_CMDLINE +} + # tag:internal -### $usage: REAL_LINK_DYN_LIB_IMPL(peers...) # internal -macro REAL_LINK_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: REAL_LINK_DYN_LIB_IMPL(peers...) # internal +macro REAL_LINK_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$REAL_LINK_DYN_LIB_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: LINK_EXE_IMPL(peers...) # internal -macro LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: LINK_EXE_IMPL(peers...) # internal +macro LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$LINK_EXE_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: LINK_EXEC_DYN_LIB_IMPL(peers...) # internal -macro LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { - .CMD=$LINK_EXEC_DYN_LIB_CMDLINE -} - +### $usage: LINK_EXEC_DYN_LIB_IMPL(peers...) # internal +macro LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { + .CMD=$LINK_EXEC_DYN_LIB_CMDLINE +} + # tag:internal -### @usage: _LINK_UNIT # internal -### -### The base of all linkable modules: programs, DLLs etc. Describes common linking logic. -module _LINK_UNIT: _BASE_UNIT { +### @usage: _LINK_UNIT # internal +### +### The base of all linkable modules: programs, DLLs etc. Describes common linking logic. +module _LINK_UNIT: _BASE_UNIT { .EXTS=.o .obj .supp .tidyjson .ld - .CMD=LINK_EXE + .CMD=LINK_EXE .ALLOWED=EXTRALIBS OBJADDE_GLOBAL RESOURCE_FILES - .NODE_TYPE=Program - .PEERDIR_POLICY=as_build_from - .FINAL_TARGET=yes + .NODE_TYPE=Program + .PEERDIR_POLICY=as_build_from + .FINAL_TARGET=yes .ALIASES=RES_REQUIREMENTS=PY_REQUIREMENTS - - DEFAULT(ALLOCATOR $DEFAULT_ALLOCATOR) - _USE_LINKER() - - #link with libunwind manually - when ($DARWIN == "yes" && $NOPLATFORM != "yes") { - PEERDIR += contrib/libs/cxxsupp - } - - when ($USE_LIBCXXRT == "yes") { - PEERDIR += contrib/libs/cxxsupp/libcxxrt - } - - ENABLE(COMMON_LINK_SETTINGS) + + DEFAULT(ALLOCATOR $DEFAULT_ALLOCATOR) + _USE_LINKER() + + #link with libunwind manually + when ($DARWIN == "yes" && $NOPLATFORM != "yes") { + PEERDIR += contrib/libs/cxxsupp + } + + when ($USE_LIBCXXRT == "yes") { + PEERDIR += contrib/libs/cxxsupp/libcxxrt + } + + ENABLE(COMMON_LINK_SETTINGS) CHECK_PROVIDES() -} - +} + MODULE_TYPE=UNKNOWN macro ADD_CLANG_TIDY() { @@ -1606,27 +1606,27 @@ macro ADD_CLANG_TIDY() { ### ### The base of all programs. It adds dependencies to make final artefact complete and runnable. module _BASE_PROGRAM: _LINK_UNIT { - .SYMLINK_POLICY=EXE - .ALLOWED=INDUCED_DEPS WHOLE_ARCHIVE + .SYMLINK_POLICY=EXE + .ALLOWED=INDUCED_DEPS WHOLE_ARCHIVE .GLOBAL=LDFLAGS _WHOLE_ARCHIVE_LIBS_VALUE RPATH - SET(MODULE_TYPE PROGRAM) - + SET(MODULE_TYPE PROGRAM) + when ($OS_IOS == "yes") { EXTS+=.ios.interface } - when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } - + when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } + when ($TIDY == "yes") { MODULE_SUFFIX=.tidyjson } when ($MSVC != "yes" && $NOPLATFORM != "yes" && $WITH_VALGRIND != "yes" && $USE_ASMLIB != "no" && $MIC_ARCH != "yes" && $PIC != "yes" && $PIE != "yes") { - PEERDIR+=contrib/libs/asmlib - } - + PEERDIR+=contrib/libs/asmlib + } + when ($MUSL == "yes") { when ($MUSL_LITE == "yes") { PEERDIR += contrib/libs/musl @@ -1645,13 +1645,13 @@ module _BASE_PROGRAM: _LINK_UNIT { PEERDIR += library/cpp/cpuid_check } - when ($USE_ARC_PROFILE == "yes" && $NOUTIL != "yes") { + when ($USE_ARC_PROFILE == "yes" && $NOUTIL != "yes") { PEERDIR += library/cpp/execprofile/autostart - } - - when ($SANITIZER_DEFINED == "yes") { - PEERDIR += contrib/libs/cxxsupp/libsan - } + } + + when ($SANITIZER_DEFINED == "yes") { + PEERDIR += contrib/libs/cxxsupp/libsan + } when ($CLANG_COVERAGE && $CLANG_COVERAGE != "no") { PEERDIR+=library/cpp/testing/dump_clang_coverage @@ -1666,7 +1666,7 @@ module _BASE_PROGRAM: _LINK_UNIT { } } -CPP_PROGRAM_SEM=add_executable $MODDIR $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} && vcs_info && target_link_flags PUBLIC $OBJADDE_LIB $OBJADDE +CPP_PROGRAM_SEM=add_executable $MODDIR $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} && vcs_info && target_link_flags PUBLIC $OBJADDE_LIB $OBJADDE ### @usage: PROGRAM([progname]) ### ### Regular program module. @@ -1750,13 +1750,13 @@ multimodule PY3_PROGRAM { # tag:ycr-specific macro _YCR_GENERATE_CONFIGS_INTL(Package, App, Configs...) { .CMD=${tool:"maps/infra/yacare/scripts/make_configs"} $Package $App ${cwd:BINDIR} ${output;hide;pre=debian/$Package/:Configs} -} - +} + # tag:ycr-specific macro _YCR_GENERATE_CONFIGS(Package, App) { .CMD=$_YCR_GENERATE_CONFIGS_INTL($Package $App ${pre=etc/yandex/maps/yacare/:App.conf} ${pre=etc/template_generator/templates/etc/logrotate.d/:App} ${pre=etc/nginx/sites-available/:App.conf} ${pre=etc/syslog-ng/conf-available/:App.conf} ${pre=etc/template_generator/config.d/:App.yaml} ${pre=/juggler/checks-available/yacare_;suf=/MANIFEST.json:App} ${pre=etc/yandex/maps/roquefort/:App.conf} ${pre=usr/lib/yandex/maps/yacare/lua/init_worker.d/rate_limiter_:App.lua} ${pre=usr/lib/yandex/maps/yacare/lua/init_worker.d/tvm_:App.lua} ${pre=usr/lib/yandex/maps/yacare/lua/init.d/tvm_:App.lua} ${pre=etc/template_generator/templates/etc/supervisor/conf-available/:App.conf} ${pre=etc/template_generator/templates/etc/yandex/unified_agent/conf.d/04_yacare_:App.yml}) -} - +} + # tag:ycr-specific when ($TIDY=="yes") { YCR_LINK_EXE=$LINK_EXE @@ -1764,16 +1764,16 @@ when ($TIDY=="yes") { otherwise { YCR_LINK_EXE=$LINK_EXE && $_YCR_GENERATE_CONFIGS($MODULE_PREFIX$REALPRJNAME $MODULE_PREFIX$REALPRJNAME) } - + # tag:ycr-specific ### @usage: YCR_PROGRAM([progname]) ### ### yacare-specific program module. Generates yacare configs in addition to producing the program. ### If name is not specified it will be generated from the name of the containing project directory. -module YCR_PROGRAM: PROGRAM { - .CMD=YCR_LINK_EXE -} - +module YCR_PROGRAM: PROGRAM { + .CMD=YCR_LINK_EXE +} + # tag:ycr-specific tag:python-specific macro _PYCR_GENERATE_CONFIGS_INTL(Package, App, Configs...) { .CMD=${tool:"maps/infra/pycare/scripts/make_configs"} $Package $App ${cwd:BINDIR} ${output;hide;pre=configs/:Configs} @@ -1803,8 +1803,8 @@ module PYCR_PROGRAM: PY3_PROGRAM_BIN { ### The other option use EXPORTS parameter of the DLL module itself. ### ### @see: [DLL](#module_DLL) -macro EXPORTS_SCRIPT(Arg) { - SET(EXPORTS_FILE $Arg) +macro EXPORTS_SCRIPT(Arg) { + SET(EXPORTS_FILE $Arg) } ### @usage: NO_EXPORT_DYNAMIC_SYMBOLS() @@ -1844,7 +1844,7 @@ module _BASE_UNITTEST: _BASE_PROGRAM { SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) } -UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME +UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME # tag:test ### @usage: UNITTEST([name]) ### @@ -1853,7 +1853,7 @@ UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#opisanievya.make1 module UNITTEST: _BASE_UNITTEST { - .SEM=UNITTEST_SEM + .SEM=UNITTEST_SEM PEERDIR(library/cpp/testing/unittest_main) ADD_YTEST($MODULE_PREFIX$REALPRJNAME unittest.py) SET(MODULE_LANG CPP) @@ -1884,7 +1884,7 @@ module UNITTEST_WITH_CUSTOM_ENTRY_POINT: _BASE_UNITTEST { ### ### Documentation: https://docs.yandex-team.ru/arcadia-cpp/cpp_test module GTEST: _BASE_UNITTEST { - .SEM=UNITTEST_SEM + .SEM=UNITTEST_SEM PEERDIR(library/cpp/testing/gtest library/cpp/testing/gtest_main) ADD_YTEST($MODULE_PREFIX$REALPRJNAME gunittest) SET(MODULE_LANG CPP) @@ -1906,19 +1906,19 @@ module FUZZ: _BASE_PROGRAM { .NODE_TYPE=Program .FINAL_TARGET=no .ALLOWED=FUZZ_DICTS FUZZ_OPTS - + DEFAULT(LIBFUZZER_PATH contrib/libs/libfuzzer12) - when ($USE_AFL == "no") { + when ($USE_AFL == "no") { PEERDIR+=$LIBFUZZER_PATH - } - when ($USE_AFL == "yes") { + } + when ($USE_AFL == "yes") { PEERDIR+=$LIBFUZZER_PATH/afl - } - - when (!$SANITIZER_TYPE || $SANITIZER_TYPE == "no") { - PEERDIR+=devtools/nofuzz - } - + } + + when (!$SANITIZER_TYPE || $SANITIZER_TYPE == "no") { + PEERDIR+=devtools/nofuzz + } + ADD_YTEST($MODULE_PREFIX$REALPRJNAME fuzz.test) } @@ -1978,8 +1978,8 @@ FUZZ_DICTS_VALUE= ### Should only be used in FUZZ modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/fuzzing/ -macro FUZZ_DICTS(Data...) { - SET_APPEND(FUZZ_DICTS_VALUE $Data) +macro FUZZ_DICTS(Data...) { + SET_APPEND(FUZZ_DICTS_VALUE $Data) } FUZZ_OPTS_VALUE= @@ -1997,8 +1997,8 @@ FUZZ_OPTS_VALUE= ### ) ### ### Documentation: https://wiki.yandex-team.ru/yatool/fuzzing/ -macro FUZZ_OPTS(Data...) { - SET_APPEND(FUZZ_OPTS_VALUE $Data) +macro FUZZ_OPTS(Data...) { + SET_APPEND(FUZZ_OPTS_VALUE $Data) } # tag:yt-specific tag:test @@ -2022,7 +2022,7 @@ TEST_SRCS_VALUE= ### In PY2TEST, PY3TEST and PY*_LIBRARY modules used as PY_SRCS macro and additionally used to mine test cases to be executed by testing framework. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynapytest -macro TEST_SRCS(Tests...) { +macro TEST_SRCS(Tests...) { SET_APPEND(TEST_SRCS_VALUE $Tests) } @@ -2041,8 +2041,8 @@ TEST_DATA_VALUE= ### Used only inside TEST modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#dannyeizrepozitorija -macro DATA(Data...) { - SET_APPEND(TEST_DATA_VALUE $Data) +macro DATA(Data...) { + SET_APPEND(TEST_DATA_VALUE $Data) ADD_CHECK(check.data $Data) } @@ -2054,8 +2054,8 @@ TEST_TAGS_VALUE= ### There are also special tags affecting test behaviour, for example ya:external, sb:ssd. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#obshhieponjatija -macro TAG(Tags...) { - SET_APPEND(TEST_TAGS_VALUE $Tags) +macro TAG(Tags...) { + SET_APPEND(TEST_TAGS_VALUE $Tags) } # tag:test @@ -2065,7 +2065,7 @@ TEST_REQUIREMENTS_VALUE= ### Allows you to specify the requirements of the test. ### ### Documentation about the Arcadia test system: https://wiki.yandex-team.ru/yatool/test/ -macro REQUIREMENTS(Tags...) { +macro REQUIREMENTS(Tags...) { SET_APPEND(TEST_REQUIREMENTS_VALUE $Tags) } @@ -2074,7 +2074,7 @@ TEST_ENV_VALUE= ### @usage: ENV(key[=value]) ### ### Sets env variable key to value (gets value from system env by default). -macro ENV(Data...) { +macro ENV(Data...) { SET_APPEND(TEST_ENV_VALUE ${quo:Data}) } @@ -2092,7 +2092,7 @@ TEST_RECIPES_VALUE= ### Provides prepared environment via recipe for test. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/recipes -macro USE_RECIPE(Data...) { +macro USE_RECIPE(Data...) { SET_APPEND(TEST_RECIPES_VALUE $Data) SET_APPEND(TEST_RECIPES_VALUE "USE_RECIPE_DELIM") } @@ -2104,8 +2104,8 @@ TEST_PYTHON_PATH_VALUE= ### @usage: PYTHON_PATH(Path) ### ### Set path to Python that will be used to runs scripts in tests -macro PYTHON_PATH(Path) { - SET(TEST_PYTHON_PATH_VALUE $Path) +macro PYTHON_PATH(Path) { + SET(TEST_PYTHON_PATH_VALUE $Path) } # tag:test @@ -2113,7 +2113,7 @@ SKIP_TEST_VALUE= ### @usage: SKIP_TEST(Reason) ### ### Skip the suite defined by test module. Provide a reason to be output in test execution report. -macro SKIP_TEST(Reason...) { +macro SKIP_TEST(Reason...) { SET(SKIP_TEST_VALUE $Reason) } @@ -2122,15 +2122,15 @@ LINT_LEVEL_VALUE=extended ### @usage: NO_LINT() ### ### Do not check for style files included in PY_SRCS, TEST_SRCS, JAVA_SRCS. -macro NO_LINT() { - SET(LINT_LEVEL_VALUE none) +macro NO_LINT() { + SET(LINT_LEVEL_VALUE none) } ### @usage: LINT(<none|base|strict>) ### ### Set linting levem for sources of the module -macro LINT(level) { - SET(LINT_LEVEL_VALUE $level) +macro LINT(level) { + SET(LINT_LEVEL_VALUE $level) } # tag:python-specific tag:test @@ -2149,13 +2149,13 @@ module _BASE_PYTEST: _BASE_PY_PROGRAM { .NODE_TYPE=Program .FINAL_TARGET=no .ALLOWED=YT_SPEC NO_DOCTESTS - when ($USE_ARCADIA_PYTHON == "yes") { - PEERDIR+=library/python/pytest - } - when ($USE_ARCADIA_PYTHON == "no") { - MODULE_SUFFIX=.pkg.fake - PEERDIR+=library/python/pytest/empty - } + when ($USE_ARCADIA_PYTHON == "yes") { + PEERDIR+=library/python/pytest + } + when ($USE_ARCADIA_PYTHON == "no") { + MODULE_SUFFIX=.pkg.fake + PEERDIR+=library/python/pytest/empty + } SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) } @@ -2166,7 +2166,7 @@ module _BASE_PYTEST: _BASE_PY_PROGRAM { ### Same as PY2TEST. Don't use this, use PY2TEST instead. module PYTEST_BIN: _BASE_PYTEST { .NODE_TYPE=Program - SETUP_PYTEST_BIN() + SETUP_PYTEST_BIN() } # tag:python-specific tag:test @@ -2328,9 +2328,9 @@ ADDITIONAL_PATH= # set for tests variables to fill it by YA_DEV or YA YA_ROOT=ya -when ($YA_DEV == "yes") { - YA_ROOT=ya-dev -} +when ($YA_DEV == "yes") { + YA_ROOT=ya-dev +} # tag:test @@ -2341,10 +2341,10 @@ when ($YA_DEV == "yes") { ### path/to/lib is the path to the directory with the LIBRARY project. ### ### Documentation about the Arcadia test system: https://wiki.yandex-team.ru/yatool/test/ -module UNITTEST_FOR: UNITTEST { +module UNITTEST_FOR: UNITTEST { .SEM=UNITTEST_SEM - PEERDIR(ADDINCL $UNITTEST_DIR) - SRCDIR($UNITTEST_DIR) + PEERDIR(ADDINCL $UNITTEST_DIR) + SRCDIR($UNITTEST_DIR) } ### @usage: _LIBRARY # internal @@ -2353,9 +2353,9 @@ module UNITTEST_FOR: UNITTEST { ### Contains basic logic like module properties, default variable values etc. ### All libraries similar to C++-libraries should be inherited from it. module _LIBRARY: _BASE_UNIT { - .CMD=LINK_LIB - .NODE_TYPE=Library - .PEERDIR_POLICY=as_include + .CMD=LINK_LIB + .NODE_TYPE=Library + .PEERDIR_POLICY=as_include .EXTS=.o .obj .a .mf .supp .tidyjson .ld .ALLOWED=GRPC USE_SKIFF EXTRALIBS OBJADDE_GLOBAL RESOURCE_FILES .GLOBAL=USER_CFLAGS USER_CXXFLAGS USER_CONLYFLAGS LDFLAGS SRCS _WHOLE_ARCHIVE_LIBS_VALUE RPATH @@ -2367,19 +2367,19 @@ module _LIBRARY: _BASE_UNIT { GLOBAL_SUFFIX=.global$MODULE_SUFFIX #TODO: Remove this hack (really we do not need add fake src at all) - ENABLE(NEED_ADD_FAKE_SRC) + ENABLE(NEED_ADD_FAKE_SRC) _REQUIRE_EXPLICIT_LICENSE(contrib/deprecated contrib/libs contrib/restricted contrib/python) CHECK_CONTRIB_CREDITS(contrib/clickhouse contrib/libs contrib/deprecated EXCEPT contrib/deprecated/python) - - when ($USE_MKL == "yes") { - NOPLATFORM=yes - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX= - MODULE_SUFFIX=.lib - } - otherwise { + + when ($USE_MKL == "yes") { + NOPLATFORM=yes + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX= + MODULE_SUFFIX=.lib + } + otherwise { when ($TIDY == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.tidyjson @@ -2388,21 +2388,21 @@ module _LIBRARY: _BASE_UNIT { MODULE_PREFIX=lib MODULE_SUFFIX=.a } - } - + } + when ($WERROR != "no") { - when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { + when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { C_WARNING_OPTS += $WERROR_FLAG - } - } + } + } - when ($WITH_VALGRIND == "yes") { - PEERDIR+=contrib/libs/valgrind - } - - when ($USE_ARCADIA_LIBM == "yes") { - PEERDIR+=contrib/libs/libm - } + when ($WITH_VALGRIND == "yes") { + PEERDIR+=contrib/libs/valgrind + } + + when ($USE_ARCADIA_LIBM == "yes") { + PEERDIR+=contrib/libs/libm + } } CPP_LIBRARY_SEM=add_library ${MODDIR} $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} \ @@ -2433,8 +2433,8 @@ CONAN_REQUIRE= ### It makes little sense to mention LIBRARY in DEPENDS or BUNDLE, package and deploy it since it is not a standalone entity. ### In order to use library in tests PEERDIR it to link into tests. ### If you think you need to distribute static library please contact devtools@ for assistance. -module LIBRARY: _LIBRARY { - .GLOBAL=_AARS _PROGUARD_RULES +module LIBRARY: _LIBRARY { + .GLOBAL=_AARS _PROGUARD_RULES .ALIASES=REQUIREMENTS=CC_REQUIREMENTS .SEM=CPP_LIBRARY_SEM .GLOBAL_SEM=CPP_OBJ_LIBRARY_SEM @@ -2456,7 +2456,7 @@ module LIBRARY: _LIBRARY { when ($HAS_CPP_PROTOBUF_PEERS == "yes") { PEERDIR+=$CPP_PROTOBUF_PEERS - } + } SET(MODULE_TYPE LIBRARY) SET(MODULE_LANG CPP) @@ -2464,29 +2464,29 @@ module LIBRARY: _LIBRARY { } # tag:internal -### @usage: _BARE_MODULE() # internal -### -### Remove unwanted dependencies for "empty" library module -macro _BARE_MODULE() { - SET(NEED_PLATFORM_PEERDIRS no) - SET(PEERDIR_TEST_TOOL no) - DISABLE(WITH_VALGRIND) - NO_CODENAVIGATION() - NO_PLATFORM() - NO_RUNTIME() - NO_UTIL() +### @usage: _BARE_MODULE() # internal +### +### Remove unwanted dependencies for "empty" library module +macro _BARE_MODULE() { + SET(NEED_PLATFORM_PEERDIRS no) + SET(PEERDIR_TEST_TOOL no) + DISABLE(WITH_VALGRIND) + NO_CODENAVIGATION() + NO_PLATFORM() + NO_RUNTIME() + NO_UTIL() NO_CLANG_TIDY() -} - +} + # tag:internal -### @usage: _BARE_LINK_MODULE() # internal -### -### Remove unwanted dependencies for "empty" link module -macro _BARE_LINK_MODULE() { - _BARE_MODULE() - ALLOCATOR(FAKE) -} - +### @usage: _BARE_LINK_MODULE() # internal +### +### Remove unwanted dependencies for "empty" link module +macro _BARE_LINK_MODULE() { + _BARE_MODULE() + ALLOCATOR(FAKE) +} + # tag:internal ### @usage: _CONDITIONAL_SRCS([USE_CONDITIONAL_SRCS] Files...) # internal ### @@ -2546,10 +2546,10 @@ otherwise { ### static libraries, local (from own SRCS) and global (from peers') object files. ### ### Designed for use in XCode projects for iOS. -module FAT_OBJECT: LIBRARY { +module FAT_OBJECT: LIBRARY { .ALLOWED=PACK_GLOBALS_IN_LIBRARY .CMD=LINK_FAT_OBJECT_CMD - .PEERDIR_POLICY=as_build_from + .PEERDIR_POLICY=as_build_from when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_SUFFIX=.global.lib @@ -2593,34 +2593,34 @@ _SONAME= ### Contains all general logic for such kind of modules. Supports versioning and export files. ### Cannot participate in linking to programs, intended to be used as final artifact (packaged and deployed). module DLL_UNIT: _LINK_UNIT { - .CMD=LINK_DYN_LIB - .NODE_TYPE=Library - .SYMLINK_POLICY=SO + .CMD=LINK_DYN_LIB + .NODE_TYPE=Library + .SYMLINK_POLICY=SO .GLOBAL=USER_CFLAGS USER_CXXFLAGS USER_CONLYFLAGS LDFLAGS _WHOLE_ARCHIVE_LIBS_VALUE RPATH - .ALLOWED=WHOLE_ARCHIVE + .ALLOWED=WHOLE_ARCHIVE DYNAMIC_LINK=yes - ALLOCATOR(FAKE) + ALLOCATOR(FAKE) SET(MODULE_TYPE DLL) SET(MODULE_TAG DLL) SET(MODULE_LANG CPP) ADD_CLANG_TIDY() - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.dll - } + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.dll + } elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib + MODULE_PREFIX=lib MODULE_SUFFIX=.dylib - } + } elsewhen ($TIDY == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.tidyjson } - otherwise { - MODULE_PREFIX=lib + otherwise { + MODULE_PREFIX=lib MODULE_SUFFIX=.so - } - + } + # This by now replicates ymake's bahavior. We'll get rid of SONAME setting in ymake and fix this code alltogether SONAME=${pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX:REALPRJNAME} when ($MODULE_VERSION) { @@ -2628,13 +2628,13 @@ module DLL_UNIT: _LINK_UNIT { } _SONAME=$SONAME$MODULE_VERSION - when ($LINUX == "yes") { + when ($LINUX == "yes") { # '-z notext' is needed for linking mkl into shared libraries - LDFLAGS += -Wl,-z,notext + LDFLAGS += -Wl,-z,notext when ($_NO_FIX_ELF != "yes") { LINK_DYN_LIB_FLAGS+=--fix-elf ${tool:"tools/fix_elf"} } - } + } when ($DARWIN == "yes") { LDFLAGS += -undefined dynamic_lookup @@ -2663,10 +2663,10 @@ module DLL_UNIT: _LINK_UNIT { ### ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/py_srcs/ module PY_ANY_MODULE: DLL_UNIT { - when ($MSVC != "yes" && $DARWIN != "yes") { - LDFLAGS+= -Wl,-Bsymbolic - } - + when ($MSVC != "yes" && $DARWIN != "yes") { + LDFLAGS+= -Wl,-Bsymbolic + } + when ($USE_ARCADIA_PYTHON == "no") { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python @@ -2676,8 +2676,8 @@ module PY_ANY_MODULE: DLL_UNIT { LDFLAGS+=$PYTHON_LIBRARIES } } - } - + } + # This by now replicates ymake's bahavior. We'll get rid of SONAME setting in ymake and fix this code alltogether SONAME=${pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX:REALPRJNAME} when ($MODULE_VERSION) { @@ -2686,18 +2686,18 @@ module PY_ANY_MODULE: DLL_UNIT { _SONAME=$SONAME$MODULE_VERSION # -bundle - when ($DARWIN == "yes") { + when ($DARWIN == "yes") { LDFLAGS+=-flat_namespace - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.pyd - } - otherwise { - MODULE_PREFIX= + } + otherwise { + MODULE_PREFIX= MODULE_SUFFIX=.so - } + } .RESTRICTED=USE_PYTHON2 USE_PYTHON3 PY_SRCS PY_MAIN } @@ -2771,17 +2771,17 @@ macro PYTHON3_MODULE() { ### 2. The resulting .so will have the prefix "lib". ### 3. Processing EXPORTS and PREFIX is the same as for DLL module ### This is native DLL, so it will select C++ version from PROTO_LIBRARY. -module R_MODULE: DLL_UNIT { - when ($DARWIN == "yes") { +module R_MODULE: DLL_UNIT { + when ($DARWIN == "yes") { LDFLAGS+=-flat_namespace -dynamiclib - } + } - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dll - } - - ADDINCL(contrib/libs/r-lang) + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dll + } + + ADDINCL(contrib/libs/r-lang) } ### @usage: DYNAMIC_LIBRARY_FROM(Paths) @@ -2801,20 +2801,20 @@ macro DYNAMIC_LIBRARY_FROM(Path...) { ### 3. PREFIX allows you to change the prefix of the output file (default DLL has the prefix "lib"). ### ### DLL cannot participate in linking to programs but can be used from Java or as final artifact (packaged and deployed). -module DLL: DLL_UNIT { - SET(MAKE_ONLY_SHARED_LIB yes) +module DLL: DLL_UNIT { + SET(MAKE_ONLY_SHARED_LIB yes) SET(MODULE_LANG CPP) when ($OS_WINDOWS) { - MODULE_SUFFIX=.dll - } + MODULE_SUFFIX=.dll + } # TODO: Make it possible to use this syntax - # DEFAULT(DLL_FOR_DIR no) - ### FIXME: XXX - ###when ($DLL_FOR_DIR != "no") { - ### SRCDIR($DLL_FOR_DIR) - ### ADDINCL($DLL_FOR_DIR) - ###} + # DEFAULT(DLL_FOR_DIR no) + ### FIXME: XXX + ###when ($DLL_FOR_DIR != "no") { + ### SRCDIR($DLL_FOR_DIR) + ### ADDINCL($DLL_FOR_DIR) + ###} } ### DLL_TOOL is a DLL that can be used as a LD_PRELOAD tool. @@ -2822,7 +2822,7 @@ module DLL_TOOL: DLL { # ymake resolves only program nodes as tools. .NODE_TYPE=Program } - + ### @usage: SO_PROGRAM(name major_ver [minor_ver] [EXPORTS symlist_file] [PREFIX prefix]) ### ### Executable dynamic library module defintion. @@ -2845,45 +2845,45 @@ module SO_PROGRAM: DLL { DLL_PROXY_CMD_MF=$GENERATE_MF && $COPY_CMD $AUTO_INPUT $TARGET # tag:internal -### @usage: DEV_DLL_PROXY() # internal -### -### The use of this module is strictly prohibited!!! -### This is a temporary and project-specific solution. +### @usage: DEV_DLL_PROXY() # internal +### +### The use of this module is strictly prohibited!!! +### This is a temporary and project-specific solution. module DEV_DLL_PROXY: _BARE_UNIT { - .NODE_TYPE=Library + .NODE_TYPE=Library .EXTS=.so .dll .dylib .mf - .CMD=DLL_PROXY_CMD_MF + .CMD=DLL_PROXY_CMD_MF DYNAMIC_LINK=yes - + when ($OS_WINDOWS == "yes") { - MODULE_SUFFIX=.dll - } - elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dylib$MODULE_VERSION - } - otherwise { - MODULE_PREFIX=lib - MODULE_SUFFIX=.so$MODULE_VERSION - } -} - + MODULE_SUFFIX=.dll + } + elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dylib$MODULE_VERSION + } + otherwise { + MODULE_PREFIX=lib + MODULE_SUFFIX=.so$MODULE_VERSION + } +} + # tag:internal -### @usage: DLL_PROXY() # internal -### -### The use of this module is strictly prohibited!!! -### This is a temporary and project-specific solution. -module DLL_PROXY: DEV_DLL_PROXY { +### @usage: DLL_PROXY() # internal +### +### The use of this module is strictly prohibited!!! +### This is a temporary and project-specific solution. +module DLL_PROXY: DEV_DLL_PROXY { .EXTS=.so .dylib .lib .mf - .PROXY=yes - .PEERDIR_POLICY=as_build_from + .PROXY=yes + .PEERDIR_POLICY=as_build_from SET(PEERDIR_TAGS DLL __EMPTY__) - + when ($OS_WINDOWS == "yes") { - MODULE_SUFFIX=.lib - } -} - + MODULE_SUFFIX=.lib + } +} + # tag:internal ### @usage: DYNAMIC_DEPS(Path...) # internal, temporary ### @@ -2930,15 +2930,15 @@ multimodule DYNAMIC_LIBRARY { } } -### @usage: GLOBAL_SRCS(filenames...) -### +### @usage: GLOBAL_SRCS(filenames...) +### ### Make all source files listed as GLOBAL. -### Call to GLOBAL_SRCS macro is equivalent to call to SRCS macro when each source file is marked with GLOBAL keyword. -### Arcadia root relative or project dir relative paths are supported for filenames arguments. GLOBAL keyword is not -### recognized for GLOBAL_SRCS in contrast to SRCS macro. -### -### @example: -### Consider the file to ya.make: +### Call to GLOBAL_SRCS macro is equivalent to call to SRCS macro when each source file is marked with GLOBAL keyword. +### Arcadia root relative or project dir relative paths are supported for filenames arguments. GLOBAL keyword is not +### recognized for GLOBAL_SRCS in contrast to SRCS macro. +### +### @example: +### Consider the file to ya.make: ### ### LIBRARY() ### GLOBAL_SRCS(foo.cpp bar.cpp) @@ -2949,13 +2949,13 @@ macro GLOBAL_SRCS(Files...) { SRCS(${pre=GLOBAL :Files}) } -### @usage: ALL_SRCS([GLOBAL] filenames...) -### +### @usage: ALL_SRCS([GLOBAL] filenames...) +### ### Make all source files listed as GLOBAL or not depending on the keyword GLOBAL -### Call to ALL_SRCS macro is equivalent to call to GLOBAL_SRCS macro when GLOBAL keyword is specified -### as the first argument and is equivalent to call to SRCS macro otherwise. -### -### @example: +### Call to ALL_SRCS macro is equivalent to call to GLOBAL_SRCS macro when GLOBAL keyword is specified +### as the first argument and is equivalent to call to SRCS macro otherwise. +### +### @example: ### ### LIBRARY() ### SET(MAKE_IT_GLOBAL GLOBAL) @@ -2963,10 +2963,10 @@ macro GLOBAL_SRCS(Files...) { ### END() ### ### @see: [GLOBAL_SRCS()](#macro_GLOBAL_SRCS), [SRCS()](#macro_SRCS) -macro ALL_SRCS(GLOBAL?"GLOBAL":"", Files...) { - SRCS(${pre=$GLOBAL :Files}) -} - +macro ALL_SRCS(GLOBAL?"GLOBAL":"", Files...) { + SRCS(${pre=$GLOBAL :Files}) +} + ### @usage: _DLL_COMPATIBLE_LIBRARY # internal ### ### Base module to place DLLs into multimodules back to back with libraries. @@ -2989,15 +2989,15 @@ PACKED_PACKAGE_EXT= ### Is not allowed other module types than PACKAGE(). ### ### @see: [PACKAGE()](#module_PACKAGE) -macro PACK(Ext) { - SET(PACKED_PACKAGE_EXT $Ext) -} - -PACKAGE_STRICT_VALUE= -macro PACKAGE_STRICT() { - SET(PACKAGE_STRICT_VALUE yes) +macro PACK(Ext) { + SET(PACKED_PACKAGE_EXT $Ext) } +PACKAGE_STRICT_VALUE= +macro PACKAGE_STRICT() { + SET(PACKAGE_STRICT_VALUE yes) +} + ### @usage: PACKAGE(name) ### ### Module collects what is described directly inside it, builds and collects all its transitively available PEERDIRs. @@ -3011,16 +3011,16 @@ macro PACKAGE_STRICT() { ### @see: [PACK()](#macro_PACK) module PACKAGE: _BASE_UNIT { .CMD=TOUCH_PACKAGE_MF - .PEERDIR_POLICY=as_build_from - .ALL_INS_TO_OUT=yes + .PEERDIR_POLICY=as_build_from + .ALL_INS_TO_OUT=yes .FINAL_TARGET=yes .ALLOWED=PACK - SET(MODULE_SUFFIX .pkg.fake) + SET(MODULE_SUFFIX .pkg.fake) SET(DONT_RESOLVE_INCLUDES yes) - NO_PLATFORM() - when ($PACKED_PACKAGE_EXT) { + NO_PLATFORM() + when ($PACKED_PACKAGE_EXT) { PACKED_PACKAGE_ARGS+=--dest-arch ${output;pre=$MODULE_PREFIX;suf=.$PACKED_PACKAGE_EXT:REALPRJNAME} - } + } SET(NEED_PLATFORM_PEERDIRS no) PEERDIR_TAGS=CPP_PROTO CPP_FBS PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ DOCBOOK JAR_RUNNABLE PY3_BIN PY3TEST_PROGRAM DLL } @@ -3071,10 +3071,10 @@ macro RESOLVE_PROTO() { ### ### Documentation: https://wiki.yandex-team.ru/yatool/large-data/ module UNION: _BASE_UNIT { - .ALL_INS_TO_OUT=yes + .ALL_INS_TO_OUT=yes .FINAL_TARGET=no - NO_PLATFORM() - SET(MODULE_SUFFIX .pkg.fake) + NO_PLATFORM() + SET(MODULE_SUFFIX .pkg.fake) SET(DONT_RESOLVE_INCLUDES yes) .CMD=TOUCH_UNIT_MF SET(NEED_PLATFORM_PEERDIRS no) @@ -3082,160 +3082,160 @@ module UNION: _BASE_UNIT { } # tag:python-specific -module _PY_PACKAGE: UNION { - .EXTS=.py - .ALL_INS_TO_OUT=yes +module _PY_PACKAGE: UNION { + .EXTS=.py + .ALL_INS_TO_OUT=yes .ALLOWED=GRPC USE_SKIFF - ENABLE(PY_PROTOS_FOR) - SET(PEERDIR_TAGS PY_PROTO) + ENABLE(PY_PROTOS_FOR) + SET(PEERDIR_TAGS PY_PROTO) SET(DONT_RESOLVE_INCLUDES no) -} +} # tag:python-specific tag:deprecated tag:internal ### @usage: PY_PACKAGE(name) # internal, deprecated ### ### This is module created via PY_PROTOS_FOR() macro -module PY_PACKAGE: _PY_PACKAGE { +module PY_PACKAGE: _PY_PACKAGE { .FINAL_TARGET=yes } -# tag:internal -### @usage: _SET_FIRST_VALUE(name args...) # interanl -### -### This macro sets the value of `name` vraiable to the value of next argument -macro _SET_FIRST_VALUE(NAME, VALUE, OTHER...) { - SET($NAME $VALUE) -} - -# tag:internal -macro _EVAL_HIDE_TOOLS(ARGS...) { - .CMD=${tool;hide:ARGS} -} - -# tag:internal -macro _EVAL_HIDE_INPUTS(ARGS...) { - .CMD=${input;hide:ARGS} -} - +# tag:internal +### @usage: _SET_FIRST_VALUE(name args...) # interanl +### +### This macro sets the value of `name` vraiable to the value of next argument +macro _SET_FIRST_VALUE(NAME, VALUE, OTHER...) { + SET($NAME $VALUE) +} + +# tag:internal +macro _EVAL_HIDE_TOOLS(ARGS...) { + .CMD=${tool;hide:ARGS} +} + +# tag:internal +macro _EVAL_HIDE_INPUTS(ARGS...) { + .CMD=${input;hide:ARGS} +} + # tag:docs -_DOCS_USE_PLANTUML=no -_DOCS_EXTRA_TOOLS= -_DOCS_EXTRA_INPUTS= -_DOCS_ENV= -_DOCS_KV=${kv;hide:"p DO"} ${kv;hide:"pc light-cyan"} ${kv;hide:"show_out yes"} - -_DOCS_PLANTUML_ENV=\ -${env:"JAVA_PATH=$JDK_RESOURCE_GLOBAL/bin/java"} \ -${env:"PLANTUML_PATH=${ARCADIA_BUILD_ROOT}/contrib/tools/plantuml/plantuml.run.cp.jar"} \ -${env:"_JAVA_OPTIONS=-Dsun.awt.fontconfig=$BINDIR/fontconfig.properties"} \ -${env:"LANG=en_US.UTF-8"} \ -${env:"LC_ALL=C.UTF-8"} - -_DOCS_BOOK_CMD=$TOUCH_DOCS_MF -_DOCS_LIB_CMD=$TOUCH_DOCS_MF - -_DOCS_VARS_FLAG= - -_DOCS_COMMON_PROCESS_DEPS= -_DOCS_COMMON_LIB_PROCESS_DEPS= - -_DOCS_YFM_OUTPUT_FORMAT= -_DOCS_YFM_BOOK_OUTPUT_FORMAT=--output-format html --allowHTML -_DOCS_YFM_LIB_OUTPUT_FORMAT=--output-format md -_DOCS_YFM_BOOK_PROCESS_DEPS=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/extract_docs.py"} --skip-prefix $ARCADIA_BUILD_ROOT --dest-dir $BINDIR/__s ${rootrel:PEERS} - -_DOCS_COMMON_CMDLINE_PREFIX=\ -${cwd:ARCADIA_ROOT} $FS_TOOLS copy_all_files $_DOCS_DIR_VALUE $BINDIR/__s $_DOCS_SRCS_VALUE \ -&& $_DOCS_COMMON_PROCESS_DEPS \ -&& $YMAKE_PYTHON ${input:"build/scripts/copy_files_to_dir.py"} --dest-dir $BINDIR/__s --skip-prefix $ARCADIA_ROOT --skip-prefix $ARCADIA_BUILD_ROOT ${input;context=TEXT:INCLUDE_SRCS} - -_DOCS_YFM_BOOK_CMDLINIE=\ -$_DOCS_COMMON_CMDLINE_PREFIX \ -&& $YMAKE_PYTHON ${input:"build/scripts/stdout2stderr.py"} $YFM_TOOL_RESOURCE_GLOBAL/yfm-docs --input $BINDIR/__s --output $BINDIR/__docsbuild $_DOCS_VARS_FLAG $_DOCS_YFM_OUTPUT_FORMAT --config ${input:CONFIG} $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV \ -&& $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --output $TARGET --input $BINDIR/__docsbuild $_DOCS_KV - -# tag:internal tag:docs -macro _DOCS_YFM_BOOK_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { - .CMD=$_DOCS_YFM_BOOK_CMDLINIE -} - -_DOCS_YFM_CMD=$_DOCS_YFM_BOOK_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE EXTRA_INPUTS $_DOCS_EXTRA_INPUTS) - -_DOCS_MKDOCS_CMDLINE_SUFFIX= -_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX=${pre=--dep ;ext=preprocessed.tar.gz:PEERS} -_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX=--preprocess-md-only -_DOCS_MKDOCS_BOOK_PROCESS_DEPS= - -_DOCS_MKDOCS_CMDLINIE=\ -$_DOCS_COMMON_CMDLINE_PREFIX \ -&& ${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/mkdocs_builder_wrapper.py"} $ARCADIA_BUILD_ROOT ${tool:"tools/mkdocs_builder"} --docs-dir $BINDIR/__s --output-tar $TARGET --config ${input:CONFIG} $_DOCS_VARS_FLAG $_DOCS_MKDOCS_CMDLINE_SUFFIX $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV $_DOCS_KV - -macro _DOCS_MKDOCS_CMD_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { - .CMD=$_DOCS_MKDOCS_CMDLINIE -} - -_DOCS_MKDOCS_CMD=$_DOCS_MKDOCS_CMD_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE) - -_DOCS_YFM_DEFAULT_CONFIG=$MODDIR/.yfm -_DOCS_MKDOCS_DEFAULT_CONFIG=$MODDIR/mkdocs.yml - -### FIXME(snermolaev) -module _DOCS_BASE_UNIT: _BARE_UNIT { - .ALLOWED=DOCS_DIR DOCS_CONFIG DOCS_VARS - .CMD=TOUCH_DOCS_MF - .FINAL_TARGET=no - - ENABLE(_DOCS_BASE_UNIT) - - SET(MODULE_SUFFIX .tar.gz) +_DOCS_USE_PLANTUML=no +_DOCS_EXTRA_TOOLS= +_DOCS_EXTRA_INPUTS= +_DOCS_ENV= +_DOCS_KV=${kv;hide:"p DO"} ${kv;hide:"pc light-cyan"} ${kv;hide:"show_out yes"} + +_DOCS_PLANTUML_ENV=\ +${env:"JAVA_PATH=$JDK_RESOURCE_GLOBAL/bin/java"} \ +${env:"PLANTUML_PATH=${ARCADIA_BUILD_ROOT}/contrib/tools/plantuml/plantuml.run.cp.jar"} \ +${env:"_JAVA_OPTIONS=-Dsun.awt.fontconfig=$BINDIR/fontconfig.properties"} \ +${env:"LANG=en_US.UTF-8"} \ +${env:"LC_ALL=C.UTF-8"} + +_DOCS_BOOK_CMD=$TOUCH_DOCS_MF +_DOCS_LIB_CMD=$TOUCH_DOCS_MF + +_DOCS_VARS_FLAG= + +_DOCS_COMMON_PROCESS_DEPS= +_DOCS_COMMON_LIB_PROCESS_DEPS= + +_DOCS_YFM_OUTPUT_FORMAT= +_DOCS_YFM_BOOK_OUTPUT_FORMAT=--output-format html --allowHTML +_DOCS_YFM_LIB_OUTPUT_FORMAT=--output-format md +_DOCS_YFM_BOOK_PROCESS_DEPS=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/extract_docs.py"} --skip-prefix $ARCADIA_BUILD_ROOT --dest-dir $BINDIR/__s ${rootrel:PEERS} + +_DOCS_COMMON_CMDLINE_PREFIX=\ +${cwd:ARCADIA_ROOT} $FS_TOOLS copy_all_files $_DOCS_DIR_VALUE $BINDIR/__s $_DOCS_SRCS_VALUE \ +&& $_DOCS_COMMON_PROCESS_DEPS \ +&& $YMAKE_PYTHON ${input:"build/scripts/copy_files_to_dir.py"} --dest-dir $BINDIR/__s --skip-prefix $ARCADIA_ROOT --skip-prefix $ARCADIA_BUILD_ROOT ${input;context=TEXT:INCLUDE_SRCS} + +_DOCS_YFM_BOOK_CMDLINIE=\ +$_DOCS_COMMON_CMDLINE_PREFIX \ +&& $YMAKE_PYTHON ${input:"build/scripts/stdout2stderr.py"} $YFM_TOOL_RESOURCE_GLOBAL/yfm-docs --input $BINDIR/__s --output $BINDIR/__docsbuild $_DOCS_VARS_FLAG $_DOCS_YFM_OUTPUT_FORMAT --config ${input:CONFIG} $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV \ +&& $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --output $TARGET --input $BINDIR/__docsbuild $_DOCS_KV + +# tag:internal tag:docs +macro _DOCS_YFM_BOOK_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { + .CMD=$_DOCS_YFM_BOOK_CMDLINIE +} + +_DOCS_YFM_CMD=$_DOCS_YFM_BOOK_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE EXTRA_INPUTS $_DOCS_EXTRA_INPUTS) + +_DOCS_MKDOCS_CMDLINE_SUFFIX= +_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX=${pre=--dep ;ext=preprocessed.tar.gz:PEERS} +_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX=--preprocess-md-only +_DOCS_MKDOCS_BOOK_PROCESS_DEPS= + +_DOCS_MKDOCS_CMDLINIE=\ +$_DOCS_COMMON_CMDLINE_PREFIX \ +&& ${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/mkdocs_builder_wrapper.py"} $ARCADIA_BUILD_ROOT ${tool:"tools/mkdocs_builder"} --docs-dir $BINDIR/__s --output-tar $TARGET --config ${input:CONFIG} $_DOCS_VARS_FLAG $_DOCS_MKDOCS_CMDLINE_SUFFIX $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV $_DOCS_KV + +macro _DOCS_MKDOCS_CMD_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { + .CMD=$_DOCS_MKDOCS_CMDLINIE +} + +_DOCS_MKDOCS_CMD=$_DOCS_MKDOCS_CMD_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE) + +_DOCS_YFM_DEFAULT_CONFIG=$MODDIR/.yfm +_DOCS_MKDOCS_DEFAULT_CONFIG=$MODDIR/mkdocs.yml + +### FIXME(snermolaev) +module _DOCS_BASE_UNIT: _BARE_UNIT { + .ALLOWED=DOCS_DIR DOCS_CONFIG DOCS_VARS + .CMD=TOUCH_DOCS_MF + .FINAL_TARGET=no + + ENABLE(_DOCS_BASE_UNIT) + + SET(MODULE_SUFFIX .tar.gz) SET(MODULE_LANG DOCS) - DEFAULT(_DOCS_BUILDER_VALUE yfm) - DEFAULT(_DOCS_DIR_VALUE ${MODDIR}) - select ($_DOCS_BUILDER) { - "yfm" ? { - PEERDIR+=build/platform/yfm - _DOCS_BOOK_CMD=$_DOCS_YFM_CMD - _DOCS_LIB_CMD=$_DOCS_YFM_CMD - _DOCS_DEFAULT_CONFIG=$_DOCS_YFM_DEFAULT_CONFIG - _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_YFM_BOOK_PROCESS_DEPS - } - "mkdocs" ? { - _DOCS_BOOK_CMD=$_DOCS_MKDOCS_CMD - _DOCS_LIB_CMD=$_DOCS_MKDOCS_CMD - _DOCS_DEFAULT_CONFIG=$_DOCS_MKDOCS_DEFAULT_CONFIG - _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_MKDOCS_BOOK_PROCESS_DEPS - } - } -} - -# tag:internal tag:docs -### _DOCS_EPILOOGUE() # internal -### -### This macro executes macros which should be envoked after all user -### specified macros in the ya.make file -macro _DOCS_EPILOGUE() { - SET(_DOCS_BUILDER $_DOCS_BUILDER_VALUE) - - _LATE_GLOB(_DOCS_SRCS_GLOB ${pre=${ARCADIA_ROOT}/;suf=/**/*:_DOCS_DIR_VALUE}) - SET(_DOCS_SRCS_VALUE \${input;hide:_DOCS_SRCS_GLOB}) -} - -# tag:internal tag:docs -### _DOCS_YFM_USE_PLANTUML() # internal -### -### This macr sets appropriate dependencies for use of plantuml plugin -macro _DOCS_YFM_USE_PLANTUML() { - PEERDIR(build/platform/java/jdk contrib/java/openjdk-fontconfig) - COPY_FILE(${ARCADIA_BUILD_ROOT}/contrib/java/openjdk-fontconfig/fontconfig.properties fontconfig.properties) - SET_APPEND(_DOCS_EXTRA_TOOLS \${hide;tool:"contrib/tools/plantuml"}) - SET_APPEND(_DOCS_EXTRA_INPUTS fontconfig.properties) - # It's rather strange that a commented statement below doesn't work - # SET_APPEND(_DOCS_ENV ${_DOCS_PLANTUML_ENV}) - when ($_DOCS_USE_PLANTUML) { - _DOCS_ENV+=$_DOCS_PLANTUML_ENV - } -} - + DEFAULT(_DOCS_BUILDER_VALUE yfm) + DEFAULT(_DOCS_DIR_VALUE ${MODDIR}) + select ($_DOCS_BUILDER) { + "yfm" ? { + PEERDIR+=build/platform/yfm + _DOCS_BOOK_CMD=$_DOCS_YFM_CMD + _DOCS_LIB_CMD=$_DOCS_YFM_CMD + _DOCS_DEFAULT_CONFIG=$_DOCS_YFM_DEFAULT_CONFIG + _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_YFM_BOOK_PROCESS_DEPS + } + "mkdocs" ? { + _DOCS_BOOK_CMD=$_DOCS_MKDOCS_CMD + _DOCS_LIB_CMD=$_DOCS_MKDOCS_CMD + _DOCS_DEFAULT_CONFIG=$_DOCS_MKDOCS_DEFAULT_CONFIG + _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_MKDOCS_BOOK_PROCESS_DEPS + } + } +} + +# tag:internal tag:docs +### _DOCS_EPILOOGUE() # internal +### +### This macro executes macros which should be envoked after all user +### specified macros in the ya.make file +macro _DOCS_EPILOGUE() { + SET(_DOCS_BUILDER $_DOCS_BUILDER_VALUE) + + _LATE_GLOB(_DOCS_SRCS_GLOB ${pre=${ARCADIA_ROOT}/;suf=/**/*:_DOCS_DIR_VALUE}) + SET(_DOCS_SRCS_VALUE \${input;hide:_DOCS_SRCS_GLOB}) +} + +# tag:internal tag:docs +### _DOCS_YFM_USE_PLANTUML() # internal +### +### This macr sets appropriate dependencies for use of plantuml plugin +macro _DOCS_YFM_USE_PLANTUML() { + PEERDIR(build/platform/java/jdk contrib/java/openjdk-fontconfig) + COPY_FILE(${ARCADIA_BUILD_ROOT}/contrib/java/openjdk-fontconfig/fontconfig.properties fontconfig.properties) + SET_APPEND(_DOCS_EXTRA_TOOLS \${hide;tool:"contrib/tools/plantuml"}) + SET_APPEND(_DOCS_EXTRA_INPUTS fontconfig.properties) + # It's rather strange that a commented statement below doesn't work + # SET_APPEND(_DOCS_ENV ${_DOCS_PLANTUML_ENV}) + when ($_DOCS_USE_PLANTUML) { + _DOCS_ENV+=$_DOCS_PLANTUML_ENV + } +} + # tag:docs ### @usage: DOCS() ### @@ -3248,56 +3248,56 @@ macro _DOCS_YFM_USE_PLANTUML() { ### ### @see: [DOCS_DIR()](#macro_DOCS_DIR), [DOCS_CONFIG()](#macro_DOCS_CONFIG), [DOCS_VARS()](#macro_DOCS_VARS), [DOCS_BUILDER()](#macro_DOCS_BUILDER). multimodule DOCS { - module DOCSBOOK: _DOCS_BASE_UNIT { - .CMD=_DOCS_BOOK_CMD - .EPILOGUE=_DOCS_EPILOGUE + module DOCSBOOK: _DOCS_BASE_UNIT { + .CMD=_DOCS_BOOK_CMD + .EPILOGUE=_DOCS_EPILOGUE .FINAL_TARGET=yes - .PEERDIR_POLICY=as_build_from - - ENABLE(DOCSBOOK) - - SET(MODULE_TYPE PROGRAM) + .PEERDIR_POLICY=as_build_from + + ENABLE(DOCSBOOK) + + SET(MODULE_TYPE PROGRAM) SET(PEERDIR_TAGS DOCSLIB) SET(MODULE_TAG DOCBOOK) - - _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_BOOK_OUTPUT_FORMAT - _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX - _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_BOOK_PROCESS_DEPS - + + _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_BOOK_OUTPUT_FORMAT + _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX + _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_BOOK_PROCESS_DEPS + PROCESS_DOCS() } - - module DOCSLIB: _DOCS_BASE_UNIT { - .CMD=_DOCS_LIB_CMD - .EPILOGUE=_DOCS_EPILOGUE - .PEERDIR_POLICY=as_include - - ENABLE(DOCSLIB) - - SET(MODULE_TYPE LIBRARY) + + module DOCSLIB: _DOCS_BASE_UNIT { + .CMD=_DOCS_LIB_CMD + .EPILOGUE=_DOCS_EPILOGUE + .PEERDIR_POLICY=as_include + + ENABLE(DOCSLIB) + + SET(MODULE_TYPE LIBRARY) SET(PEERDIR_TAGS DOCSLIB) SET(MODULE_TAG DOCSLIB) - - REALPRJNAME=preprocessed - - _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_LIB_OUTPUT_FORMAT - _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX - _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_LIB_PROCESS_DEPS - - PROCESS_DOCS() + + REALPRJNAME=preprocessed + + _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_LIB_OUTPUT_FORMAT + _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX + _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_LIB_PROCESS_DEPS + + PROCESS_DOCS() } } # tag:docs -_DOCS_USE_PLANTUML= -### @usage: USE_PLANTUML() -### -### Use PlantUML plug-in for yfm builder to render UML diagrams into documentation -macro USE_PLANTUML() { - ENABLE(_DOCS_USE_PLANTUML) -} - -# tag:docs +_DOCS_USE_PLANTUML= +### @usage: USE_PLANTUML() +### +### Use PlantUML plug-in for yfm builder to render UML diagrams into documentation +macro USE_PLANTUML() { + ENABLE(_DOCS_USE_PLANTUML) +} + +# tag:docs DOCSBUILDER=yfm ### @usage: DOCS_BUILDER(tool) ### @@ -3306,7 +3306,7 @@ DOCSBUILDER=yfm ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_BUILDER(DocsTool) { - SET(_DOCS_BUILDER_VALUE $DocsTool) + SET(_DOCS_BUILDER_VALUE $DocsTool) } # tag:docs @@ -3317,12 +3317,12 @@ macro DOCS_BUILDER(DocsTool) { ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_DIR(Dir) { - SET(_DOCS_DIR_VALUE $Dir) + SET(_DOCS_DIR_VALUE $Dir) } # tag:docs -_DOCS_DEFAULT_CONFIG= -_DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG +_DOCS_DEFAULT_CONFIG= +_DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG ### @usage: DOCS_CONFIG(path) ### ### Specify path to config file for DOCS multimodule if it differs from default path. @@ -3332,11 +3332,11 @@ _DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_CONFIG(File) { - SET(_DOCS_CONFIG_VALUE $File) + SET(_DOCS_CONFIG_VALUE $File) } # tag:docs -_DOCS_VARS_VALUE= +_DOCS_VARS_VALUE= ### @usage: DOCS_VARS(variable1=value1 variable2=value2 ...) ### ### Specify a set of default values of template variables for DOCS multimodule. @@ -3344,11 +3344,11 @@ _DOCS_VARS_VALUE= ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_VARS(Args...) { - SET_APPEND(_DOCS_VARS_VALUE $Args) + SET_APPEND(_DOCS_VARS_VALUE $Args) } # tag:docs -_DOCS_INCLUDE_SOURCES_VALUE= +_DOCS_INCLUDE_SOURCES_VALUE= ### @usage: DOCS_INCLUDE_SOURCES(path...) ### ### Specify a list of paths to source code files which will be used as text includes in a documentation project. @@ -3356,7 +3356,7 @@ _DOCS_INCLUDE_SOURCES_VALUE= ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_INCLUDE_SOURCES(Args...) { - SET_APPEND(_DOCS_INCLUDE_SOURCES_VALUE $Args) + SET_APPEND(_DOCS_INCLUDE_SOURCES_VALUE $Args) } # tag:python-specific @@ -3367,8 +3367,8 @@ PY_NAMESPACE_VALUE= ### ### Sets default Python namespace for all python sources in the module. ### Especially suitable in PROTO_LIBRARY where Python sources are generated and there is no PY_SRCS to place NAMESPACE parameter. -macro PY_NAMESPACE(Arg) { - SET(PY_NAMESPACE_VALUE $Arg) +macro PY_NAMESPACE(Arg) { + SET(PY_NAMESPACE_VALUE $Arg) } # tag:internal @@ -3409,9 +3409,9 @@ macro EMBED_JAVA_VCS_INFO() { ### PEERDIR it from JAVA_LIBRARY or JAVA_PROGRAM for export to Maven. module EXTERNAL_JAVA_LIBRARY: _BASE_UNIT { .EXTS=.jsrc .java .jar .mf - .NODE_TYPE=Bundle + .NODE_TYPE=Bundle .CMD=COMPILE_JAVA_MF - .PEERDIR_POLICY=as_build_from + .PEERDIR_POLICY=as_build_from .FINAL_TARGET=no .ALIASES=SRCS=_SRCS_NO_GLOBAL .ALLOWED=EMBED_JAVA_VCS_INFO @@ -3420,20 +3420,20 @@ module EXTERNAL_JAVA_LIBRARY: _BASE_UNIT { PEERDIR(build/platform/java/jdk) PEERDIR+=$JDK_RESOURCE_PEERDIR - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL PROPAGATES_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes MACRO_ALIAS(PROTO_CMD _JAVA_PROTO_CMD) MACRO_ALIAS(EVLOG_CMD _JAVA_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) - when ($PACKAGE_PREFIX) { - PACKAGE_PREFIX_ARGS=--package-prefix=$PACKAGE_PREFIX - } + when ($PACKAGE_PREFIX) { + PACKAGE_PREFIX_ARGS=--package-prefix=$PACKAGE_PREFIX + } - DISABLE(NEED_PLATFORM_PEERDIRS) - NO_PLATFORM() - SET(MODULE_SUFFIX .jar) + DISABLE(NEED_PLATFORM_PEERDIRS) + NO_PLATFORM() + SET(MODULE_SUFFIX .jar) SET(MODULE_LANG JAVA) } @@ -3528,13 +3528,13 @@ module _JAR_BASE: _BARE_UNIT { .ALIASES=SRCS=_SRCS_NO_GLOBAL .ALLOWED=EMBED_JAVA_VCS_INFO DEPENDENCY_MANAGEMENT EXCLUDE - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes MACRO_ALIAS(PROTO_CMD _JAVA_PROTO_CMD) MACRO_ALIAS(EVLOG_CMD _JAVA_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) DISABLE(NEED_PLATFORM_PEERDIRS) NO_PLATFORM() @@ -3557,9 +3557,9 @@ LOCAL_JAR_PATH= LOCAL_SOURCES_JAR_PATH= JAR_RESOURCE_ID= SRC_RESOURCE_ID= -FETCH_SRCS_JAR= +FETCH_SRCS_JAR= FETCH_TARGET_JAR= -FETCH_CONTRIB_JAR=$FETCH_TARGET_JAR $FETCH_SRCS_JAR +FETCH_CONTRIB_JAR=$FETCH_TARGET_JAR $FETCH_SRCS_JAR # tag:java-specific macro JAR_RESOURCE(Id) { @@ -3600,14 +3600,14 @@ module JAVA_CONTRIB: _JAR_BASE { } } when ($SRC_RESOURCE_ID) { - FETCH_SRCS_JAR= && $_FETCH_CONTRIB($SRC_RESOURCE_ID ${BINDIR}/${REALPRJNAME}-sources.jar) + FETCH_SRCS_JAR= && $_FETCH_CONTRIB($SRC_RESOURCE_ID ${BINDIR}/${REALPRJNAME}-sources.jar) } otherwise { when ($LOCAL_SOURCES_JAR_PATH) { - FETCH_SRCS_JAR= && $FS_TOOLS copy ${input:LOCAL_SOURCES_JAR_PATH} {output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} + FETCH_SRCS_JAR= && $FS_TOOLS copy ${input:LOCAL_SOURCES_JAR_PATH} {output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} } otherwise { - FETCH_SRCS_JAR= && $GENERATE_VCS_JAVA_INFO_NODEP && $FS_TOOLS md ${BINDIR}/fake-src && ${cwd;suf=/fake-src:BINDIR} $JDK_RESOURCE/bin/jar cfvm ${output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} $VCS_JAVA . + FETCH_SRCS_JAR= && $GENERATE_VCS_JAVA_INFO_NODEP && $FS_TOOLS md ${BINDIR}/fake-src && ${cwd;suf=/fake-src:BINDIR} $JDK_RESOURCE/bin/jar cfvm ${output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} $VCS_JAVA . PEERDIR+=build/platform/java/jdk PEERDIR+=$JDK_RESOURCE_PEERDIR } @@ -4033,12 +4033,12 @@ module PY2_LIBRARY: _LIBRARY { when ($NO_PYTHON_INCLS != "yes") { PEERDIR+=contrib/libs/python } - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=py - } - otherwise { - MODULE_PREFIX=libpy - } + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=py + } + otherwise { + MODULE_PREFIX=libpy + } .ALLOWED=FORK_TESTS .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_PYTHON2 .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS @@ -4069,7 +4069,7 @@ module _PY3_LIBRARY: _LIBRARY { MODULE_PREFIX=libpy } .ALLOWED=FORK_TESTS - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL USE_PYTHON2 OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS USE_GLOBAL_CMD=yes @@ -4115,36 +4115,36 @@ module _BASE_PY_PROGRAM: _BASE_PROGRAM { NO_CHECK_IMPORTS_FOR_VALUE= } ADD_CHECK_PY_IMPORTS() - + when ($NO_PYTHON_INCLS != "yes") { PEERDIR += contrib/libs/python } - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { PEERDIR += library/python/runtime/main PEERDIR += contrib/python/subprocess32 when ($PYTHON_SQLITE3 != "no") { PEERDIR += contrib/tools/python/src/Modules/_sqlite } - } + } when ($PYTHON_COVERAGE == "yes") { PEERDIR+=library/python/coverage } - - when ($ARCH_PPC64LE == "yes") { - _MY_ALLOCATOR=SYSTEM - } - otherwise { - _MY_ALLOCATOR=J - } - ALLOCATOR($_MY_ALLOCATOR) - STRIP() - + + when ($ARCH_PPC64LE == "yes") { + _MY_ALLOCATOR=SYSTEM + } + otherwise { + _MY_ALLOCATOR=J + } + ALLOCATOR($_MY_ALLOCATOR) + STRIP() + when ($BUILD_TYPE == "DEBUG") { NO_STRIP=yes } - when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { - NO_STRIP=yes - } + when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { + NO_STRIP=yes + } .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_PYTHON2 .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS SET(MODULE_LANG PY2) @@ -4180,14 +4180,14 @@ module _BASE_PY3_PROGRAM: _BASE_PROGRAM { NO_CHECK_IMPORTS_FOR_VALUE= } ADD_CHECK_PY_IMPORTS() - - when ($ARCH_PPC64LE == "yes") { - _MY_ALLOCATOR=SYSTEM - } - otherwise { - _MY_ALLOCATOR=J - } - ALLOCATOR($_MY_ALLOCATOR) + + when ($ARCH_PPC64LE == "yes") { + _MY_ALLOCATOR=SYSTEM + } + otherwise { + _MY_ALLOCATOR=J + } + ALLOCATOR($_MY_ALLOCATOR) STRIP() when ($NO_PYTHON_INCLS != "yes") { @@ -4428,7 +4428,7 @@ REAL_SWIG_DLL_JAR_CMD=$GENERATE_VCS_JAVA_INFO_NODEP && ${cwd:ARCADIA_BUILD_ROOT} ### ### https://wiki.yandex-team.ru/robot/manual/kiwi/techdoc/design/metaquery/ module METAQUERY: _BASE_UNIT { - .ALL_INS_TO_OUT=yes + .ALL_INS_TO_OUT=yes .FINAL_TARGET=yes PRINT_MODULE_TYPE(METAQUERY $MODULE_PREFIX$REALPRJNAME) } @@ -4442,8 +4442,8 @@ SYSTEM_PROPERTIES_VALUE= ### FILE means that parst should be read from file specifies as Path. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro SYSTEM_PROPERTIES(Args...) { - SET_APPEND(SYSTEM_PROPERTIES_VALUE $Args) +macro SYSTEM_PROPERTIES(Args...) { + SET_APPEND(SYSTEM_PROPERTIES_VALUE $Args) } # tag:java-specific @@ -4453,8 +4453,8 @@ JVM_ARGS_VALUE= ### Arguments to run Java programs in tests. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro JVM_ARGS(Args...) { - SET_APPEND(JVM_ARGS_VALUE $Args) +macro JVM_ARGS(Args...) { + SET_APPEND(JVM_ARGS_VALUE $Args) } # tag:java-specific @@ -4464,8 +4464,8 @@ CHECK_JAVA_DEPS_VALUE= ### Check for different classes with duplicate name in classpath. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro CHECK_JAVA_DEPS(Arg) { - SET(CHECK_JAVA_DEPS_VALUE $Arg) +macro CHECK_JAVA_DEPS(Arg) { + SET(CHECK_JAVA_DEPS_VALUE $Arg) } ERROR_PRONE_VALUE= @@ -4483,8 +4483,8 @@ TEST_CWD_VALUE= ### Is only used inside of the TEST modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro TEST_CWD(Arg) { - SET(TEST_CWD_VALUE $Arg) +macro TEST_CWD(Arg) { + SET(TEST_CWD_VALUE $Arg) } # tag:java-specific @@ -4615,8 +4615,8 @@ IDEA_EXCLUDE_DIRS_VALUE= ### ### Exclude specified directories from an idea project generated by ya ide idea ### Have no effect on regular build. -macro IDEA_EXCLUDE_DIRS(Args...) { - SET_APPEND(IDEA_EXCLUDE_DIRS_VALUE $Args) +macro IDEA_EXCLUDE_DIRS(Args...) { + SET_APPEND(IDEA_EXCLUDE_DIRS_VALUE $Args) } # tag:idea-specific @@ -4644,9 +4644,9 @@ JAVAC_FLAGS_VALUE= ### @usage: JAVAC_FLAGS(Args...) ### ### Set additional Java compilation flags. -macro JAVAC_FLAGS(Args...) { +macro JAVAC_FLAGS(Args...) { SET_APPEND(JAVAC_OPTS $Args) - SET_APPEND(JAVAC_FLAGS_VALUE $ARGS_DELIM $Args) + SET_APPEND(JAVAC_FLAGS_VALUE $ARGS_DELIM $Args) } # tag:java-specific @@ -4687,8 +4687,8 @@ ANNOTATION_PROCESSOR_VALUE= ### ### The macro is in development. ### Used to specify annotation processors to build JAVA_PROGRAM() and JAVA_LIBRARY(). -macro ANNOTATION_PROCESSOR(Args...) { - SET_APPEND(ANNOTATION_PROCESSOR_VALUE $ARGS_DELIM $Args) +macro ANNOTATION_PROCESSOR(Args...) { + SET_APPEND(ANNOTATION_PROCESSOR_VALUE $ARGS_DELIM $Args) } EXCLUDE_VALUE= @@ -4696,8 +4696,8 @@ EXCLUDE_VALUE= ### ### The macro is in development. ### Specifies which libraries should be excluded from the classpath. -macro EXCLUDE(Args...) { - SET_APPEND(EXCLUDE_VALUE $ARGS_DELIM $Args) +macro EXCLUDE(Args...) { + SET_APPEND(EXCLUDE_VALUE $ARGS_DELIM $Args) } # tag:java-specific @@ -4726,14 +4726,14 @@ JAVA_SRCS_VALUE= ### } ### ### Documentation: https://wiki.yandex-team.ru/yatool/java/#javasrcs -macro JAVA_SRCS(Args...) { - SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args) +macro JAVA_SRCS(Args...) { + SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args) } # tag:java-specific JAVA_ADD_DLLS_VALUE=no -macro ADD_DLLS_TO_JAR() { - SET(JAVA_ADD_DLLS_VALUE yes) +macro ADD_DLLS_TO_JAR() { + SET(JAVA_ADD_DLLS_VALUE yes) } # tag:java-specific @@ -4770,8 +4770,8 @@ DEPENDENCY_MANAGEMENT_VALUE= ### If some module has both DEPENDENCY_MANAGEMENT(contrib/java/junit/junit/4.12) and PERDIR(contrib/java/junit/junit/4.11), the PEERDIR wins. ### ### Documentation: https://wiki.yandex-team.ru/yatool/java/ -macro DEPENDENCY_MANAGEMENT(Args...) { - SET_APPEND(DEPENDENCY_MANAGEMENT_VALUE $ARGS_DELIM $Args) +macro DEPENDENCY_MANAGEMENT(Args...) { + SET_APPEND(DEPENDENCY_MANAGEMENT_VALUE $ARGS_DELIM $Args) _GHOST_PEERDIR($Args) } @@ -4858,13 +4858,13 @@ macro JAVA_EXTERNAL_DEPENDENCIES(Args...) { ### @usage _JAVA_PLACEHOLDER #internal ### The base module for all Java modules. Defines common properties and dependencies. module _JAVA_PLACEHOLDER: _BASE_UNIT { - .CMD=TOUCH_JAVA_UNIT + .CMD=TOUCH_JAVA_UNIT .FINAL_TARGET=yes .ALLOWED=DEPENDENCY_MANAGEMENT EXCLUDE .ALIASES=RUN_JAVA_PROGRAM=_RUN_JBUILD_PROGRAM HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL JAR_COMPILATION + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL JAR_COMPILATION PEERDIR(build/platform/java/jdk) PEERDIR+=$JDK_RESOURCE_PEERDIR when($MAKE_UBERJAR_VALUE) { @@ -4901,9 +4901,9 @@ module _JAVA_PLACEHOLDER: _BASE_UNIT { } JAVA_DEPENDENCIES_CONFIGURATION(FORBID_DEFAULT_VERSIONS) - DISABLE(NEED_PLATFORM_PEERDIRS) - NO_PLATFORM() - JAVA_MODULE() + DISABLE(NEED_PLATFORM_PEERDIRS) + NO_PLATFORM() + JAVA_MODULE() # flatbuffers-java DEPENDENCY_MANAGEMENT(contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION}) @@ -5119,18 +5119,18 @@ macro _ARCADIA_PYTHON_ADDINCL() { macro _PYTHON_ADDINCL() { SET(PYTHON2 yes) SET(PYTHON3 no) - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { ADDINCL+=GLOBAL contrib/libs/python/Include CFLAGS+=-DARCADIA_PYTHON_UNICODE_SIZE=$ARCADIA_PYTHON_UNICODE_SIZE - } - otherwise { + } + otherwise { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python } otherwise { CFLAGS+=$PYTHON_INCLUDE } - } + } } # tag:python-specific @@ -5169,18 +5169,18 @@ macro _ARCADIA_PYTHON3_ADDINCL() { macro _PYTHON3_ADDINCL() { SET(PYTHON3 yes) SET(PYTHON2 no) - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { CFLAGS+=-DUSE_PYTHON3 ADDINCL+=GLOBAL contrib/libs/python/Include - } - otherwise { + } + otherwise { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python } otherwise { CFLAGS+=$PYTHON_INCLUDE } - } + } } # tag:python-specific @@ -5226,12 +5226,12 @@ when ($PERL_DEFAULT_PEERDIR == "yes") { when (($PERLXS == "yes") || ($PERLXSCPP == "yes") || ($USE_PERL == "yes")) { PEERDIR+=build/platform/perl } -} +} # tag:perl-specific ### @usage: USE_PERL_LIB() ### Add dependency on Perl to your LIBRARY -macro USE_PERL_LIB() { +macro USE_PERL_LIB() { PEERDIR(build/platform/perl) } @@ -5277,14 +5277,14 @@ macro ADD_PERL_MODULE(Dir, Module) { ### - FAKE - Don't link with any allocator ### ### More about allocators in Arcadia: https://wiki.yandex-team.ru/arcadia/allocators/ -macro ALLOCATOR(Alloc) { - SET(ALLOCATOR $Alloc) - +macro ALLOCATOR(Alloc) { + SET(ALLOCATOR $Alloc) + when ($ALLOCATOR in [ "LF", "LF_YT", "LF_DBG", "YT", "J", "B", "BM", "C", "TCMALLOC", "TCMALLOC_SMALL_BUT_SLOW", "TCMALLOC_NUMA_256K", "TCMALLOC_NUMA_LARGE_PAGES", "TCMALLOC_256K", "GOOGLE", "LOCKLESS", "SYSTEM", "FAKE", "MIM", "HU" ]) { - } - otherwise { - PEERDIR+=___configure_error___unknown_allocator_type___$ALLOCATOR - } + } + otherwise { + PEERDIR+=___configure_error___unknown_allocator_type___$ALLOCATOR + } } ### @usage: CC_REQUIREMENTS([cpu: <value>] [ram: <value>]) @@ -5328,24 +5328,24 @@ macro PY_REQUIREMENTS(reqs) { SET_APPEND(PY_REQUIREMENTS $reqs) } -when ($MIC_ARCH == "yes") { - CFLAGS+=-mmic - LDFLAGS+=-mmic -} -when ($USE_OPENMP == "yes") { - PEERDIR+=contrib/libs/openmp -} +when ($MIC_ARCH == "yes") { + CFLAGS+=-mmic + LDFLAGS+=-mmic +} +when ($USE_OPENMP == "yes") { + PEERDIR+=contrib/libs/openmp +} -when ($STRIP == "yes" && $NO_STRIP != "yes") { - STRIP_FLAG=$LD_STRIP_FLAG - DWARF_COMMAND= - GO_LINK_FLAGS_VALUE+=-s -} +when ($STRIP == "yes" && $NO_STRIP != "yes") { + STRIP_FLAG=$LD_STRIP_FLAG + DWARF_COMMAND= + GO_LINK_FLAGS_VALUE+=-s +} when ($NO_LINKER_DCE != "yes") { DCE_FLAG=$LD_DCE_FLAG } - + when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") { ICF_FLAG=$LD_ICF_FLAG } @@ -5364,9 +5364,9 @@ when (!$STRIP_TOOL_VENDOR) { NEED_BINUTILS_PEERDIR=yes } -SPLIT_DWARF_VALUE=no -NO_SPLIT_DWARF=no - +SPLIT_DWARF_VALUE=no +NO_SPLIT_DWARF=no + when ($STRIP_DEBUG_INFO) { SPLIT_DWARF_VALUE=yes NO_SPLIT_DWARF=no @@ -5376,32 +5376,32 @@ when ($STRIP_DEBUG_INFO) { ### ### Emit debug info for the PROGRAM/DLL as a separate file <module_name>.debug. ### NB: It does not help you to save process RSS but can add problems (see e.g. BEGEMOT-2147). -macro SPLIT_DWARF() { - SET(SPLIT_DWARF_VALUE yes) -} - -SPLIT_DWARF_OUTPUT=${output;tobindir;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.debug:REALPRJNAME} -when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO != "yes" && $HOST_OS_LINUX == "yes" && $TARGET_PLATFORM == "LINUX") { +macro SPLIT_DWARF() { + SET(SPLIT_DWARF_VALUE yes) +} + +SPLIT_DWARF_OUTPUT=${output;tobindir;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.debug:REALPRJNAME} +when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO != "yes" && $HOST_OS_LINUX == "yes" && $TARGET_PLATFORM == "LINUX") { DWARF_COMMAND+= \ - $OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \ + $OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \ $STRIP_TOOL --strip-debug $TARGET && \ $OBJCOPY_TOOL --remove-section=.gnu_debuglink --add-gnu-debuglink $SPLIT_DWARF_OUTPUT $TARGET BINUTILS_USED=yes -} - +} + ### @usage: EXTRALIBS_STATIC(Libs...) ### ### Add the specified external static libraries to the program link -macro EXTRALIBS_STATIC(Args...) { - LDFLAGS(-Wl,-Bstatic ${Args} -Wl,-Bdynamic) +macro EXTRALIBS_STATIC(Args...) { + LDFLAGS(-Wl,-Bstatic ${Args} -Wl,-Bdynamic) } ### @usage ADD_COMPILABLE_TRANSLATE(Dict Name Options...) ### ### Generate translation dictionary code to transdict.LOWER(Name).cpp that will than be compiled into library -macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { - __translatename_lower=${tolower:Name} - __translate_dict=${BINDIR}/transdict.${__translatename_lower}.cpp +macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { + __translatename_lower=${tolower:Name} + __translate_dict=${BINDIR}/transdict.${__translatename_lower}.cpp RUN_PROGRAM(dict/tools/maketransdict -i ${Dict} ${MakeTransDictOptions} ${Name} STDOUT_NOAUTO ${__translate_dict} IN ${Dict}) } @@ -5409,8 +5409,8 @@ macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { ### ### Generate transliteration dictionary code ### This will emit both translit, untranslit and ngrams table codes those will be than further compiled into library -macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { - __translitname_lower=${tolower:Name} +macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { + __translitname_lower=${tolower:Name} __translit_table=${BINDIR}/translit_trie_${__translitname_lower}.cpp __untranslit_table=${BINDIR}/untranslit_trie_${__translitname_lower}.cpp __ngrams_table=${BINDIR}/ngr_arr_${__translitname_lower}.cpp @@ -5427,10 +5427,10 @@ macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { ### ### Generate python bindings for protobuf files. ### Macro is obsolete and not recommended for use! -macro GENERATE_PY_PROTOS(FILES...) { - foreach (FILE : $FILES) { +macro GENERATE_PY_PROTOS(FILES...) { + foreach (FILE : $FILES) { _PY_PROTO_CMD($FILE) - } + } } # tag:python-specific tag:proto @@ -5450,33 +5450,33 @@ macro _GENERATE_PY_EVS_INTERNAL(FILES...) { macro _COPY_FILE_IMPL(FILE, AUTO_DST="", NOAUTO_DST="", OUTPUT_INCLUDES[], REQUIREMENTS[]) { .CMD=$COPY_CMD ${input:FILE} ${output:AUTO_DST} ${output;noauto:NOAUTO_DST} ${output_include;hide:OUTPUT_INCLUDES} ${requirements;hide:REQUIREMENTS} ${kv;hide:"p CP"} ${kv;hide:"pc light-cyan"} .SEM=copy_file ${input:FILE} ${output:AUTO_DST} ${output;noauto:NOAUTO_DST} -} - -### @usage: COPY_FILE(File Destination [AUTO] [OUTPUT_INCLUDES Deps...]) +} + +### @usage: COPY_FILE(File Destination [AUTO] [OUTPUT_INCLUDES Deps...]) ### ### Copy file to build root. It is possible to change both location and the name. -### -### Parameters: -### - File - Source file name. -### - Destination - Output file name. -### - AUTO - Consider copied file for further processing automtically. -### - OUTPUT_INCLUDES output_includes... - Output file dependencies. -### -### The file will be just copied if AUTO boolean parameter is not specified. You should explicitly -### mention it in SRCS under new name (or specify AUTO boolean parameter) for further processing. +### +### Parameters: +### - File - Source file name. +### - Destination - Output file name. +### - AUTO - Consider copied file for further processing automtically. +### - OUTPUT_INCLUDES output_includes... - Output file dependencies. +### +### The file will be just copied if AUTO boolean parameter is not specified. You should explicitly +### mention it in SRCS under new name (or specify AUTO boolean parameter) for further processing. macro COPY_FILE(File, Destination, AUTO?"AUTO_DST":"NOAUTO_DST", OUTPUT_INCLUDES[], REQUIREMENTS[]) { .CMD=$_COPY_FILE_IMPL($File $AUTO $Destination OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS) .SEM=$_COPY_FILE_IMPL($File $AUTO $Destination OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS) -} - -### @usage: COPY_FILE_WITH_CONTEXT(FILE DEST [AUTO] [OUTPUT_INCLUDES DEPS...]) -### -### Copy file to build root the same way as it is done for COPY_FILE, but also -### propagates the context of the source file. -macro COPY_FILE_WITH_CONTEXT(FILE, DEST, AUTO?"AUTO":"", OUTPUT_INCLUDES[]) { - .CMD=$COPY_FILE($FILE $DEST $AUTO OUTPUT_INCLUDES $FILE $OUTPUT_INCLUDES) -} - +} + +### @usage: COPY_FILE_WITH_CONTEXT(FILE DEST [AUTO] [OUTPUT_INCLUDES DEPS...]) +### +### Copy file to build root the same way as it is done for COPY_FILE, but also +### propagates the context of the source file. +macro COPY_FILE_WITH_CONTEXT(FILE, DEST, AUTO?"AUTO":"", OUTPUT_INCLUDES[]) { + .CMD=$COPY_FILE($FILE $DEST $AUTO OUTPUT_INCLUDES $FILE $OUTPUT_INCLUDES) +} + macro _BUNDLE_TARGET(Target, Destination) { .CMD=$MOVE_FILE ${result:Target} ${output;noauto:Destination} ${kv;hide:"p BN"} ${kv;hide:"pc light-cyan"} $VCS_INFO_DISABLE_CACHE__NO_UID__ } @@ -5486,8 +5486,8 @@ macro _BUNDLE_TARGET(Target, Destination) { ### Sets a timeout on test execution ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro TIMEOUT(Time) { - SET(TEST_TIMEOUT $Time) +macro TIMEOUT(Time) { + SET(TEST_TIMEOUT $Time) } SBR_UID_EXT="" @@ -5514,7 +5514,7 @@ TEST_PARTITION=SEQUENTIAL ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ macro FORK_TESTS(MODE...) { - SET(TEST_FORK_MODE tests) + SET(TEST_FORK_MODE tests) SET(TEST_PARTITION $MODE) } @@ -5528,7 +5528,7 @@ macro FORK_TESTS(MODE...) { ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ macro FORK_SUBTESTS(MODE...) { - SET(TEST_FORK_MODE subtests) + SET(TEST_FORK_MODE subtests) SET(TEST_PARTITION $MODE) } @@ -5541,8 +5541,8 @@ macro FORK_SUBTESTS(MODE...) { ### Supports C++ ut and PyTest. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro SPLIT_FACTOR(Factor) { - SET(TEST_SPLIT_FACTOR $Factor) +macro SPLIT_FACTOR(Factor) { + SET(TEST_SPLIT_FACTOR $Factor) } # tag:test @@ -5553,8 +5553,8 @@ FORK_TEST_FILES_MODE= ### Compatible with FORK_(SUB)TESTS. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro FORK_TEST_FILES() { - SET(FORK_TEST_FILES_MODE on) +macro FORK_TEST_FILES() { + SET(FORK_TEST_FILES_MODE on) } # tag:test @@ -5565,8 +5565,8 @@ TEST_SIZE_NAME=SMALL ### See documentation on test system for more details. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro SIZE(Type) { - SET(TEST_SIZE_NAME $Type) +macro SIZE(Type) { + SET(TEST_SIZE_NAME $Type) } ### @usage: JOIN_SRCS(Out Src...) @@ -5574,7 +5574,7 @@ macro SIZE(Type) { ### Join set of sources into single file named Out and send it for further processing. ### This macro doesn't place all file into Out, it emits #include<Src>... Use the for C++ source files only. ### You should specify file name with the extension as Out. Futher processing will be done according this extension. -macro JOIN_SRCS(Out, Src...) { +macro JOIN_SRCS(Out, Src...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_join_srcs.py"} ${output:Out} --ya-start-command-file ${input;rootrel:Src} --ya-end-command-file ${output_include;hide:Src} ${kv;hide:"p JS"} ${kv;hide:"pc magenta"} .SEM=target_joined_source $Out ${input:Src} ${output;hide;suf=.o:Out} && modules_required yandex_common.cmake _CONDITIONAL_SRCS($TIDY_VALUE $Src) @@ -5602,16 +5602,16 @@ macro FLAT_JOIN_SRCS_GLOBAL(Out, Src...) { # tag:cpu PIC_CFLAGS= -SSE2_CFLAGS= -SSE3_CFLAGS= -SSSE3_CFLAGS= -SSE41_CFLAGS= +SSE2_CFLAGS= +SSE3_CFLAGS= +SSSE3_CFLAGS= +SSE41_CFLAGS= SSE42_CFLAGS= POPCNT_CFLAGS= PCLMUL_CFLAGS= CX16_FLAGS= -AVX_CFLAGS= -AVX2_CFLAGS= +AVX_CFLAGS= +AVX2_CFLAGS= AVX512_CFLAGS= # tag:cpu @@ -5654,9 +5654,9 @@ when (($ARCH_X86_64 || $ARCH_I386) && $DISABLE_INSTRUCTION_SETS != "yes") { SSE4_DEFINES=-DSSE41_ENABLED=1 -DSSE42_ENABLED=1 -DPOPCNT_ENABLED=1 -DCX16_ENABLED=1 } elsewhen ($MSVC) { - SSE2_CFLAGS=/D__SSE2__=1 - SSE3_CFLAGS=/D__SSE3__=1 - SSSE3_CFLAGS=/D__SSSE3__=1 + SSE2_CFLAGS=/D__SSE2__=1 + SSE3_CFLAGS=/D__SSE3__=1 + SSSE3_CFLAGS=/D__SSSE3__=1 SSE41_CFLAGS=/D__SSE4_1__=1 SSE42_CFLAGS=/D__SSE4_2__=1 POPCNT_CFLAGS=/D__POPCNT__=1 @@ -5666,18 +5666,18 @@ when (($ARCH_X86_64 || $ARCH_I386) && $DISABLE_INSTRUCTION_SETS != "yes") { AVX512_CFLAGS=/arch:AVX512 /DAVX512_ENABLED=1 SSE_DEFINES=/DSSE_ENABLED=1 /DSSE3_ENABLED=1 /DSSSE3_ENABLED=1 SSE4_DEFINES=/DSSE41_ENABLED=1 /DSSE42_ENABLED=1 /DPOPCNT_ENABLED=1 /DCX16_ENABLED=1 - } + } SSE_CFLAGS=$SSE2_CFLAGS $SSE3_CFLAGS $SSSE3_CFLAGS SSE4_CFLAGS=$SSE41_CFLAGS $SSE42_CFLAGS $POPCNT_CFLAGS $CX16_FLAGS when ($ARCH_I386 && $OS_ANDROID == "yes") { USE_SSE4=no } -} +} otherwise { USE_SSE4=no CPU_CHECK=no } - + # tag:cpu when ($NOSSE == "yes") { USE_SSE4=no @@ -5699,9 +5699,9 @@ macro NO_CPU_CHECK() { SET(CPU_CHECK no) } -### @usage: ADDINCLSELF() -### -### The macro adds the -I<project source path> flag to the source compilation flags of the current project. +### @usage: ADDINCLSELF() +### +### The macro adds the -I<project source path> flag to the source compilation flags of the current project. macro ADDINCLSELF(FOR="") { when($FOR) { ADDINCL+=FOR $FOR ${MODDIR} @@ -5709,8 +5709,8 @@ macro ADDINCLSELF(FOR="") { otherwise { ADDINCL+=${MODDIR} } -} - +} + COMPILE_OUT_SUFFIX= _COMPILE_OUTPUTS=${output;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}:SRC} _COMPILE_TIME_TRACE_OUTPUTS=${output;noauto;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}.time_trace.json:SRC} @@ -5720,8 +5720,8 @@ macro SET_COMPILE_OUTPUTS_MODIFIERS(NOREL?";norel":"") { SET(_COMPILE_TIME_TRACE_OUTPUTS \${output;noauto;suf=\${OBJECT_SUF}.time_trace.json$NOREL:SRC}) } -_EMPTY_CMD= - +_EMPTY_CMD= + # tag:src-processing tag:internal ### @usage: _SRC(Ext Src Flags) # internal ### @@ -5729,216 +5729,216 @@ _EMPTY_CMD= ### To enable specific extension processing define _SRC() macro with fixed first argument (Ext). ### Internal logic will apply this macro to all files with this Ext listed in SRC/SRCS macros or outputs ### of other commands (except ones marked as noauto) -macro _SRC(EXT, SRC, SRCFLAGS...) { +macro _SRC(EXT, SRC, SRCFLAGS...) { # Generic macro definition for _SRC (just a placeholder, it does nothing) -} - +} + # tag:src-processing -macro _SRC("S", SRC, SRCFLAGS...) { +macro _SRC("S", SRC, SRCFLAGS...) { .CMD=$C_COMPILER $C_FLAGS_PLATFORM $CFLAGS $SFLAGS $SRCFLAGS -c -o ${output:SRC.o} ${input:SRC} ${pre=-I:_C__INCLUDE} .SEM=add_asm_source ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("s", SRC, SRCFLAGS...) { - .CMD=$_SRC(S, $SRC $SRCFLAGS) -} - +macro _SRC("s", SRC, SRCFLAGS...) { + .CMD=$_SRC(S, $SRC $SRCFLAGS) +} + # tag:src-processing macro _SRC("s79", SRC, SRCFLAGS...) { .CMD=$_SRC(S, $SRC $SRCFLAGS -x assembler-with-cpp) } # tag:src-processing -macro _SRC("mm", SRC, SRCFLAGS...) { +macro _SRC("mm", SRC, SRCFLAGS...) { .CMD=$C_COMPILER $C_FLAGS_PLATFORM -x objective-c++ -fobjc-arc -fobjc-abi-version=2 -c -o ${output:SRC.o} ${input:SRC} $CXXFLAGS ${pre=-I:_C__INCLUDE} ${SRCFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p CC"} ${kv;hide:"pc light-green"} $TOOLCHAIN_ENV -} - +} + # tag:src-processing -macro _SRC("fml", SRC, SRCFLAGS...) { - .CMD=$FML_TOOL $CHECKFLAG -b -o ${output:SRC.inc} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +macro _SRC("fml", SRC, SRCFLAGS...) { + .CMD=$FML_TOOL $CHECKFLAG -b -o ${output:SRC.inc} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} +} + # tag:src-processing -macro _SRC("fml2", SRC, SRCFLAGS...) { +macro _SRC("fml2", SRC, SRCFLAGS...) { .CMD=$FML_TOOL $CHECKFLAG -b -o ${output;nopath;noext:SRC.fml.inc} -2 -O ${output;nopath;noext:SRC.fml.cpp} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("fml3", SRC, SRCFLAGS...) { +macro _SRC("fml3", SRC, SRCFLAGS...) { .CMD=$FML_TOOL $CHECKFLAG -b -o ${output;nopath;noext:SRC.fml.inc} -3 -O ${output;nopath;noext:SRC.fml.cpp} -L ${input;nopath;noext:SRC.list} -P ${nopath;noext:SRC} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("sfdl", SRC, SRCFLAGS...) { +macro _SRC("sfdl", SRC, SRCFLAGS...) { .CMD=$CXX_COMPILER $C_FLAGS_PLATFORM $CXXFLAGS $SFDL_FLAG ${SRCFLAGS} ${input:SRC} && ${tool:"tools/calcstaticopt"} -i ${tmp:SRC.tmp} -a $ARCADIA_ROOT ${output;stdout;nopath;noext;defext=.inc:SRC} ${kv;hide:"p SF"} ${kv;hide:"pc yellow"} $TOOLCHAIN_ENV -} - +} + # tag:src-processing -macro _SRC("xs", SRC, SRCFLAGS...) { +macro _SRC("xs", SRC, SRCFLAGS...) { .CMD=$PERL_LD_LIBRARY_PATH $PERL $PERL_INCLUDE ${suf=/ExtUtils/xsubpp:PERL_PRIVLIB} -typemap ${suf=/ExtUtils/typemap:PERL_PRIVLIB} $PERLSUFFIX $XSUBPPFLAGS ${SRCFLAGS} ${input:SRC} $PERLOUTPUT ${kv;hide:"p XS"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("y", SRC, SRCFLAGS...) { +macro _SRC("y", SRC, SRCFLAGS...) { # .CMD=${tool:"contrib/tools/byacc"} $BYACC_FLAGS ${nopath;noext;output:SRC.cpp} ${input:SRC} ${nopath;noext;hide;output;addincl:SRC.h} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} .CMD=${tool:"contrib/tools/bison/bison"} $BISON_FLAGS --m4=${tool:"contrib/tools/bison/m4"} -d -o ${nopath;noext;output;main;hide:SRC.h} ${nopath;noext;output:SRC.cpp} ${input:SRC} ${SRCFLAGS} && $YMAKE_PYTHON ${input:"build/scripts/preprocess.py"} $_ADD_HIDDEN_INPUTS($CPP_BISON_SKELS) ${nopath;noext;output;addincl:SRC.h} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} -} - +} + # tag:src-processing -macro _SRC("ypp", SRC, SRCFLAGS...) { - .CMD=$_SRC(y $SRC $SRCFLAGS) -} - +macro _SRC("ypp", SRC, SRCFLAGS...) { + .CMD=$_SRC(y $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("gperf", SRC, SRCFLAGS...) { +macro _SRC("gperf", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/gperf"} $GP_FLAGS ${SRCFLAGS} ${pre=-Nin_;suf=_set;nopath;noallext:SRC} ${input:SRC} ${output;stdout;nopath;noext;defext=.gperf.cpp:SRC} ${kv;hide:"p GP"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("rl", SRC, SRCFLAGS...) { +macro _SRC("rl", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel5/ragel"} $RAGEL_FLAGS ${SRCFLAGS} -o ${tmp:SRC.tmp} ${input:SRC} && $RUN_NO_SANITIZE ${tool:"contrib/tools/ragel5/rlgen-cd"} $RLGEN_FLAGS -o ${output;nopath;noext;defext=.rl5.cpp:SRC} ${tmp:SRC.tmp} ${kv;hide:"p R5"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("rl5", SRC, SRCFLAGS...) { - .CMD=$_SRC(rl $SRC $SRCFLAGS) -} - +macro _SRC("rl5", SRC, SRCFLAGS...) { + .CMD=$_SRC(rl $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("asp", SRC, SRCFLAGS...) { - .CMD=$RUN_NO_SANITIZE ${tool:"tools/html2cpp"} ${input:SRC} ${output:SRC.cpp} ${kv;hide:"p HT"} ${kv;hide:"pc yellow"} -} - +macro _SRC("asp", SRC, SRCFLAGS...) { + .CMD=$RUN_NO_SANITIZE ${tool:"tools/html2cpp"} ${input:SRC} ${output:SRC.cpp} ${kv;hide:"p HT"} ${kv;hide:"pc yellow"} +} + # tag:src-processing -macro _SRC("rl6", SRC, SRCFLAGS...) { +macro _SRC("rl6", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel6"} $RAGEL6_FLAGS ${SRCFLAGS} -L -I${ARCADIA_ROOT} -o ${output;nopath;noext;defext=.rl6.cpp:SRC} ${input:SRC} ${kv;hide:"p R6"} ${kv;hide:"pc yellow"} .SEM=target_ragel_lexers PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} $RAGEL6_FLAGS ${SRCFLAGS} && set_global_flags RAGEL_FLAGS -L -I $S/ && conan_require ragel/6.10 && conan_import '"bin, ragel* -> ./bin"' && modules_required yandex_common.cmake -} - +} + # tag:src-processing -macro _SRC("l", SRC, SRCFLAGS...) { - .CMD=${tool:"contrib/tools/flex-old"} $LEX_FLAGS ${SRCFLAGS} -o${output:SRC.cpp} ${output_include;hide:"util/system/compiler.h"} ${input:SRC} ${kv;hide:"p LX"} ${kv;hide:"pc yellow"} - .ADDINCL=contrib/tools/flex-old -} - +macro _SRC("l", SRC, SRCFLAGS...) { + .CMD=${tool:"contrib/tools/flex-old"} $LEX_FLAGS ${SRCFLAGS} -o${output:SRC.cpp} ${output_include;hide:"util/system/compiler.h"} ${input:SRC} ${kv;hide:"p LX"} ${kv;hide:"pc yellow"} + .ADDINCL=contrib/tools/flex-old +} + # tag:src-processing -macro _SRC("lex", SRC, SRCFLAGS...) { - .CMD=$_SRC(l $SRC $SRCFLAGS) -} - +macro _SRC("lex", SRC, SRCFLAGS...) { + .CMD=$_SRC(l $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("lpp", SRC, SRCFLAGS...) { - .CMD=$_SRC(l $SRC $SRCFLAGS) -} - +macro _SRC("lpp", SRC, SRCFLAGS...) { + .CMD=$_SRC(l $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("pln", SRC, SRCFLAGS...) { +macro _SRC("pln", SRC, SRCFLAGS...) { .CMD=$FML_TOOL -b -o ${output;pre=pln.;nopath;noext:SRC.cpp} -f ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("xsyn", SRC, SRCFLAGS...) { +macro _SRC("xsyn", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"library/cpp/xml/parslib/xsyn2ragel.py"} ${input:SRC} ${input:"library/cpp/xml/parslib/xmlpars.xh"} dontuse ${output;stdout:SRC.h.rl5} ${kv;hide:"p XN"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("ev", SRC, SRCFLAGS...) { - .CMD=$EVLOG_CMD($SRC) -} - +macro _SRC("ev", SRC, SRCFLAGS...) { + .CMD=$EVLOG_CMD($SRC) +} + # tag:src-processing -macro _SRC("proto", SRC, SRCFLAGS...) { - .CMD=$PROTO_CMD($SRC) +macro _SRC("proto", SRC, SRCFLAGS...) { + .CMD=$PROTO_CMD($SRC) .SEM=$PROTO_CMD($SRC) -} - +} + # tag:src-processing -macro _SRC("gztproto", SRC, SRCFLAGS...) { +macro _SRC("gztproto", SRC, SRCFLAGS...) { # _PROTO__INCLUDE is before ARCADIA_ROOT in includes because in gazetteer we don't use builtins now and paths'canonization (resolving) depends on order of roots. - # descriptor.proto must be resolved as google/protobuf/descriptor.proto + # descriptor.proto must be resolved as google/protobuf/descriptor.proto .CMD=${tool:"dict/gazetteer/converter"} -I$PROTOBUF_PATH ${pre="-I":_PROTO__INCLUDE} -I$ARCADIA_ROOT ${SRCFLAGS} ${input:SRC} ${output;nopath;noext;norel:SRC.proto} ${kv;hide:"p GZ"} ${kv;hide:"pc yellow"} .PEERDIR=kernel/gazetteer/proto -} - +} + # tag:src-processing macro _SRC("cfgproto", SRC, SRCFLAGS...) { .CMD=$_CPP_CFGPROTO_CMD($SRC) } # tag:src-processing -macro _SRC("pyx", SRC, SRCFLAGS...) { +macro _SRC("pyx", SRC, SRCFLAGS...) { # Copy-paste from BUILDWITH_CYTHON .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} ${pre=-I:_CYTHON__INCLUDE} ${input:SRC} -o ${output;tobindir:SRC.cpp} $CYTHON_OUTPUT_INCLUDES ${SRCFLAGS} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} .ADDINCL=FOR cython contrib/tools/cython/Cython/Includes -} - +} + # tag:src-processing -macro _SRC("in", SRC, SRCFLAGS...) { +macro _SRC("in", SRC, SRCFLAGS...) { .CMD=$CONFIGURE_FILE(${SRC} ${nopath;noext:SRC}) -} - +} + # tag:src-processing -macro _SRC("sc", SRC, SRCFLAGS...) { +macro _SRC("sc", SRC, SRCFLAGS...) { .CMD=${tool:"tools/domschemec"} --in ${input:SRC} --out ${output;norel:SRC.h} ${output_include;hide:"util/generic/strbuf.h"} ${output_include;hide:"util/generic/string.h"} ${output_include;hide:"util/generic/vector.h"} ${output_include;hide:"util/string/cast.h"} ${SRCFLAGS} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing macro _SRC("ssqls", SRC, SRCFLAGS...) { .CMD=${tool:"metrika/core/tools/ssqls"} ${input;notransformbuilddir:SRC} -S $ARCADIA_ROOT -B $ARCADIA_BUILD_ROOT $SRCFLAGS ${output;noext;hide:SRC.cpp} ${output;noext;hide:SRC.h} ${kv;hide:"p SS"} ${kv;hide:"pc yellow"} } # tag:src-processing -macro _SRC("f", SRC, SRCFLAGS...) { +macro _SRC("f", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/f2c.py"} -t ${tool:"contrib/tools/f2c"} -c ${input:SRC} -o ${output:SRC.c} ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p FT"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/libf2c - .ADDINCL=contrib/libs/libf2c -} - + .PEERDIR=contrib/libs/libf2c + .ADDINCL=contrib/libs/libf2c +} + # tag:src-processing -macro _SRC("cpp", SRC, SRCFLAGS...) { - .CMD=$_SRC_cpp($SRC $SRCFLAGS) +macro _SRC("cpp", SRC, SRCFLAGS...) { + .CMD=$_SRC_cpp($SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("cxx", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) -} - +macro _SRC("cxx", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("cc", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) +macro _SRC("cc", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("C", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) -} - +macro _SRC("C", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("c", SRC, SRCFLAGS...) { - .CMD=$_SRC_c($SRC $SRCFLAGS) +macro _SRC("c", SRC, SRCFLAGS...) { + .CMD=$_SRC_c($SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("m", SRC, SRCFLAGS...) { - .CMD=$_SRC(c $SRC $SRCFLAGS) -} - +macro _SRC("m", SRC, SRCFLAGS...) { + .CMD=$_SRC(c $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("masm", SRC, SRCFLAGS...) { - .CMD=$_SRC_masm($SRC $SRCFLAGS) -} - +macro _SRC("masm", SRC, SRCFLAGS...) { + .CMD=$_SRC_masm($SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("yasm", SRC, SRCFLAGS...) { - .CMD=$_SRC_yasm($SRC $SRCFLAGS PREINCLUDES $YASM_PREINCLUDES_VALUE) +macro _SRC("yasm", SRC, SRCFLAGS...) { + .CMD=$_SRC_yasm($SRC $SRCFLAGS PREINCLUDES $YASM_PREINCLUDES_VALUE) .SEM=target_yasm_source PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} $YASM_FLAGS ${pre=-I :_ASM__INCLUDE} $SRCFLAGS ${pre=-P :PREINCLUDES} && set_global_flags YASM_FLAGS -f ${_YASM_FMT_VALUE}${HARDWARE_ARCH} $_YASM_PLATFORM_FLAGS_VALUE -D ${pre=_;suf=_:HARDWARE_TYPE} -D_YASM_ $ASM_PREFIX_VALUE $_YASM_PREDEFINED_FLAGS_VALUE && conan_require yasm/1.3.0 && conan_import '"bin, *yasm* -> ./bin"' && conan_import '"bin, ytasm* -> ./bin"' && modules_required yandex_common.cmake -} - +} + # tag:src-processing macro _SRC("asm", SRC, SRCFLAGS...) { .CMD=$_SRC(yasm $SRC $SRCFLAGS) @@ -5952,49 +5952,49 @@ macro _SRC("lua", SRC, SRCFLAGS...) { } # tag:src-processing -macro _SRC("cu", SRC, SRCFLAGS...) { - .CMD=$_SRC_CU_CMD - .PEERDIR=$_SRC_CU_PEERDIR -} - +macro _SRC("cu", SRC, SRCFLAGS...) { + .CMD=$_SRC_CU_CMD + .PEERDIR=$_SRC_CU_PEERDIR +} + # tag:src-processing -macro _SRC("fbs", SRC, SRCFLAGS...) { - .CMD=$FBS_CMD($SRC, $SRCFLAGS) -} - +macro _SRC("fbs", SRC, SRCFLAGS...) { + .CMD=$FBS_CMD($SRC, $SRCFLAGS) +} + # tag:src-processing -macro _SRC("fbs64", SRC, SRCFLAGS...) { - .CMD=$_CPP_FLATC64_CMD($SRC, $SRCFLAGS) -} - +macro _SRC("fbs64", SRC, SRCFLAGS...) { + .CMD=$_CPP_FLATC64_CMD($SRC, $SRCFLAGS) +} + # tag:src-processing -macro _SRC("pysrc", SRC, SRCFLAGS...) { - .CMD=$_SRC_PYSRC($SRC, $SRCFLAGS) -} +macro _SRC("pysrc", SRC, SRCFLAGS...) { + .CMD=$_SRC_PYSRC($SRC, $SRCFLAGS) +} # tag:src-processing -macro _SRC_py2src(SRC, SRCFLAGS...) { - .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py2_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py2 --python $(PYTHON)/python --py_compile ${input:"build/scripts/py_compile.py"} ${kv;hide:"p P2"} ${kv;hide:"pc light-green"} -} - +macro _SRC_py2src(SRC, SRCFLAGS...) { + .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py2_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py2 --python $(PYTHON)/python --py_compile ${input:"build/scripts/py_compile.py"} ${kv;hide:"p P2"} ${kv;hide:"pc light-green"} +} + # tag:src-processing -macro _SRC_py3src(SRC, SRCFLAGS...) { - .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py3_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py3 --pycc ${tool:"contrib/tools/python3/pycc"} ${kv;hide:"p P3"} ${kv;hide:"pc light-green"} -} - +macro _SRC_py3src(SRC, SRCFLAGS...) { + .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py3_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py3 --pycc ${tool:"contrib/tools/python3/pycc"} ${kv;hide:"p P3"} ${kv;hide:"pc light-green"} +} + # tag:src-processing python-specific -when ($PYTHON3 == "yes") { - MACRO_ALIAS(_SRC_PYSRC _SRC_py3src) -} -otherwise { - MACRO_ALIAS(_SRC_PYSRC _SRC_py2src) -} - +when ($PYTHON3 == "yes") { + MACRO_ALIAS(_SRC_PYSRC _SRC_py3src) +} +otherwise { + MACRO_ALIAS(_SRC_PYSRC _SRC_py2src) +} + # tag:src-processing -macro _SRC_c_nodeps(SRC, OUTFILE, INC...) { - .CMD=$_SRC_C_NODEPS_CMD -} - +macro _SRC_c_nodeps(SRC, OUTFILE, INC...) { + .CMD=$_SRC_C_NODEPS_CMD +} + # Custom flags for generated cpp-files. To support another generator: # - insert additional file extension before .cpp into generated cpp-file name # - update _LANG_CFLAGS_FILTER variable. Don't forget to add ' SKIP ' after flag list @@ -6025,31 +6025,31 @@ macro _LANG_CFLAGS(SRC) { # tag:src-processing # ymake bug workaround: variables followed a macros call in .CMD are not substituted and are placed in result as is # Pack macro call into a variable and use it in _SRC_CPP_CMD instead of macro call -_LANG_CFLAGS_VALUE= -when ($CLANG == "yes" || $GCC == "yes") { - _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC}) -} +_LANG_CFLAGS_VALUE= +when ($CLANG == "yes" || $GCC == "yes") { + _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC}) +} # tag:src-processing macro _SRC_cpp(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) { - .CMD=$_SRC_CPP_CMD -} - + .CMD=$_SRC_CPP_CMD +} + # tag:src-processing macro _SRC_c(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) { - .CMD=$_SRC_C_CMD -} - + .CMD=$_SRC_C_CMD +} + # tag:src-processing -macro _SRC_m(SRC, SRCFLAGS...) { - .CMD=$_SRC_M_CMD -} - +macro _SRC_m(SRC, SRCFLAGS...) { + .CMD=$_SRC_M_CMD +} + # tag:src-processing -macro _SRC_masm(SRC, SRCFLAGS...) { - .CMD=$_SRC_MASM_CMD -} - +macro _SRC_masm(SRC, SRCFLAGS...) { + .CMD=$_SRC_MASM_CMD +} + # tag:lua-specific ### @usage: COMPILE_LUA(Src, [NAME <import_name>]) ### @@ -6060,21 +6060,21 @@ macro COMPILE_LUA(Src, NAME="") { } # tag:lua-specific -### @usage: _SRC_lua_21(SRC [SRCFLAGS...]) # internal -### -### Compile LUA source file to object code using LUA 2.1 -macro _SRC_lua_21(SRC, SRCFLAGS...) { - .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:SRC} ${SRCFLAGS} ${global;output;suf=.o:SRC} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} - .PEERDIR=$LUAJIT_21_PATH -} - +### @usage: _SRC_lua_21(SRC [SRCFLAGS...]) # internal +### +### Compile LUA source file to object code using LUA 2.1 +macro _SRC_lua_21(SRC, SRCFLAGS...) { + .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:SRC} ${SRCFLAGS} ${global;output;suf=.o:SRC} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} + .PEERDIR=$LUAJIT_21_PATH +} + # tag:lua-specific ### @usage: COMPILE_LUA_21(Src, [NAME <import_name>]) ### -### Compile LUA source file to object code using LUA 2.1 +### Compile LUA source file to object code using LUA 2.1 ### Optionally override import name which is by default reflects Src name macro COMPILE_LUA_21(Src, NAME="") { - .CMD=$_SRC_lua_21($Src, ${pre=-n :NAME}) + .CMD=$_SRC_lua_21($Src, ${pre=-n :NAME}) } GETTEXT_KEEP_PATH=no @@ -6087,7 +6087,7 @@ otherwise { } # tag:src-processing -macro _SRC("po", SRC, SRCFLAGS...) { +macro _SRC("po", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"contrib/tools/python/src/Tools/i18n/msgfmt.py"} -o $_MO_OUTPUT ${input:SRC} } @@ -6139,10 +6139,10 @@ macro YDL_DESC_USE_BINARY() { ### ### Compile single file with extra Flags. ### Compilation is driven by the last extension of the File and Flags are specific to corresponding compilation command -macro SRC(FILE, FLAGS...) { - _SRC(${lastext:FILE} $FILE $FLAGS) -} - +macro SRC(FILE, FLAGS...) { + _SRC(${lastext:FILE} $FILE $FLAGS) +} + ### @usage: SRCS(<[GLOBAL] File> ...) ### ### Source files of the project. Files are built according to their extension and put int module output or fed to ultimate PROGRAM/DLL depending on GLOBAL presence. @@ -6158,40 +6158,40 @@ macro SRC(FILE, FLAGS...) { ### END() ### ### This will produce foo.o and feed it to any PROGRAM/DLL module transitively depending on test_global library. The library itself will be empty and won't produce .a file. -macro SRCS(FILES...) { - foreach (FILE : $FILES) { - _SRC(${lastext:FILE} $FILE) +macro SRCS(FILES...) { + foreach (FILE : $FILES) { + _SRC(${lastext:FILE} $FILE) } } # tag:cpu tag:src-processing ### @usage SRC_C_SSE2(File Flags...) ### Compile single .c-file with SSE2 and extra Flags. -macro SRC_C_SSE2(FILE, FLAGS...) { +macro SRC_C_SSE2(FILE, FLAGS...) { _SRC(c $FILE $SSE2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE3(File Flags...) ### Compile single .c-file with SSE3 and extra Flags. -macro SRC_C_SSE3(FILE, FLAGS...) { +macro SRC_C_SSE3(FILE, FLAGS...) { _SRC(c $FILE $SSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSSE3(File Flags...) ### Compile single .c-file with SSSE3 and extra Flags. -macro SRC_C_SSSE3(FILE, FLAGS...) { +macro SRC_C_SSSE3(FILE, FLAGS...) { _SRC(c $FILE $SSSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .ssse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE41(File Flags...) ### Compile single .c-file with SSE4.1 and extra Flags. -macro SRC_C_SSE41(FILE, FLAGS...) { +macro SRC_C_SSE41(FILE, FLAGS...) { _SRC(c $FILE $SSE41_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse41) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE4(File Flags...) ### Compile single .c-file with SSE4 (SSE4.1, SSE4.2 and POPCNT) and extra Flags. @@ -6202,17 +6202,17 @@ macro SRC_C_SSE4(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_C_AVX(File Flags...) ### Compile single .c-file with AVX and extra Flags. -macro SRC_C_AVX(FILE, FLAGS...) { +macro SRC_C_AVX(FILE, FLAGS...) { _SRC(c $FILE $AVX_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_AVX2(File Flags...) ### Compile single .c-file with AVX2 and extra Flags. -macro SRC_C_AVX2(FILE, FLAGS...) { +macro SRC_C_AVX2(FILE, FLAGS...) { _SRC(c $FILE $AVX2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_PIC(File Flags...) ### Compile single .c-file with -fPIC and extra Flags. @@ -6223,31 +6223,31 @@ macro SRC_CPP_PIC(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE2(File Flags...) ### Compile single .cpp-file with SSE2 and extra Flags. -macro SRC_CPP_SSE2(FILE, FLAGS...) { +macro SRC_CPP_SSE2(FILE, FLAGS...) { _SRC(cpp $FILE $SSE2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE3(File Flags...) ### Compile single .cpp-file with SSE3 and extra Flags. -macro SRC_CPP_SSE3(FILE, FLAGS...) { +macro SRC_CPP_SSE3(FILE, FLAGS...) { _SRC(cpp $FILE $SSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSSE3(File Flags...) ### Compile single .cpp-file with SSSE3 and extra Flags. -macro SRC_CPP_SSSE3(FILE, FLAGS...) { +macro SRC_CPP_SSSE3(FILE, FLAGS...) { _SRC(cpp $FILE $SSSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sss3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE41(File Flags...) ### Compile single .cpp-file with SSE4.1 and extra Flags. -macro SRC_CPP_SSE41(FILE, FLAGS...) { +macro SRC_CPP_SSE41(FILE, FLAGS...) { _SRC(cpp $FILE $SSE41_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse41) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE4(File Flags...) ### Compile single .cpp-file with SSE4 (SSE4.1, SSE4.2 and POPCNT) and extra Flags. @@ -6258,23 +6258,23 @@ macro SRC_CPP_SSE4(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_CPP_AVX(File Flags...) ### Compile single .cpp-file with AVX and extra Flags. -macro SRC_CPP_AVX(FILE, FLAGS...) { +macro SRC_CPP_AVX(FILE, FLAGS...) { _SRC(cpp $FILE $AVX_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_AVX2(File Flags...) ### Compile single .cpp-file with AVX2 and extra Flags. -macro SRC_CPP_AVX2(FILE, FLAGS...) { +macro SRC_CPP_AVX2(FILE, FLAGS...) { _SRC(cpp $FILE $AVX2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx2) -} - +} + # tag:python-processing tag:cython # TODO: use it in [.pyx] cmd ### @usage: BUILDWITH_CYTHON_CPP(Src Options...) ### ### Generates .cpp file from .pyx. -macro BUILDWITH_CYTHON_CPP(Src, Options...) { +macro BUILDWITH_CYTHON_CPP(Src, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} -o ${output;tobindir:Src.cpp} $CYTHON_OUTPUT_INCLUDES ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6293,7 +6293,7 @@ macro _BUILDWITH_CYTHON_CPP_DEP(Src, Dep, Options...) { ### @usage: BUILDWITH_CYTHON_C(Src Options...) ### ### Generates .c file from .pyx. -macro BUILDWITH_CYTHON_C(Src, Options...) { +macro BUILDWITH_CYTHON_C(Src, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} -o ${output;tobindir:Src.c} $CYTHON_OUTPUT_INCLUDES ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6348,9 +6348,9 @@ macro _SWIG_PYTHON_C(Src, DstSubPrefix) { ### @usage: BUILDWITH_RAGEL6(Src Options...) ### ### Compile .rl file using Ragel6. -macro BUILDWITH_RAGEL6(Src, Options...) { +macro BUILDWITH_RAGEL6(Src, Options...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel6"} $RAGEL6_FLAGS ${Options} -I${ARCADIA_ROOT} -o ${output;nopath;noext;defext=.rl6.cpp:Src} ${input:Src} ${kv;hide:"p R6"} ${kv;hide:"pc yellow"} -} +} # tag:python-processing tag:internal # TODO: use it in [.pyx] cmd @@ -6359,9 +6359,9 @@ macro BUILDWITH_RAGEL6(Src, Options...) { ### Register Python 2.x module in internal resource file system. Arcadia Python 2.x importer will be retrieve these on import directive. ### ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/pysrcs/#makrospyregister -macro _PY_REGISTER(Func) { +macro _PY_REGISTER(Func) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_py_reg.py"} $Func ${output;noauto:Func.reg.cpp} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p PY"} ${kv;hide:"pc yellow"} - SRCS(GLOBAL $Func.reg.cpp) + SRCS(GLOBAL $Func.reg.cpp) } # tag:python-processing tag:internal @@ -6383,7 +6383,7 @@ macro _PY3_REGISTER(Func) { ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/pysrcs/#makrospyregister macro _PY_COMPILE_BYTECODE(SrcX, Src, Dst) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/py_compile.py"} $SrcX ${input:Src} ${output;noauto:Dst.yapyc} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p PY"} ${kv;hide:"pc yellow"} -} +} # tag:python-processing tag:internal ### @usage: _PY3_COMPILE_BYTECODE(SrcX Src) # internal @@ -6405,15 +6405,15 @@ macro ARCHIVE_ASM(NAME="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { } # tag:yweb-specific -macro PIRE_INLINE_CMD(SRC) { +macro PIRE_INLINE_CMD(SRC) { .CMD=${tool:"library/cpp/regex/pire/inline"} -o ${output:SRC} ${input:SRC} ${output_include;hide:SRC} ${kv;hide:"p PI"} ${kv;hide:"pc yellow"} } # tag:yweb-specific -macro PIRE_INLINE(FILES...) { - foreach (FILE : $FILES) { - PIRE_INLINE_CMD($FILE) - } +macro PIRE_INLINE(FILES...) { + foreach (FILE : $FILES) { + PIRE_INLINE_CMD($FILE) + } } ### @usage: ARCHIVE(archive_name [DONT_COMPRESS] files...) @@ -6433,8 +6433,8 @@ macro ARCHIVE(NAME="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { ### Example: https://wiki.yandex-team.ru/yatool/howtowriteyamakefiles/#a1ispolzujjtekomanduarchive macro ARCHIVE_BY_KEYS(NAME="", KEYS="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { .CMD=$ARCH_TOOL -q -x $DONTCOMPRESS ${input:Files} -k $KEYS -o ${output;chksum;addincl;noauto:NAME} ${requirements;hide:REQUIREMENTS} ${kv;hide:"p AR"} ${kv;hide:"pc light-red"} -} - +} + #scripts #special commands @@ -6468,10 +6468,10 @@ macro UPDATE_VCS_JAVA_INFO_NODEP(Jar) { ### ### Creates header file to access some information about build specified via configuration variables. ### Unlike CREATE_SVNVERSION_FOR() it doesn't take revion information from VCS, it uses revision and SandboxTaskId passed via -D options to ya make -macro CREATE_BUILDINFO_FOR(GenHdr) { +macro CREATE_BUILDINFO_FOR(GenHdr) { .CMD=$YIELD $CXX_COMPILER && $YIELD $CXXFLAGS && $XARGS $YMAKE_PYTHON ${input:BUILDVERSION_SCRIPT} ${output:GenHdr} ${kv;hide:"p BI"} ${kv;hide:"pc yellow"} ${hide;kv:"show_out"} $SVN_DEPENDS_CACHE__NO_UID__ -} - +} + DECIMAL_MD5_SCRIPT=build/scripts/decimal_md5.py DECIMAL_MD5_FIXED= @@ -6496,16 +6496,16 @@ macro CFG_VARS() { ### Copy file with the replacement of configuration variables in form of @ANY_CONF_VAR@ with their values. ### The values are collected during configure stage, while replacement itself happens during build stage. ### Used implicitly for .in-files processing. -macro CONFIGURE_FILE(Src, Dst) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/configure_file.py"} ${input:Src} ${output;addincl:Dst} $CFG_VARS ${kv;hide:"p CF"} ${kv;hide:"pc yellow"} +macro CONFIGURE_FILE(Src, Dst) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/configure_file.py"} ${input:Src} ${output;addincl:Dst} $CFG_VARS ${kv;hide:"p CF"} ${kv;hide:"pc yellow"} .SEM=set_vasrs ${CFG_VARS} && configure_file $S/${input;rootrel:Src} $B/${output;rootrel:Dst} } ### @usage: BASE_CODEGEN(tool_path prefix) ### ### Generator ${prefix}.cpp + ${prefix}.h files based on ${prefix}.in. -macro BASE_CODEGEN(Tool, Prefix, Opts...) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc yellow"} +macro BASE_CODEGEN(Tool, Prefix, Opts...) { + .CMD=${tool:Tool} ${input:Prefix.in} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc yellow"} } # tag:internal @@ -6514,7 +6514,7 @@ macro BASE_CODEGEN(Tool, Prefix, Opts...) { ### Generator of a certain number .the. cpp file + one header .h file from .in. ### This is the call of the generator. Python macro SPLIT_CODEGEN() is defined in order to properly fill command outputs from OUT_NUM argument. macro _SPLIT_CODEGEN_BASE(Tool, Prefix, OUT[], OPTS[], OUTPUT_INCLUDES[]) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;hide:OUT} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $OPTS ${output_include;hide:OUTPUT_INCLUDES} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} + .CMD=${tool:Tool} ${input:Prefix.in} ${output;hide:OUT} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $OPTS ${output_include;hide:OUTPUT_INCLUDES} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} } STRUCT_CODEGEN_OUTPUT_INCLUDES=${output_include;hide:"util/generic/singleton.h"} \ @@ -6527,15 +6527,15 @@ ${output_include;hide:"kernel/struct_codegen/reflection/floats.h"} ### @usage: STRUCT_CODEGEN(Prefix) ### A special case BASE_CODEGEN, in which the kernel/struct_codegen/codegen_tool tool is used. -macro STRUCT_CODEGEN(Prefix) { +macro STRUCT_CODEGEN(Prefix) { .CMD=$BASE_CODEGEN(kernel/struct_codegen/codegen_tool, $Prefix, $STRUCT_CODEGEN_OUTPUT_INCLUDES) - .PEERDIR=kernel/struct_codegen/metadata kernel/struct_codegen/reflection -} + .PEERDIR=kernel/struct_codegen/metadata kernel/struct_codegen/reflection +} ### @usage: DUMPERF_CODEGEN(Prefix) ### A special case BASE_CODEGEN, in which the extsearch/images/robot/tools/dumperf/codegen tool is used -macro DUMPERF_CODEGEN(Prefix) { - .CMD=$BASE_CODEGEN(extsearch/images/robot/tools/dumperf/codegen, $Prefix, ${output_include;hide:"extsearch/images/kernel/erf/erf_format.h"}) +macro DUMPERF_CODEGEN(Prefix) { + .CMD=$BASE_CODEGEN(extsearch/images/robot/tools/dumperf/codegen, $Prefix, ${output_include;hide:"extsearch/images/kernel/erf/erf_format.h"}) } # tag:flags @@ -6543,48 +6543,48 @@ macro DUMPERF_CODEGEN(Prefix) { ### ### Add flags to the link command line of executable or shared library/dll. ### Note: LDFLAGS are always global. When set in the LIBRARY module they will affect all programs/dlls/tests the library is linked into. -### Note: remember about the incompatibility of flags for gcc and cl. -macro LDFLAGS(Flags...) { - SET_APPEND(LDFLAGS_GLOBAL $Flags) -} - +### Note: remember about the incompatibility of flags for gcc and cl. +macro LDFLAGS(Flags...) { + SET_APPEND(LDFLAGS_GLOBAL $Flags) +} + # tag:flags ### @usage: CFLAGS([GLOBAL compiler_flag]* compiler_flags) ### ### Add the specified flags to the compilation command of C and C++ files. ### @params: GLOBAL - Propagates these flags to dependent projects ### Note: remember about the incompatibility flags for clang and cl (to set flags specifically for cl.exe use MSVC_FLAGS). -macro CFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CFLAGS $Flags) +macro CFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CFLAGS $Flags) } # tag:flags ### @usage: MASMFLAGS(compiler flags) ### Add the specified flags to the compilation command of .masm files. -macro MASMFLAGS(Flags...) { - SET_APPEND(MASMFLAGS $Flags) +macro MASMFLAGS(Flags...) { + SET_APPEND(MASMFLAGS $Flags) } # tag:flags ### @usage: CONLYFLAGS([GLOBAL compiler_flag]* compiler_flags) ### Add the specified flags to the compilation command of .c (but not .cpp) files. ### @params: GLOBAL - Distributes these flags on dependent projects -macro CONLYFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CONLYFLAGS $Flags) +macro CONLYFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CONLYFLAGS $Flags) } # tag:flags ### @usage: CXXFLAGS(compiler_flags) ### Add the specified flags to the compilation command of .cpp (but not .c) files. -macro CXXFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CXXFLAGS $Flags) +macro CXXFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CXXFLAGS $Flags) } # tag:flags ### @usage: CUDA_NVCC_FLAGS(compiler flags) ### Add the specified flags to the compile line .cu-files. -macro CUDA_NVCC_FLAGS(Flags...) { - SET_APPEND(CUDA_NVCC_FLAGS $Flags) +macro CUDA_NVCC_FLAGS(Flags...) { + SET_APPEND(CUDA_NVCC_FLAGS $Flags) } # tag:flags @@ -6599,42 +6599,42 @@ macro NVCC_DEVICE_LINK(Srcs...) { ### @usage: STRIP() ### Strip debug info from a PROGRAM, DLL or TEST. ### This macro doesn't work in LIBRARY's, UNION's and PACKAGE's. -macro STRIP() { - ENABLE(STRIP) +macro STRIP() { + ENABLE(STRIP) } ### @usage: NO_OPTIMIZE() ### Build code without any optimizations (-O0 mode). -macro NO_OPTIMIZE() { - ENABLE(NO_OPTIMIZE) +macro NO_OPTIMIZE() { + ENABLE(NO_OPTIMIZE) } ### @usage: NO_COMPILER_WARNINGS() ### Disable all compiler warnings in the module. ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro NO_COMPILER_WARNINGS() { - ENABLE(NO_COMPILER_WARNINGS) -} - +macro NO_COMPILER_WARNINGS() { + ENABLE(NO_COMPILER_WARNINGS) +} + ### @usage: WERROR() ### Consider warnings as errors in the current module. ### In the bright future will be removed, since WERROR is the default. ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro WERROR() { - ENABLE(WERROR) +macro WERROR() { + ENABLE(WERROR) } ### @usage: NO_WERROR() ### Override WERROR() behavior ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro NO_WERROR() { - DISABLE(WERROR) +macro NO_WERROR() { + DISABLE(WERROR) } ### @usage: NO_WSHADOW() ### Disable C++ shadowing warnings. -macro NO_WSHADOW() { - ENABLE(NO_WSHADOW) +macro NO_WSHADOW() { + ENABLE(NO_WSHADOW) } # tag:internal @@ -6657,8 +6657,8 @@ macro NO_CODENAVIGATION() { ### Build module without dependency on util. ### Note: use this with care. Util most likely will be linked into executable anyway, ### so using util headers/functions/classes may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_UTIL() { - ENABLE(NOUTIL) +macro NO_UTIL() { + ENABLE(NOUTIL) } ### @usage: NO_RUNTIME() @@ -6668,10 +6668,10 @@ macro NO_UTIL() { ### 2. If the project that contains the macro NO_RUNTIME(), peerdir-it project does not contain NO_RUNTIME() => Warning. ### Note: use this with care. Arcadia STL most likely will be linked into executable anyway, so using STL headers/functions/classes ### may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_RUNTIME() { - SET(USE_ARCADIA_LIBM no) - NO_UTIL() - ENABLE(NORUNTIME) +macro NO_RUNTIME() { + SET(USE_ARCADIA_LIBM no) + NO_UTIL() + ENABLE(NORUNTIME) } ### @usage: NO_LIBC() @@ -6679,9 +6679,9 @@ macro NO_RUNTIME() { ### Exclude dependencies on C++ and C runtimes (including util, musl and libeatmydata). ### Note: use this with care. libc most likely will be linked into executable anyway, ### so using libc headers/functions may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_LIBC() { - NO_RUNTIME() - DISABLE(MUSL) +macro NO_LIBC() { + NO_RUNTIME() + DISABLE(MUSL) } ### @usage: NO_PLATFORM() @@ -6695,27 +6695,27 @@ macro NO_PLATFORM() { } # tag:cpp-specific -### @usage: USE_CXX() -### -### Add dependency on C++ runtime -### Note: This macro is inteneded for use in _GO_BASE_UNIT like module when the module is built without C++ runtime by default -macro USE_CXX() { - DISABLE(NORUNTIME) -} - -### @usage: USE_UTIL() -### -### Add dependency on util and C++ runtime -### Note: This macro is intended for use in _GO_BASE_UNIT like module when the module is build without util by default -macro USE_UTIL() { - USE_CXX() - DISABLE(NOUTIL) -} - +### @usage: USE_CXX() +### +### Add dependency on C++ runtime +### Note: This macro is inteneded for use in _GO_BASE_UNIT like module when the module is built without C++ runtime by default +macro USE_CXX() { + DISABLE(NORUNTIME) +} + +### @usage: USE_UTIL() +### +### Add dependency on util and C++ runtime +### Note: This macro is intended for use in _GO_BASE_UNIT like module when the module is build without util by default +macro USE_UTIL() { + USE_CXX() + DISABLE(NOUTIL) +} + # tag:deprecated ### @usage: NO_JOIN_SRC() # deprecated, does-nothing ### This macro currently does nothing. This is default behavior which cannot be overridden at module level. -macro NO_JOIN_SRC() { +macro NO_JOIN_SRC() { ENABLE(UNUSED_MACRO) } @@ -6730,16 +6730,16 @@ macro JOINSRC() { ### @usage: NO_SANITIZE() ### ### Disable all sanitizers for the module. -macro NO_SANITIZE() { - DISABLE(SANITIZER_TYPE) +macro NO_SANITIZE() { + DISABLE(SANITIZER_TYPE) } # tag:coverage tag:sanitize ### @usage: NO_SANITIZE_COVERAGE() ### ### Disable lightweight coverage (-fsanitize-coverage) for the module. -macro NO_SANITIZE_COVERAGE() { - DISABLE(SANITIZE_COVERAGE) +macro NO_SANITIZE_COVERAGE() { + DISABLE(SANITIZE_COVERAGE) } # tag:coverage @@ -6773,20 +6773,20 @@ macro NO_CYTHON_COVERAGE() { } # tag:lua-specific -LUAJIT_PATH=${ARCADIA_ROOT}/contrib/libs/luajit +LUAJIT_PATH=${ARCADIA_ROOT}/contrib/libs/luajit macro _LUAJIT_OBJDUMP(Src, OUT="") { - .CMD=${cwd:LUAJIT_PATH} ${tool:"contrib/libs/luajit/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} + .CMD=${cwd:LUAJIT_PATH} ${tool:"contrib/libs/luajit/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} } # tag:lua-specific -LUAJIT_21_PATH=${ARCADIA_ROOT}/contrib/libs/luajit_21 +LUAJIT_21_PATH=${ARCADIA_ROOT}/contrib/libs/luajit_21 macro _LUAJIT_21_OBJDUMP(Src, OUT="") { .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} } macro _MX_BIN_TO_INFO(Src) { .CMD=${tool:"tools/mx_bin2info"} ${input:Src} ${output;nopath;noext;noauto:Src.info} ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} -} +} MX_GEN_TABLE_INCLS=${output_include;hide:"yabs_mx_calc_table.h"} \ ${output_include;hide:"kernel/matrixnet/mn_sse.h"} \ @@ -6797,8 +6797,8 @@ ${output_include;hide:"util/generic/ptr.h"} \ ${output_include;hide:"util/generic/singleton.h"} macro _MX_GEN_TABLE(Srcs...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_mx_table.py"} $Srcs ${output;stdout:"mx_tables.cpp"} $MX_GEN_TABLE_INCLS ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} - PEERDIR(kernel/matrixnet) + .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_mx_table.py"} $Srcs ${output;stdout:"mx_tables.cpp"} $MX_GEN_TABLE_INCLS ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} + PEERDIR(kernel/matrixnet) PEERDIR(library/cpp/archive) } @@ -6809,8 +6809,8 @@ RELEV_FML_CODEGEN_INCLS=${output_include;hide:"kernel/relevfml/relev_fml.h"} ${o ### Create serialization support for enumeration members defined in the header (String <-> Enum conversions) and compile it into the module. ### ### Documentation: https://wiki.yandex-team.ru/yatool/HowToWriteYaMakeFiles/ -macro GENERATE_ENUM_SERIALIZATION(File) { - .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} ${output_include;hide:File} ${output_include;hide:"util/generic/serialized_enum.h"} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} +macro GENERATE_ENUM_SERIALIZATION(File) { + .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} ${output_include;hide:File} ${output_include;hide:"util/generic/serialized_enum.h"} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} .SEM=generate_enum_serilization ${input:File} ${output;hide;suf=_serialized.o:File} INCLUDE_HEADERS ${input;rootrel:File} ${tool;hide:"tools/enum_parser/enum_parser/bin"} PEERDIR(tools/enum_parser/enum_serialization_runtime) } @@ -6821,17 +6821,17 @@ macro GENERATE_ENUM_SERIALIZATION(File) { ### Provide access to serialization functions via generated header File_serialized.h ### ### Documentation: https://wiki.yandex-team.ru/yatool/HowToWriteYaMakeFiles/ -macro GENERATE_ENUM_SERIALIZATION_WITH_HEADER(File) { - .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} --header ${output;chksum;suf=_serialized.h:File} ${output_include;hide:File} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} +macro GENERATE_ENUM_SERIALIZATION_WITH_HEADER(File) { + .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} --header ${output;chksum;suf=_serialized.h:File} ${output_include;hide:File} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} .SEM=generate_enum_serilization ${input:File} ${output;hide;suf=_serialized.o:File} GEN_HEADER ${output;suf=_serialized.h:File} INCLUDE_HEADERS ${input;rootrel:File} ${tool;hide:"tools/enum_parser/enum_parser/bin"} PEERDIR(tools/enum_parser/enum_serialization_runtime) -} +} ### @usage: DEB_VERSION(File) ### ### Creates a header file DebianVersion.h define the DEBIAN_VERSION taken from the File. -macro DEB_VERSION(File) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/mkver.py"} ${input:File} ${output;stdout:"DebianVersion.h"} ${kv;hide:"p CL"} ${kv;hide:"pc yellow"} +macro DEB_VERSION(File) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/mkver.py"} ${input:File} ${output;stdout:"DebianVersion.h"} ${kv;hide:"p CL"} ${kv;hide:"pc yellow"} } BUILD_MN_SCRIPT=build/scripts/build_mn.py @@ -6841,14 +6841,14 @@ BUILD_MN_SCRIPT=build/scripts/build_mn.py ### ### Generate MatrixNet data and access code using single command. ### Alternative macro BUILD_MNS() works faster and better for large files. -macro BUILD_MN(MnInfo, MnName, CHECK?"fml_tool=$FML_UNUSED_TOOL CHECK":"", MULTI?, PTR?, RANKING_SUFFIX="") { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnF $ARCADIA_ROOT $ARCH_TOOL ${input:MnInfo} $MnName ranking_suffix=$RANKING_SUFFIX ${output;chksum;pre=mn.:MnName.cpp} ${output;hide;pre=MN_External_;suf=.rodata:MnName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} $CHECK $MULTI $PTR ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} +macro BUILD_MN(MnInfo, MnName, CHECK?"fml_tool=$FML_UNUSED_TOOL CHECK":"", MULTI?, PTR?, RANKING_SUFFIX="") { + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnF $ARCADIA_ROOT $ARCH_TOOL ${input:MnInfo} $MnName ranking_suffix=$RANKING_SUFFIX ${output;chksum;pre=mn.:MnName.cpp} ${output;hide;pre=MN_External_;suf=.rodata:MnName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} $CHECK $MULTI $PTR ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } macro _BUILD_MNS_FILE(Input, Name, Output, Suffix, Check, Fml_tool, AsmDataName) { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsFilesF $ARCADIA_ROOT $BINDIR $ARCH_TOOL fml_tool=$Fml_tool $Name ranking_suffix=$Suffix ${input:Input} ${output;hide:Output} ${output;hide;pre=MN_External_;suf=.rodata:AsmDataName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} -} - + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsFilesF $ARCADIA_ROOT $BINDIR $ARCH_TOOL fml_tool=$Fml_tool $Name ranking_suffix=$Suffix ${input:Input} ${output;hide:Output} ${output;hide;pre=MN_External_;suf=.rodata:AsmDataName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} +} + MNS_OUTPUT=mnmodels macro _BUILD_MNS_CPP(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { @@ -6856,7 +6856,7 @@ macro _BUILD_MNS_CPP(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { } macro _BUILD_MNS_HEADER(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsHeaderF $NAME ranking_suffix=$RANKING_SUFFIX ${output:MNS_OUTPUT.h} ${input:Files} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${output_include;hide:"kernel/matrixnet/mn_multi_categ.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsHeaderF $NAME ranking_suffix=$RANKING_SUFFIX ${output:MNS_OUTPUT.h} ${input:Files} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${output_include;hide:"kernel/matrixnet/mn_multi_categ.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } # TODO: support foreach_in and keywords simultaneous usage (look at BUILD_MNS_FILES) @@ -6866,7 +6866,7 @@ macro _BUILD_MNS_HEADER(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { ### ### Generate MatrixNet data and access code using separate commands for support code, interface and data. ### Faster version of BUILD_MN() macro for large files. -macro BUILD_MNS(Files...) { +macro BUILD_MNS(Files...) { _BUILD_MNS_HEADER($Files) _BUILD_MNS_CPP($Files) _BUILD_MNS_FILES($Files) @@ -6914,28 +6914,28 @@ macro NO_NEED_CHECK(Flags...) { ### Mark the project as needing review. ### Reviewers are listed in the macro OWNER. The use of this macro is disabled by default. ### Details can be found here: https://clubs.at.yandex-team.ru/arcadia/6104 -macro NEED_REVIEW(Flags...) { +macro NEED_REVIEW(Flags...) { # TODO: FIXME - ENABLE(UNUSED_MACRO) + ENABLE(UNUSED_MACRO) } ### @usage: VERSION(Args...) ### ### Specify version of a module. Currently unused by build system, only informative. -macro VERSION(Flags...) { - ENABLE(UNUSED_MACRO) +macro VERSION(Flags...) { + ENABLE(UNUSED_MACRO) } DATAWORK_SCHEEME_EXPORT_FLAGS= - -when ($UNIX == "yes") { - SCHEEME2_CFLAGS= -E -x c++ -} - -when ($WIN32 == "yes") { - SCHEEME2_CFLAGS= /E /TP -} - + +when ($UNIX == "yes") { + SCHEEME2_CFLAGS= -E -x c++ +} + +when ($WIN32 == "yes") { + SCHEEME2_CFLAGS= /E /TP +} + SCHEEME2_STRUCT_INFO_FLAGS=-f "const static ui32 RecordSig" -u "RecordSig" --gcc44_no_typename --no_complex_overloaded_func_export ### @usage: GEN_SCHEEME2(scheeme_name from_file dependent_files...) ### @@ -6959,15 +6959,15 @@ SCHEEME2_STRUCT_INFO_FLAGS=-f "const static ui32 RecordSig" -u "RecordSig" --gcc ### ### for compatibility with C++ compiler and the external environment. ### See tools/structparser for more details. -macro GEN_SCHEEME2(ScheemeName, FromFile) { +macro GEN_SCHEEME2(ScheemeName, FromFile) { .CMD=$CXX_COMPILER $C_FLAGS_PLATFORM -c ${tmp;stdout:FromFile.cph} $SCHEEME2_CFLAGS ${input:FromFile} ${pre=-I:_C__INCLUDE} $CXXFLAGS -Wno-error && ${tool:"tools/structparser"} -o ${output:ScheemeName.inc} -n N${ScheemeName}SchemeInfo $SCHEEME2_STRUCT_INFO_FLAGS $DATAWORK_SCHEEME_EXPORT_FLAGS ${tmp:FromFile.cph} ${output;stdout;noauto:ScheemeName.inc.log} ${kv;hide:"p SH"} ${kv;hide:"pc yellow"} -} +} ### @usage: SYMLINK(from to) ### Add symlink -macro SYMLINK(From, To) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/symlink.py"} ${input;dirallowed:From} ${output;noauto:To} ${kv;hide:"p LN"} ${kv;hide:"pc light-cyan"} -} +macro SYMLINK(From, To) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/symlink.py"} ${input;dirallowed:From} ${output;noauto:To} ${kv;hide:"p LN"} ${kv;hide:"pc light-cyan"} +} ### @usage: RUN_PROGRAM(tool_path args... [CWD dir] [ENV key=value...] [TOOL tools...] [IN inputs...] [OUT[_NOAUTO] outputs...] [STDOUT[_NOAUTO] output] [OUTPUT_INCLUDES output_includes...] [REQUIREMENTS reqs]) ### @@ -7118,15 +7118,15 @@ otherwise { ### @usage: COMPILE_C_AS_CXX() ### ### Compile .c files as .cpp ones within a module. -macro COMPILE_C_AS_CXX() { - SET(EXTRA_C_FLAGS $C_AS_CXX_FLAGS) +macro COMPILE_C_AS_CXX() { + SET(EXTRA_C_FLAGS $C_AS_CXX_FLAGS) } ### @usage: NO_DEBUG_INFO() ### ### Compile files without debug info collection. -macro NO_DEBUG_INFO() { - SET(NO_DEBUGINFO yes) +macro NO_DEBUG_INFO() { + SET(NO_DEBUGINFO yes) } ### @usage: CTEMPLATE_VARNAMES(File) @@ -7181,7 +7181,7 @@ macro CLANG_EMIT_AST_CXX(Input, Output, Opts...) { ### ### Emit LLVM bytecode from .cpp file. BC_CXXFLAGS, LLVM_OPTS and C_FLAGS_PLATFORM are passed in, while CFLAGS are not. ### Note: Output name is used as is, no extension added. -macro LLVM_COMPILE_CXX(Input, Output, Opts...) { +macro LLVM_COMPILE_CXX(Input, Output, Opts...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS $CLANG_ROOT/bin/clang++ ${pre=-I:_C__INCLUDE} $BC_CXXFLAGS $C_FLAGS_PLATFORM -Wno-unknown-warning-option $LLVM_OPTS -std=c++17 -fno-lto -emit-llvm -c ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -7190,7 +7190,7 @@ macro LLVM_COMPILE_CXX(Input, Output, Opts...) { ### ### Emit LLVM bytecode from .c file. BC_CFLAGS, LLVM_OPTS and C_FLAGS_PLATFORM are passed in, while CFLAGS are not. ### Note: Output name is used as is, no extension added. -macro LLVM_COMPILE_C(Input, Output, Opts...) { +macro LLVM_COMPILE_C(Input, Output, Opts...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS $CLANG_ROOT/bin/clang ${pre=-I:_C__INCLUDE} $BC_CFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -fno-lto -emit-llvm -c ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -7226,7 +7226,7 @@ macro LLVM_COMPILE_LL(Input, Output, Opts...) { ### ### Call llvm-link on set of Inputs to produce Output. ### Note: Unlike many other macros output argument goes first. Output name is used as is, no extension added. -macro LLVM_LINK(Output, Inputs...) { +macro LLVM_LINK(Output, Inputs...) { .CMD=$CLANG_ROOT/bin/llvm-link ${input:Inputs} -o ${output;noauto:Output} ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-red"} PEERDIR(build/platform/clang) } @@ -7235,28 +7235,28 @@ macro LLVM_LINK(Output, Inputs...) { ### ### Call llvm-opt with set of Opts on Input to produce Output. ### Note: Output name is used as is, no extension added. -macro LLVM_OPT(Input, Output, Opts...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/llvm_opt_wrapper.py"} $CLANG_ROOT/bin/opt ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p OP"} ${kv;hide:"pc yellow"} +macro LLVM_OPT(Input, Output, Opts...) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/llvm_opt_wrapper.py"} $CLANG_ROOT/bin/opt ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p OP"} ${kv;hide:"pc yellow"} PEERDIR(build/platform/clang) } -when ($NO_DEBUGINFO == "yes") { - DEBUG_INFO_FLAGS= -} - -when ($CLANG && $DEBUGINFO_LINES_ONLY == "yes" && $NO_DEBUGINFO != "yes") { - DEBUG_INFO_FLAGS=-gline-tables-only -} +when ($NO_DEBUGINFO == "yes") { + DEBUG_INFO_FLAGS= +} +when ($CLANG && $DEBUGINFO_LINES_ONLY == "yes" && $NO_DEBUGINFO != "yes") { + DEBUG_INFO_FLAGS=-gline-tables-only +} + # TODO: configurable tar and touch PACK_TGZ=${cwd:ARCADIA_BUILD_ROOT} tar -czf ${rootrel:OUTPUT} ${rootrel:INPUT} ${kv;hide:"p AR"} ${kv;hide:"pc light-red"} # tag:internal ### @usage TOUCH(Outputs...) # internal ### Just introduce outputs -macro TOUCH(Outputs...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${output:Outputs} -} +macro TOUCH(Outputs...) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${output:Outputs} +} TOUCH_UNIT=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${kv;hide:"p UN"} ${kv;hide:"pc light-cyan"} $TARGET TOUCH_PACKAGE=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${kv;hide:"pc light-red"} $TARGET && $YMAKE_PYTHON ${input:"build/scripts/copy_to_dir.py"} --dest-dir $BINDIR --build-root $ARCADIA_BUILD_ROOT $PACKED_PACKAGE_ARGS $SRCS_GLOBAL $PEERS _P_PK=${kv;hide:"p PK"} @@ -7268,46 +7268,46 @@ NO_CHECK_IMPORTS_FOR_VALUE=None ### ### Do not run checks on imports of Python modules. ### Optional parameter mask patterns describes the names of the modules that do not need to check. -macro NO_CHECK_IMPORTS(Masks...) { - SET(NO_CHECK_IMPORTS_FOR_VALUE $Masks) -} - +macro NO_CHECK_IMPORTS(Masks...) { + SET(NO_CHECK_IMPORTS_FOR_VALUE $Masks) +} + # tag:yasm-specific -_YASM_FMT_VALUE= -_YASM_PLATFORM_FLAGS_VALUE= -_YASM_PREDEFINED_FLAGS_VALUE= -when ($OS_DARWIN || $OS_IOS) { - _YASM_FMT_VALUE=macho - _YASM_PLATFORM_FLAGS_VALUE=-D DARWIN -D UNIX -} -elsewhen ($OS_WINDOWS && $ARCH_X86_64) { - _YASM_FMT_VALUE=win - _YASM_PLATFORM_FLAGS_VALUE=-D WIN64 -} -elsewhen ($OS_WINDOWS && $ARCH_I386) { - _YASM_FMT_VALUE=win - _YASM_PLATFORM_FLAGS_VALUE=-D WIN32 -} -otherwise { - _YASM_FMT_VALUE=elf - _YASM_PLATFORM_FLAGS_VALUE=-D UNIX - _YASM_PREDEFINED_FLAGS_VALUE=-g dwarf2 -} - +_YASM_FMT_VALUE= +_YASM_PLATFORM_FLAGS_VALUE= +_YASM_PREDEFINED_FLAGS_VALUE= +when ($OS_DARWIN || $OS_IOS) { + _YASM_FMT_VALUE=macho + _YASM_PLATFORM_FLAGS_VALUE=-D DARWIN -D UNIX +} +elsewhen ($OS_WINDOWS && $ARCH_X86_64) { + _YASM_FMT_VALUE=win + _YASM_PLATFORM_FLAGS_VALUE=-D WIN64 +} +elsewhen ($OS_WINDOWS && $ARCH_I386) { + _YASM_FMT_VALUE=win + _YASM_PLATFORM_FLAGS_VALUE=-D WIN32 +} +otherwise { + _YASM_FMT_VALUE=elf + _YASM_PLATFORM_FLAGS_VALUE=-D UNIX + _YASM_PREDEFINED_FLAGS_VALUE=-g dwarf2 +} + when ($ASM_PREFIX) { ASM_PREFIX_VALUE=--prefix=$ASM_PREFIX } otherwise { ASM_PREFIX_VALUE= } - + # tag:yasm-specific -YASM_FLAGS= +YASM_FLAGS= YASM_PREINCLUDES_VALUE= - + # tag:yasm-specific -macro _SRC_yasm(SRC, PREINCLUDES[], SRCFLAGS...) { +macro _SRC_yasm(SRC, PREINCLUDES[], SRCFLAGS...) { .CMD=${tool:"contrib/tools/yasm"} -f ${_YASM_FMT_VALUE}${HARDWARE_ARCH} $_YASM_PLATFORM_FLAGS_VALUE $YASM_DEBUG_INFO $YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__ -D ${pre=_;suf=_:HARDWARE_TYPE} -D_YASM_ $ASM_PREFIX_VALUE $_YASM_PREDEFINED_FLAGS_VALUE $YASM_FLAGS ${pre=-I :_ASM__INCLUDE} $SRCFLAGS -o ${output;noext;suf=${OBJECT_SUF}:SRC} ${pre=-P :PREINCLUDES} ${input;hide:PREINCLUDES} ${input:SRC} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p AS"} ${kv;hide:"pc light-green"} } @@ -7323,63 +7323,63 @@ macro ASM_PREINCLUDE(PREINCLUDES...) { ### ### Version of RUN() macro to invoke Python scripts ### @see: [RUN()](#macro_RUN) -macro RUN_PYTHON(Args...) { +macro RUN_PYTHON(Args...) { SETUP_RUN_PYTHON() RUN(${PYTHON_BIN} $Args) } - -### @usage: RUN_ANTLR(Args...) -### -### Macro to invoke ANTLR3 generator (general case) + +### @usage: RUN_ANTLR(Args...) +### +### Macro to invoke ANTLR3 generator (general case) macro RUN_ANTLR(IN[], OUT[], OUT_NOAUTO[], OUTPUT_INCLUDES[], REQUIREMENTS[], CWD="", Args...) { - PEERDIR(build/external_resources/antlr3) + PEERDIR(build/external_resources/antlr3) _RUN_JAVA(-jar $ANTLR3_RESOURCE_GLOBAL/antlr-3.5.2-complete-no-st3.jar $Args IN $IN OUT $OUT OUT_NOAUTO $OUT_NOAUTO OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS ${pre=CWD :CWD}) -} - -### @usage: RUN_ANTLR4(Args...) -### -### Macro to invoke ANTLR4 generator (general case) +} + +### @usage: RUN_ANTLR4(Args...) +### +### Macro to invoke ANTLR4 generator (general case) macro RUN_ANTLR4(IN[], OUT[], OUT_NOAUTO[], OUTPUT_INCLUDES[], REQUIREMENTS[], CWD="", Args...) { - PEERDIR(build/external_resources/antlr4) + PEERDIR(build/external_resources/antlr4) _RUN_JAVA(-jar $ANTLR4_RESOURCE_GLOBAL/antlr-4.9-complete.jar $Args IN $IN OUT $OUT OUT_NOAUTO $OUT_NOAUTO OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS ${pre=CWD :CWD}) -} - -_ANTLR4_LISTENER_GRAMMAR=-listener -_ANTLR4_LISTENER__ANTLR4_EMPTY=-no-listener -_ANTLR4_VISITOR_GRAMMAR=-visitor -_ANTLR4_VISITOR__ANTLR4_EMPTY=-no-visitor - -### @usage: RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) -### -### Macro to invoke ANTLR4 generator (Cpp) -macro RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { - RUN_ANTLR4(${GRAMMAR} -Dlanguage=Cpp -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;suf=Lexer.cpp:GRAMMAR} ${noext;suf=Lexer.h:GRAMMAR} ${noext;suf=Parser.cpp:GRAMMAR} ${noext;suf=Parser.h:GRAMMAR} ${noext;suf=Listener.h:$LISTENER} ${noext;suf=BaseListener.h:$LISTENER} ${noext;suf=Visitor.h:$VISITOR} ${noext;suf=BaseVisitor.h:$VISITOR} OUTPUT_INCLUDES ${ARCADIA_ROOT}/contrib/libs/antlr4_cpp_runtime/src/antlr4-runtime.h ${OUTPUT_INCLUDES}) - PEERDIR(contrib/libs/antlr4_cpp_runtime) -} - -### @usage: RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) -### -### Macro to invoke ANTLR4 generator (Go) -macro RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { - RUN_ANTLR4(${GRAMMAR} -Dlanguage=Go -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;tolower;suf=_lexer.go:GRAMMAR} ${noext;tolower;suf=_parser.go:GRAMMAR} ${noext;tolower;suf=_listener.go:$LISTENER} ${noext;tolower;suf=_base_listener.go:$LISTENER} ${noext;tolower;suf=_visitor.go:$VISITOR} ${noext;tolower;suf=_base_visitor.go:$VISITOR} OUTPUT_INCLUDES ${OUTPUT_INCLUDES}) - PEERDIR(${GOSTD}/fmt ${GOSTD}/reflect ${GOSTD}/strconv ${GOSTD}/unicode vendor/github.com/antlr/antlr4/runtime/Go/antlr) -} - +} + +_ANTLR4_LISTENER_GRAMMAR=-listener +_ANTLR4_LISTENER__ANTLR4_EMPTY=-no-listener +_ANTLR4_VISITOR_GRAMMAR=-visitor +_ANTLR4_VISITOR__ANTLR4_EMPTY=-no-visitor + +### @usage: RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) +### +### Macro to invoke ANTLR4 generator (Cpp) +macro RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { + RUN_ANTLR4(${GRAMMAR} -Dlanguage=Cpp -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;suf=Lexer.cpp:GRAMMAR} ${noext;suf=Lexer.h:GRAMMAR} ${noext;suf=Parser.cpp:GRAMMAR} ${noext;suf=Parser.h:GRAMMAR} ${noext;suf=Listener.h:$LISTENER} ${noext;suf=BaseListener.h:$LISTENER} ${noext;suf=Visitor.h:$VISITOR} ${noext;suf=BaseVisitor.h:$VISITOR} OUTPUT_INCLUDES ${ARCADIA_ROOT}/contrib/libs/antlr4_cpp_runtime/src/antlr4-runtime.h ${OUTPUT_INCLUDES}) + PEERDIR(contrib/libs/antlr4_cpp_runtime) +} + +### @usage: RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) +### +### Macro to invoke ANTLR4 generator (Go) +macro RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { + RUN_ANTLR4(${GRAMMAR} -Dlanguage=Go -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;tolower;suf=_lexer.go:GRAMMAR} ${noext;tolower;suf=_parser.go:GRAMMAR} ${noext;tolower;suf=_listener.go:$LISTENER} ${noext;tolower;suf=_base_listener.go:$LISTENER} ${noext;tolower;suf=_visitor.go:$VISITOR} ${noext;tolower;suf=_base_visitor.go:$VISITOR} OUTPUT_INCLUDES ${OUTPUT_INCLUDES}) + PEERDIR(${GOSTD}/fmt ${GOSTD}/reflect ${GOSTD}/strconv ${GOSTD}/unicode vendor/github.com/antlr/antlr4/runtime/Go/antlr) +} + # tag:cpp-specific macro CPP_ADDINCL(Dirs...) { ADDINCL($Dirs) } # tag:internal -_WHOLE_ARCHIVE_PEERS_VALUE= -### @usage: WHOLE_ARCHIVE(dirnames...) # internal -macro WHOLE_ARCHIVE(PEERS...) { - SET_APPEND(_WHOLE_ARCHIVE_PEERS_VALUE ${PEERS}) - REQUIRES(${PEERS}) -} - -ANDROID_SDK_ROOT=${ANDROID_SDK_RESOURCE_GLOBAL}/android_sdk - +_WHOLE_ARCHIVE_PEERS_VALUE= +### @usage: WHOLE_ARCHIVE(dirnames...) # internal +macro WHOLE_ARCHIVE(PEERS...) { + SET_APPEND(_WHOLE_ARCHIVE_PEERS_VALUE ${PEERS}) + REQUIRES(${PEERS}) +} + +ANDROID_SDK_ROOT=${ANDROID_SDK_RESOURCE_GLOBAL}/android_sdk + macro TASKLET() { PEERDIR(tasklet/api) @@ -7480,8 +7480,8 @@ multimodule PROTO_LIBRARY { .ALLOWED=EXPOSE # TODO(svidyuk): think about marker which forces semantics inheritance .SEM=PROTO_LIBRARY_SEM - ENABLE(CPP_PROTO) - ENABLE(GEN_PROTO) + ENABLE(CPP_PROTO) + ENABLE(GEN_PROTO) NO_CLANG_TIDY() SET(PEERDIR_TAGS CPP_PROTO) @@ -7503,10 +7503,10 @@ multimodule PROTO_LIBRARY { .ALLOWED=GRPC .SEM=ignored SET(PEERDIR_TAGS JAVA_PROTO) - ENABLE(JAVA_PROTO) + ENABLE(JAVA_PROTO) PEERDIR+=$JAVA_PROTOBUF_PEERS contrib/java/javax/annotation/javax.annotation-api/1.3.1 - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE ADDINCL(FOR proto $PROTOBUF_PATH) when ($_COMMON_GOOGLE_APIS != "None") { @@ -7521,7 +7521,7 @@ multimodule PROTO_LIBRARY { .PEERDIRSELF=CPP_PROTO .SEM=ignored SET(PEERDIR_TAGS PY2 PY_PROTO) - ENABLE(PY_PROTO) + ENABLE(PY_PROTO) OPTIMIZE_PY_PROTOS() OBJ_SUF=.py2 # Can not use NO_LINT(), because is not allowed outside of contrib directory @@ -7545,7 +7545,7 @@ multimodule PROTO_LIBRARY { .PEERDIRSELF=CPP_PROTO .SEM=ignored SET(PEERDIR_TAGS PY3 PY3_PROTO) - ENABLE(PY3_PROTO) + ENABLE(PY3_PROTO) OPTIMIZE_PY_PROTOS() when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_PREFIX=py3 @@ -7568,12 +7568,12 @@ multimodule PROTO_LIBRARY { } SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) } - - module GO_PROTO: GO_LIBRARY { + + module GO_PROTO: GO_LIBRARY { .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO .SEM=ignored - SET(PEERDIR_TAGS GO GO_PROTO) - ENABLE(GO_PROTO) + SET(PEERDIR_TAGS GO GO_PROTO) + ENABLE(GO_PROTO) when ($_COMMON_GOOGLE_APIS == "None") { } @@ -7585,26 +7585,26 @@ multimodule PROTO_LIBRARY { PEERDIR += $_COMMON_GOOGLE_APIS ADDINCL += FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos } - } - + } + module EXT_PROTO: _BARE_UNIT { - .ALIASES=SRCS=_RAW_PROTO_SRCS - .CMD=TOUCH_UNIT_MF + .ALIASES=SRCS=_RAW_PROTO_SRCS + .CMD=TOUCH_UNIT_MF .SEM=ignored - .EXTS=.* - .PROXY=yes - .PEERDIR_POLICY=as_build_from - SET(PEERDIR_TAGS EXT_PROTO) - ENABLE(EXT_PROTO) - SET(MODULE_SUFFIX .raw.fake.pkg) - SET(MODULE_TYPE LIBRARY) + .EXTS=.* + .PROXY=yes + .PEERDIR_POLICY=as_build_from + SET(PEERDIR_TAGS EXT_PROTO) + ENABLE(EXT_PROTO) + SET(MODULE_SUFFIX .raw.fake.pkg) + SET(MODULE_TYPE LIBRARY) when ($_COMMON_GOOGLE_APIS != "None") { PEERDIR += contrib/libs/googleapis-common-protos } SET(CREDITS_FILE_EXTRA_EXT .ext_proto) - } - + } + module DESC_PROTO: _BARE_UNIT { .CMD=_PROTO_DESC_MERGE_CMD .SEM=ignored @@ -7634,52 +7634,52 @@ multimodule PROTO_LIBRARY { } } - module PB_PY_PROTO: _PY_PACKAGE { - .INCLUDE_TAG=no - .PROXY=yes + module PB_PY_PROTO: _PY_PACKAGE { + .INCLUDE_TAG=no + .PROXY=yes .SEM=ignored - SET(MODULE_SUFFIX .pb_py.fake.pkg) - ENABLE(PB_PY_PROTO) + SET(MODULE_SUFFIX .pb_py.fake.pkg) + ENABLE(PB_PY_PROTO) # WARN: # _COMMON_GOOGLE_APIS aren't handled intentionally. # PB_PY_PROTO is a legacy module type, stop using it. - } + } } # tag:proto -_EXT_PROTO_DIR=_RAW_ - +_EXT_PROTO_DIR=_RAW_ + # tag:proto -### This var defines the root of the tree for copied proto files from EXT_PROTO -### submodule of PROTO_LIBRARY module -EXT_PROTO_ROOT=${ARCADIA_BUILD_ROOT}/${_EXT_PROTO_DIR} - +### This var defines the root of the tree for copied proto files from EXT_PROTO +### submodule of PROTO_LIBRARY module +EXT_PROTO_ROOT=${ARCADIA_BUILD_ROOT}/${_EXT_PROTO_DIR} + # tag:proto -### @usage: USE_EXT_PROTO(peerdir_tag...) -### -### Configure module to use proto files from existing PROTO_LIBRARY module. +### @usage: USE_EXT_PROTO(peerdir_tag...) +### +### Configure module to use proto files from existing PROTO_LIBRARY module. ### Additional PEERDIR tags required to build a module can be passed through -### EXTRA_TAGS vararg parameter. -macro USE_EXT_PROTO(EXTRA_TAGS...) { - SET(PEERDIR_TAGS EXT_PROTO ${EXTRA_TAGS}) - SRCDIR(${EXT_PROTO_ROOT}) -} - +### EXTRA_TAGS vararg parameter. +macro USE_EXT_PROTO(EXTRA_TAGS...) { + SET(PEERDIR_TAGS EXT_PROTO ${EXTRA_TAGS}) + SRCDIR(${EXT_PROTO_ROOT}) +} + # tag:proto tag:internal -### @usage: _RAW_PROTO_SRCS(files...) # internal -### -### _RAW_PROTO_SRCS is a proxy macro to FILES macro which filters out -### GLOBAL keyword from the list of files (NOTE! The order of files listed -### originally in call to _RAW_PROTO_SRCS() macro is changed in call to -### FILES() macro). Currently this macro copies only files with the following -### extensions: .proto, .gztproto, .ev -macro _RAW_PROTO_SRCS(FILES...) { - COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR}) - COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR}) - COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR}) -} - +### @usage: _RAW_PROTO_SRCS(files...) # internal +### +### _RAW_PROTO_SRCS is a proxy macro to FILES macro which filters out +### GLOBAL keyword from the list of files (NOTE! The order of files listed +### originally in call to _RAW_PROTO_SRCS() macro is changed in call to +### FILES() macro). Currently this macro copies only files with the following +### extensions: .proto, .gztproto, .ev +macro _RAW_PROTO_SRCS(FILES...) { + COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR}) + COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR}) + COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR}) +} + module PROTO_DESCRIPTIONS: _BARE_UNIT { .CMD=_PROTO_DESC_MERGE_PEERS_CMD .PEERDIR_POLICY=as_build_from @@ -7697,166 +7697,166 @@ module PROTO_REGISTRY: PROTO_DESCRIPTIONS { } # tag:fbs -_FBS_NAMESPACE_MAP_GLOBAL= - +_FBS_NAMESPACE_MAP_GLOBAL= + # tag:fbs -macro _FBS_NAMESPACE_IMPL(NAMESPACE, PATH, DUMMY...) { - SET_APPEND(_FBS_NAMESPACE_MAP_GLOBAL ${NAMESPACE}=${PATH}) -} - +macro _FBS_NAMESPACE_IMPL(NAMESPACE, PATH, DUMMY...) { + SET_APPEND(_FBS_NAMESPACE_MAP_GLOBAL ${NAMESPACE}=${PATH}) +} + # tag:fbs -macro FBS_NAMESPACE(NAMESPACE, PATH...) { - _FBS_NAMESPACE_IMPL($NAMESPACE $PATH $MODDIR) -} - +macro FBS_NAMESPACE(NAMESPACE, PATH...) { + _FBS_NAMESPACE_IMPL($NAMESPACE $PATH $MODDIR) +} + # tag:fbs -### @usage: FBS_LIBRARY() -### -### Build some variant of Flatbuffers library. -### -### The particular variant is selected based on where PEERDIR to FBS_LIBRARY -### comes from. -### -### Now supported 5 variants: C++, Java, Python 2.x, Python 3.x and Go. -### When PEERDIR comes from module for particular language appropriate variant -### is selected. -### -### Notes: FBS_NAMESPACE must be specified in all dependent FBS_LIBRARY modules -### if build of Go code is requested. -multimodule FBS_LIBRARY { - module CPP_FBS: LIBRARY { - ENABLE(CPP_FBS) - SET(PEERDIR_TAGS CPP_FBS) - } - - module GO_FBS: GO_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - ENABLE(GO_FBS) - SET(PEERDIR_TAGS GO GO_FBS) - } - - module JAVA_FBS: EXTERNAL_JAVA_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - ENABLE(JAVA_FBS) - SET(PEERDIR_TAGS JAVA_FBS) - } - - module PY2_FBS: PY2_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - .ALIASES=SRCS=PY_SRCS - ENABLE(PY2_FBS) - SET(PEERDIR_TAGS PY2 PY2_FBS) - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(LINT_LEVEL_VALUE none_internal) - } - - module PY3_FBS: PY3_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - .ALIASES=SRCS=PY_SRCS - ENABLE(PY3_FBS) - SET(PEERDIR_TAGS PY3 PY3_FBS) - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(LINT_LEVEL_VALUE none_internal) - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=py3 - } - otherwise { - MODULE_PREFIX=libpy3 - } - OBJ_SUF=.py3 - } -} - +### @usage: FBS_LIBRARY() +### +### Build some variant of Flatbuffers library. +### +### The particular variant is selected based on where PEERDIR to FBS_LIBRARY +### comes from. +### +### Now supported 5 variants: C++, Java, Python 2.x, Python 3.x and Go. +### When PEERDIR comes from module for particular language appropriate variant +### is selected. +### +### Notes: FBS_NAMESPACE must be specified in all dependent FBS_LIBRARY modules +### if build of Go code is requested. +multimodule FBS_LIBRARY { + module CPP_FBS: LIBRARY { + ENABLE(CPP_FBS) + SET(PEERDIR_TAGS CPP_FBS) + } + + module GO_FBS: GO_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + ENABLE(GO_FBS) + SET(PEERDIR_TAGS GO GO_FBS) + } + + module JAVA_FBS: EXTERNAL_JAVA_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + ENABLE(JAVA_FBS) + SET(PEERDIR_TAGS JAVA_FBS) + } + + module PY2_FBS: PY2_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .ALIASES=SRCS=PY_SRCS + ENABLE(PY2_FBS) + SET(PEERDIR_TAGS PY2 PY2_FBS) + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(LINT_LEVEL_VALUE none_internal) + } + + module PY3_FBS: PY3_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .ALIASES=SRCS=PY_SRCS + ENABLE(PY3_FBS) + SET(PEERDIR_TAGS PY3 PY3_FBS) + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(LINT_LEVEL_VALUE none_internal) + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=py3 + } + otherwise { + MODULE_PREFIX=libpy3 + } + OBJ_SUF=.py3 + } +} + # tag:java-specific _COMPILE_JSRC=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/compile_jsrc.py"} --input $AUTO_INPUT --output $TARGET --prefix $BINDIR ${requirements;hide:JAVA_REQUIREMENTS} ${kv;hide:"p JC"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - + # tag:java-specific -COMPILE_JSRC_MF=$_COMPILE_JSRC && $GENERATE_MF - +COMPILE_JSRC_MF=$_COMPILE_JSRC && $GENERATE_MF + # tag:java-specific tag:internal -### @usage: JSRC_LIBRARY() # internal +### @usage: JSRC_LIBRARY() # internal module JSRC_LIBRARY: _BARE_UNIT { - .CMD=COMPILE_JSRC_MF - .EXTS=.java - .ALL_INS_TO_OUT=no - .PEERDIR_POLICY=as_include - .FINAL_TARGET=no - .ALIASES=SRCS=FILES - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL - MODULE_TYPE=Library - SET(MODULE_SUFFIX .jsrc) - SET(DONT_RESOLVE_INCLUDES yes) - SET(NEED_PLATFORM_PEERDIRS no) + .CMD=COMPILE_JSRC_MF + .EXTS=.java + .ALL_INS_TO_OUT=no + .PEERDIR_POLICY=as_include + .FINAL_TARGET=no + .ALIASES=SRCS=FILES + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL + MODULE_TYPE=Library + SET(MODULE_SUFFIX .jsrc) + SET(DONT_RESOLVE_INCLUDES yes) + SET(NEED_PLATFORM_PEERDIRS no) SET(MODULE_LANG JAVA) - - NO_RUNTIME() -} - + + NO_RUNTIME() +} + # tag:maps-specific @import "${CONF_ROOT}/conf/project_specific/maps/asrc.conf" - + # tag:internal ### @usage: _PROXY_LIBRARY() # internal -### -### The use of this module is strictly prohibited!!! -module _PROXY_LIBRARY: LIBRARY { - .EXTS=.a .lib - .PEERDIR_POLICY=as_build_from - .PROXY=yes - .FINAL_TARGET=yes - DISABLE(NEED_ADD_FAKE_SRC) - - NO_UTIL() - NO_RUNTIME() -} - +### +### The use of this module is strictly prohibited!!! +module _PROXY_LIBRARY: LIBRARY { + .EXTS=.a .lib + .PEERDIR_POLICY=as_build_from + .PROXY=yes + .FINAL_TARGET=yes + DISABLE(NEED_ADD_FAKE_SRC) + + NO_UTIL() + NO_RUNTIME() +} + # tag:maps-specific @import "${CONF_ROOT}/conf/project_specific/maps/aar.conf" @import "${CONF_ROOT}/conf/project_specific/maps/sproto.conf" @import "${CONF_ROOT}/conf/project_specific/maps/mapkit.conf" -_PRIMARY_OUTPUT_VALUE= - +_PRIMARY_OUTPUT_VALUE= + # tag:internal -### @usage: PRIMARY_OUTPUT_VALUE(Output) # internal -### -### The use of this module is strictly prohibited!!! -macro PRIMARY_OUTPUT(OUTPUT) { - SET(_PRIMARY_OUTPUT_VALUE $OUTPUT) -} - -_DLL_PROXY_LIBRARY_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${input;hide:_PRIMARY_OUTPUT_VALUE} ${TARGET} - +### @usage: PRIMARY_OUTPUT_VALUE(Output) # internal +### +### The use of this module is strictly prohibited!!! +macro PRIMARY_OUTPUT(OUTPUT) { + SET(_PRIMARY_OUTPUT_VALUE $OUTPUT) +} + +_DLL_PROXY_LIBRARY_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${input;hide:_PRIMARY_OUTPUT_VALUE} ${TARGET} + # tag:internal -### @usage: DLL_PROXY_LIBRARY() # internal -### -### The use of this module is strictly prohibited!!! -module DLL_PROXY_LIBRARY: _PROXY_LIBRARY { - .ALLOWED=PRIMARY_OUTPUT - .CMD=_DLL_PROXY_LIBRARY_CMD -} - +### @usage: DLL_PROXY_LIBRARY() # internal +### +### The use of this module is strictly prohibited!!! +module DLL_PROXY_LIBRARY: _PROXY_LIBRARY { + .ALLOWED=PRIMARY_OUTPUT + .CMD=_DLL_PROXY_LIBRARY_CMD +} + _PREBUILT_PROGRAM_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${TARGET} ${kv;hide:"p ld"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - + # tag:internal -### @usage: PREBUILT_PROGRAM([programname]) # internal -### -### Program module which uses a prebuilt prgram as its output. -module PREBUILT_PROGRAM: _LINK_UNIT { - .CMD=_PREBUILT_PROGRAM_CMD - .SYMLINK_POLICY=EXE - .ALLOWED=INDUCED_DEPS PRIMARY_OUTPUT - .RESTRICTED=SRCS - - _BARE_LINK_MODULE() - - SET(MODULE_TYPE PROGRAM) - - when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } -} - +### @usage: PREBUILT_PROGRAM([programname]) # internal +### +### Program module which uses a prebuilt prgram as its output. +module PREBUILT_PROGRAM: _LINK_UNIT { + .CMD=_PREBUILT_PROGRAM_CMD + .SYMLINK_POLICY=EXE + .ALLOWED=INDUCED_DEPS PRIMARY_OUTPUT + .RESTRICTED=SRCS + + _BARE_LINK_MODULE() + + SET(MODULE_TYPE PROGRAM) + + when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } +} + ### @usage COLLECT_JINJA_TEMPLATES(varname path) ### ### This macro collects all jinja and yaml files in the directory specified by second argument and @@ -7866,446 +7866,446 @@ macro COLLECT_JINJA_TEMPLATES(VAR, DIR) { } # tag:go-specific -GO_HOST_OS=unknown -when ($HOST_OS_LINUX) { - GO_HOST_OS=linux -} -elsewhen ($HOST_OS_DARWIN) { - GO_HOST_OS=darwin -} -elsewhen($HOST_OS_WINDOWS) { - GO_HOST_OS=windows -} - +GO_HOST_OS=unknown +when ($HOST_OS_LINUX) { + GO_HOST_OS=linux +} +elsewhen ($HOST_OS_DARWIN) { + GO_HOST_OS=darwin +} +elsewhen($HOST_OS_WINDOWS) { + GO_HOST_OS=windows +} + # tag:go-specific -GO_HOST_ARCH=unknown -when ($HOST_ARCH_X86_64) { - GO_HOST_ARCH=amd64 -} +GO_HOST_ARCH=unknown +when ($HOST_ARCH_X86_64) { + GO_HOST_ARCH=amd64 +} elsewhen($HOST_ARCH_ARM64) { GO_HOST_ARCH=arm64 } - + # tag:go-specific -GO_TARG_OS=unknown -when ($OS_LINUX) { - GO_TARG_OS=linux -} -elsewhen ($OS_DARWIN) { - GO_TARG_OS=darwin -} -elsewhen ($OS_WINDOWS) { - GO_TARG_OS=windows -} - +GO_TARG_OS=unknown +when ($OS_LINUX) { + GO_TARG_OS=linux +} +elsewhen ($OS_DARWIN) { + GO_TARG_OS=darwin +} +elsewhen ($OS_WINDOWS) { + GO_TARG_OS=windows +} + # tag:go-specific -GO_TARG_ARCH=unknwon -when ($ARCH_X86_64) { - GO_TARG_ARCH=amd64 -} -elsewhen ($ARCH_I386) { - GO_TARG_ARCH=x86 -} +GO_TARG_ARCH=unknwon +when ($ARCH_X86_64) { + GO_TARG_ARCH=amd64 +} +elsewhen ($ARCH_I386) { + GO_TARG_ARCH=x86 +} elsewhen ($ARCH_ARM64) { GO_TARG_ARCH=arm64 } - + # tag:go-specific -GO_HOST_TARG_PARAMS=++host-os $GO_HOST_OS ++host-arch $GO_HOST_ARCH ++targ-os $GO_TARG_OS ++targ-arch $GO_TARG_ARCH - +GO_HOST_TARG_PARAMS=++host-os $GO_HOST_OS ++host-arch $GO_HOST_ARCH ++targ-os $GO_TARG_OS ++targ-arch $GO_TARG_ARCH + # tag:go-specific -GOSTD_VERSION=1.17.6 -when ($GOSTD_VERSION == "1.17.6") { - GOSTD=contrib/go/_std/src -} -elsewhen ($GOSTD_VERSION == "1.18beta2") { - GOSTD=contrib/go/_std_1.18beta2/src -} -otherwise { - GOSTD=__unsupported_go_std_library_version_[$GOSTD_VERSION]__ -} - +GOSTD_VERSION=1.17.6 +when ($GOSTD_VERSION == "1.17.6") { + GOSTD=contrib/go/_std/src +} +elsewhen ($GOSTD_VERSION == "1.18beta2") { + GOSTD=contrib/go/_std_1.18beta2/src +} +otherwise { + GOSTD=__unsupported_go_std_library_version_[$GOSTD_VERSION]__ +} + # tag:go-specific -GO_DEBUG_PATH_RELATIVE=no -_GO_DEBUG_PATH__NO_UID__= -_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__= - +GO_DEBUG_PATH_RELATIVE=no +_GO_DEBUG_PATH__NO_UID__= +_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__= + # tag:go-specific -_GO_IMPORT_PATH=${MODDIR} - +_GO_IMPORT_PATH=${MODDIR} + # tag:go-specific GO_VET=yolint -GO_VET_TOOL= -GO_VET_FLAGS= -GO_VET_EXTRA_FLAGS= - +GO_VET_TOOL= +GO_VET_FLAGS= +GO_VET_EXTRA_FLAGS= + # tag:go-specific -_GO_VET_ADD_CHECK=yes -_GO_FMT_ADD_CHECK=yes -_GO_YDX_FILE= - +_GO_VET_ADD_CHECK=yes +_GO_FMT_ADD_CHECK=yes +_GO_YDX_FILE= + # tag:go-specific -_GO_CGO1_WRAPPER_FLAGS=--build-prefix=/-B --source-prefix=/-S -_GO_LINK_EXE_EXT_CMD= - +_GO_CGO1_WRAPPER_FLAGS=--build-prefix=/-B --source-prefix=/-S +_GO_LINK_EXE_EXT_CMD= + # tag:go-specific -GO_WITH_MUSL= - +GO_WITH_MUSL= + # tag:go-specific -GO_TOOLS_ROOT=${GO_TOOLS_RESOURCE_GLOBAL} -GO_TEST_MINER=${tool:"tools/go_test_miner"} -GO_TEST_IMPORT_PATH= - +GO_TOOLS_ROOT=${GO_TOOLS_RESOURCE_GLOBAL} +GO_TEST_MINER=${tool:"tools/go_test_miner"} +GO_TEST_IMPORT_PATH= + # tag:go-specific -GO_STD_LIB_PREFIX=${GOSTD}/ -GO_ARCADIA_PROJECT_PREFIX=a.yandex-team.ru/ -GO_CONTRIB_PROJECT_PREFIX=vendor/ -GO_SKIP_IMPORTS=unsafe C -GO_VET_INFO_EXT=.vet.out -GO_VET_REPORT_EXT=.vet.txt -GO_VET_OUTPUT_INFO=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_INFO_EXT}:REALPRJNAME} -GO_VET_OUTPUT_REPORT=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_REPORT_EXT}:REALPRJNAME} - +GO_STD_LIB_PREFIX=${GOSTD}/ +GO_ARCADIA_PROJECT_PREFIX=a.yandex-team.ru/ +GO_CONTRIB_PROJECT_PREFIX=vendor/ +GO_SKIP_IMPORTS=unsafe C +GO_VET_INFO_EXT=.vet.out +GO_VET_REPORT_EXT=.vet.txt +GO_VET_OUTPUT_INFO=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_INFO_EXT}:REALPRJNAME} +GO_VET_OUTPUT_REPORT=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_REPORT_EXT}:REALPRJNAME} + # tag:go-specific tag:codenav -_GO_YNDEXER_EXT=.ydx.pb2 -GO_YNDEXER_OUTPUT=${output;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${_GO_YNDEXER_EXT}:REALPRJNAME} - +_GO_YNDEXER_EXT=.ydx.pb2 +GO_YNDEXER_OUTPUT=${output;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${_GO_YNDEXER_EXT}:REALPRJNAME} + # tag:go-specific -GO_PROJECT_PREFIXES=++std-lib-prefix $GO_STD_LIB_PREFIX ++arc-project-prefix $GO_ARCADIA_PROJECT_PREFIX - +GO_PROJECT_PREFIXES=++std-lib-prefix $GO_STD_LIB_PREFIX ++arc-project-prefix $GO_ARCADIA_PROJECT_PREFIX + # tag:go-specific -_GO_FAKEID=${FAKEID}.${BUILD_TYPE}.${GO_FAKEID} - +_GO_FAKEID=${FAKEID}.${BUILD_TYPE}.${GO_FAKEID} + # tag:go-specific -CGO2_CFLAGS_VALUE= -CGO2_LDFLAGS_VALUE= - +CGO2_CFLAGS_VALUE= +CGO2_LDFLAGS_VALUE= + # tag:go-specific -GO_ASM_FLAGS_VALUE= -### @usage: GO_ASM_FLAGS(flags) +GO_ASM_FLAGS_VALUE= +### @usage: GO_ASM_FLAGS(flags) ### Add the specified flags to the go asm compile command line. -macro GO_ASM_FLAGS(Flags...) { - SET_APPEND(GO_ASM_FLAGS_VALUE $Flags) -} - +macro GO_ASM_FLAGS(Flags...) { + SET_APPEND(GO_ASM_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_CGO1_FLAGS_VALUE= -### @usage: GO_CGO1_FLAGS(flags) -### Add the specified flags to the go cgo compile command line. -macro GO_CGO1_FLAGS(Flags...) { - SET_APPEND(GO_CGO1_FLAGS_VALUE $Flags) -} - +GO_CGO1_FLAGS_VALUE= +### @usage: GO_CGO1_FLAGS(flags) +### Add the specified flags to the go cgo compile command line. +macro GO_CGO1_FLAGS(Flags...) { + SET_APPEND(GO_CGO1_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_CGO2_FLAGS_VALUE= -### @usage: GO_CGO2_FLAGS(flags) -### Add the specified flags to the go cgo compile command line. -macro GO_CGO2_FLAGS(Flags...) { - SET_APPEND(GO_CGO2_FLAGS_VALUE $Flags) -} - +GO_CGO2_FLAGS_VALUE= +### @usage: GO_CGO2_FLAGS(flags) +### Add the specified flags to the go cgo compile command line. +macro GO_CGO2_FLAGS(Flags...) { + SET_APPEND(GO_CGO2_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_COMPILE_FLAGS_VALUE=$USER_GO_COMPILE_FLAGS -### @usage: GO_COMPILE_FLAGS(flags) -### Add the specified flags to the go compile command line. -macro GO_COMPILE_FLAGS(Flags...) { - SET_APPEND(GO_COMPILE_FLAGS_VALUE $Flags) -} - +GO_COMPILE_FLAGS_VALUE=$USER_GO_COMPILE_FLAGS +### @usage: GO_COMPILE_FLAGS(flags) +### Add the specified flags to the go compile command line. +macro GO_COMPILE_FLAGS(Flags...) { + SET_APPEND(GO_COMPILE_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_LINK_FLAGS_VALUE=$USER_GO_LINK_FLAGS -### @usage: GO_LINK_FLAGS(flags) -### Add the specified flags to the go link command line. -macro GO_LINK_FLAGS(Flags...) { - SET_APPEND(GO_LINK_FLAGS_VALUE $Flags) -} - +GO_LINK_FLAGS_VALUE=$USER_GO_LINK_FLAGS +### @usage: GO_LINK_FLAGS(flags) +### Add the specified flags to the go link command line. +macro GO_LINK_FLAGS(Flags...) { + SET_APPEND(GO_LINK_FLAGS_VALUE $Flags) +} + # tag:go-specific -_GO_TOOL_MODE= - +_GO_TOOL_MODE= + # tag:go-specific -_GO_TOOL_COMMON_FLAGS=\ - ++mode $_GO_TOOL_MODE \ - $GO_PROJECT_PREFIXES \ - ++goversion $GOSTD_VERSION \ - ++source-root $ARCADIA_ROOT \ - ++build-root $ARCADIA_BUILD_ROOT \ - ++output-root $BINDIR \ - ++toolchain-root $GO_TOOLS_ROOT \ - $GO_HOST_TARG_PARAMS \ - ++output $TARGET \ - $GO_VET_OUTPUT \ - $_GO_YDX_FILE \ - $_GO_DEBUG_PATH__NO_UID__ \ - ++srcs $AUTO_INPUT ${input:GO_FILES} \ - ++asm-flags $GO_ASM_FLAGS_VALUE \ - ++compile-flags $GO_COMPILE_FLAGS_VALUE \ - ++link-flags $GO_LINK_FLAGS_VALUE \ - ++cgo-srcs ${input:CGO_FILES} \ - $_GO_EMBED_VALUE \ +_GO_TOOL_COMMON_FLAGS=\ + ++mode $_GO_TOOL_MODE \ + $GO_PROJECT_PREFIXES \ + ++goversion $GOSTD_VERSION \ + ++source-root $ARCADIA_ROOT \ + ++build-root $ARCADIA_BUILD_ROOT \ + ++output-root $BINDIR \ + ++toolchain-root $GO_TOOLS_ROOT \ + $GO_HOST_TARG_PARAMS \ + ++output $TARGET \ + $GO_VET_OUTPUT \ + $_GO_YDX_FILE \ + $_GO_DEBUG_PATH__NO_UID__ \ + ++srcs $AUTO_INPUT ${input:GO_FILES} \ + ++asm-flags $GO_ASM_FLAGS_VALUE \ + ++compile-flags $GO_COMPILE_FLAGS_VALUE \ + ++link-flags $GO_LINK_FLAGS_VALUE \ + ++cgo-srcs ${input:CGO_FILES} \ + $_GO_EMBED_VALUE \ $GO_TOOLCHAIN_ENV - + # tag:go-specific -macro _GO_GEN_COVER_GO(GO_FILE, VAR_ID) { - .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cover -mode set -var $VAR_ID -o ${output;noext;suf=.cover.go:GO_FILE} ${input:GO_FILE} -} - +macro _GO_GEN_COVER_GO(GO_FILE, VAR_ID) { + .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cover -mode set -var $VAR_ID -o ${output;noext;suf=.cover.go:GO_FILE} ${input:GO_FILE} +} + # tag:go-specific -macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { - .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/asm $_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__ ${pre=-I :_C__INCLUDE} -I $GO_TOOLS_ROOT/pkg/include -D GOOS_${GO_TARG_OS} -D GOARCH_${GO_TARG_ARCH} $FLAGS $GO_ASM_FLAGS_VALUE -gensymabis -o ${output:"gen.symabis"} ${input:ASM_FILES} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - .ADDINCL=build/scripts/go_fake_include -} - +macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { + .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/asm $_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__ ${pre=-I :_C__INCLUDE} -I $GO_TOOLS_ROOT/pkg/include -D GOOS_${GO_TARG_OS} -D GOARCH_${GO_TARG_ARCH} $FLAGS $GO_ASM_FLAGS_VALUE -gensymabis -o ${output:"gen.symabis"} ${input:ASM_FILES} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} + .ADDINCL=build/scripts/go_fake_include +} + # tag:go-specific macro _GO_COMPILE_CGO1(NAME, FLAGS[], FILES...) { - .CMD=${hide:_GO_FAKEID} ${cwd:ARCADIA_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cgo1_wrapper.py"} $_GO_CGO1_WRAPPER_FLAGS --build-root ${ARCADIA_BUILD_ROOT} --source-root ${ARCADIA_ROOT} --cgo1-files ${output;noext:FILES.cgo1.go} --cgo2-files ${output;noauto;noext:FILES.cgo2.c} -- ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -objdir $BINDIR -importpath $NAME $GO_CGO1_FLAGS_VALUE $FLAGS -- $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} ${CGO_CFLAGS_VALUE} ${input:FILES} ${output;hide:"_cgo_export.h"} ${output;hide:"_cgo_export.c"} ${output;hide:"_cgo_gotypes.go"} ${output;noauto;hide:"_cgo_main.c"} ${output;noauto;hide:"_cgo_flags"} $GO_TOOLCHAIN_ENV ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} -} - + .CMD=${hide:_GO_FAKEID} ${cwd:ARCADIA_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cgo1_wrapper.py"} $_GO_CGO1_WRAPPER_FLAGS --build-root ${ARCADIA_BUILD_ROOT} --source-root ${ARCADIA_ROOT} --cgo1-files ${output;noext:FILES.cgo1.go} --cgo2-files ${output;noauto;noext:FILES.cgo2.c} -- ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -objdir $BINDIR -importpath $NAME $GO_CGO1_FLAGS_VALUE $FLAGS -- $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} ${CGO_CFLAGS_VALUE} ${input:FILES} ${output;hide:"_cgo_export.h"} ${output;hide:"_cgo_export.c"} ${output;hide:"_cgo_gotypes.go"} ${output;noauto;hide:"_cgo_main.c"} ${output;noauto;hide:"_cgo_flags"} $GO_TOOLCHAIN_ENV ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} +} + # tag:go-specific -macro _GO_COMPILE_CGO2(NAME, C_FILES[], S_FILES[], OBJ_FILES[], FILES...) { +macro _GO_COMPILE_CGO2(NAME, C_FILES[], S_FILES[], OBJ_FILES[], FILES...) { .CMD=${hide:_GO_FAKEID} $C_COMPILER $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} $CGO_CFLAGS_VALUE ${input;tobindir:"_cgo_main.c"} -c -o ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_main.c"} && $C_COMPILER $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} -o ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_"} $LDFLAGS $LDFLAGS_GLOBAL $CGO2_LDFLAGS_VALUE ${input;hide:"_cgo_export.h"} ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_main.c"} ${input;suf=${OBJECT_SUF}:"_cgo_export.c"} ${input;nopath;noext;suf=.cgo2.c${OBJECT_SUF}:FILES} ${input;suf=${OBJECT_SUF}:C_FILES} ${input;suf=.o:S_FILES} ${input:OBJ_FILES} $CGO_LDFLAGS_VALUE && ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -dynpackage $NAME -dynimport ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_"} -dynout ${output:"_cgo_import.go"} -dynlinker $GO_CGO2_FLAGS_VALUE $GO_TOOLCHAIN_ENV ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} _USE_LINKER() -} - +} + # tag:go-specific -macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { +macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} --ya-end-command-file ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p GO"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} -} - +} + # tag:go-specific -macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { +macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} --ya-end-command-file ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"p LD"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} $_GO_LINK_EXE_EXT_CMD -} - +} + # tag:go-specific -macro _GO_LINK_TEST_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_TEST_FILES[], GO_XTEST_FILES[], GO_FILES...) { +macro _GO_LINK_TEST_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_TEST_FILES[], GO_XTEST_FILES[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++test-miner $GO_TEST_MINER ++test-import-path $GO_TEST_IMPORT_PATH ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} ++test_srcs ${input:GO_TEST_FILES} ++xtest_srcs ${input:GO_XTEST_FILES} ++cover_info $GO_COVER_INFO_VALUE ++skip-tests $_GO_SKIP_TEST_VALUE --ya-end-command-file ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"p GO"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} -} - +} + # tag:go-specific -GO_LINK_LIB=$GENERATE_MF && $_GO_LINK_LIB_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) -GO_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_EXE_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) -GO_LINK_TEST=$GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_TEST_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS GO_TEST_FILES $_GO_TEST_SRCS_VALUE GO_XTEST_FILES $_GO_XTEST_SRCS_VALUE) -GO_LINK_DLL=$GO_LINK_EXE && $COPY_CMD $BINDIR/_cgo_export.h ${output;pre=${MODULE_PREFIX};suf=.h:REALPRJNAME} - +GO_LINK_LIB=$GENERATE_MF && $_GO_LINK_LIB_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) +GO_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_EXE_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) +GO_LINK_TEST=$GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_TEST_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS GO_TEST_FILES $_GO_TEST_SRCS_VALUE GO_XTEST_FILES $_GO_XTEST_SRCS_VALUE) +GO_LINK_DLL=$GO_LINK_EXE && $COPY_CMD $BINDIR/_cgo_export.h ${output;pre=${MODULE_PREFIX};suf=.h:REALPRJNAME} + # tag:go-specific CGO_ENABLED=yes -when ($OS_WINDOWS == "yes" || $SANITIZER_TYPE && $SANITIZER_TYPE != "no") { +when ($OS_WINDOWS == "yes" || $SANITIZER_TYPE && $SANITIZER_TYPE != "no") { CGO_ENABLED=no } # tag:go-specific -GO_PACKAGE_VALUE= +GO_PACKAGE_VALUE= ### @usage: GO_PACKAGE_NAME(Name) ### Override name of a Go package. -macro GO_PACKAGE_NAME(NAME) { - SET(GO_PACKAGE_VALUE $NAME) -} - +macro GO_PACKAGE_NAME(NAME) { + SET(GO_PACKAGE_VALUE $NAME) +} + # tag:go-specific tag:internal -_GO_SRCS_VALUE= -### @usage: _GO_SRCS(Files...) # internal +_GO_SRCS_VALUE= +### @usage: _GO_SRCS(Files...) # internal ### This macro shouldn't be used in ya.make files, use SRCS() instead. ### This is internal macro collecting .go sources for processing within Go modules (GO_PROGRAM and GO_LIBRARY) -macro _GO_SRCS(FILES...) { +macro _GO_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_SRCS_VALUE $FILES) +} + # tag:go-specific -_GO_TEST_SRCS_VALUE= +_GO_TEST_SRCS_VALUE= ### @usage: GO_TEST_SRCS(Files...) ### .go sources for internal tests of a module -macro GO_TEST_SRCS(FILES...) { +macro GO_TEST_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_TEST_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_TEST_SRCS_VALUE $FILES) +} + # tag:go-specific -_GO_XTEST_SRCS_VALUE= +_GO_XTEST_SRCS_VALUE= ### @usage: GO_XTEST_SRCS(Files...) ### .go sources for external tests of a module -macro GO_XTEST_SRCS(FILES...) { +macro GO_XTEST_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_XTEST_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_XTEST_SRCS_VALUE $FILES) +} + # tag:go-specific macro _GO_UNUSED_SRCS(FLAGS...) { - ENABLE(UNUSED_MACRO) -} - + ENABLE(UNUSED_MACRO) +} + # tag:go-specific -_CGO_SRCS_VALUE= +_CGO_SRCS_VALUE= ### @usage: CGO_SRCS(Files...) ### .go sources to be built with CGO -macro CGO_SRCS(FILES...) { - SET_APPEND(_CGO_SRCS_VALUE $FILES) - PEERDIR(${GOSTD}/syscall) -} - +macro CGO_SRCS(FILES...) { + SET_APPEND(_CGO_SRCS_VALUE $FILES) + PEERDIR(${GOSTD}/syscall) +} + # tag:go-specific -GO_LDFLAGS_GLOBAL= +GO_LDFLAGS_GLOBAL= ### @usage: GO_LDFLAGS(Flags...) ### Link flags for GO_PROGRAM linking from .go sources -macro GO_LDFLAGS(FLAGS...) { - SET_APPEND(GO_LDFLAGS_GLOBAL $FLAGS) -} - +macro GO_LDFLAGS(FLAGS...) { + SET_APPEND(GO_LDFLAGS_GLOBAL $FLAGS) +} + # tag:go-specific -CGO_CFLAGS_VALUE= +CGO_CFLAGS_VALUE= ### @usage: CGO_CFLAGS(Flags...) ### Compiler flags specific to CGO compilation -macro CGO_CFLAGS(FLAGS...) { - SET_APPEND(CGO_CFLAGS_VALUE $FLAGS) - CFLAGS($FLAGS) -} - +macro CGO_CFLAGS(FLAGS...) { + SET_APPEND(CGO_CFLAGS_VALUE $FLAGS) + CFLAGS($FLAGS) +} + # tag:go-specific -CGO_LDFLAGS_VALUE= +CGO_LDFLAGS_VALUE= ### @usage: CGO_LDFLAGS(Files...) ### Linker flags specific to CGO linking -macro CGO_LDFLAGS(FLAGS...) { - SET_APPEND(CGO_LDFLAGS_VALUE $FLAGS) - GO_LDFLAGS($FLAGS) -} - +macro CGO_LDFLAGS(FLAGS...) { + SET_APPEND(CGO_LDFLAGS_VALUE $FLAGS) + GO_LDFLAGS($FLAGS) +} + # tag:go-specific -_GO_SKIP_TEST_VALUE= -### @usage: GO_SKIP_TESTS(TestNames...) -### -### Define a set of tests that should not be run. -### NB! Subtests are not taken into account! -macro GO_SKIP_TESTS(TESTS...) { - SET_APPEND(_GO_SKIP_TEST_VALUE $TESTS) - RESTRICT_PATH(vendor MSG This macro is prohibited to be used outside the vendor/ directory) -} - +_GO_SKIP_TEST_VALUE= +### @usage: GO_SKIP_TESTS(TestNames...) +### +### Define a set of tests that should not be run. +### NB! Subtests are not taken into account! +macro GO_SKIP_TESTS(TESTS...) { + SET_APPEND(_GO_SKIP_TEST_VALUE $TESTS) + RESTRICT_PATH(vendor MSG This macro is prohibited to be used outside the vendor/ directory) +} + # tag:go-specific tag:internal -_GO_EMBED_VALUE= -_GO_EMBED_INPUTS= -### @usage: _GO_EMBED_PATTERN(PATTERN) # internal -### -### Define an embed pattern. -macro _GO_EMBED_PATTERN(XTEST?"_xtest":"", PATTERN, IMPORT_PATH) { - SET(VAR_SALT1 $XTEST $PATTERN $IMPORT_PATH 1) - SET(_PATTERN_GLOB1 uniq_embed_${hash:VAR_SALT1}) - _GLOB($_PATTERN_GLOB1 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/.*) - SET(VAR_SALT2 $XTEST $PATTERN $IMPORT_PATH 2) - SET(_PATTERN_GLOB2 _uniq_embed_${hash:VAR_SALT2}) - _GLOB($_PATTERN_GLOB2 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}) - SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $PATTERN \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) - SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) -} - +_GO_EMBED_VALUE= +_GO_EMBED_INPUTS= +### @usage: _GO_EMBED_PATTERN(PATTERN) # internal +### +### Define an embed pattern. +macro _GO_EMBED_PATTERN(XTEST?"_xtest":"", PATTERN, IMPORT_PATH) { + SET(VAR_SALT1 $XTEST $PATTERN $IMPORT_PATH 1) + SET(_PATTERN_GLOB1 uniq_embed_${hash:VAR_SALT1}) + _GLOB($_PATTERN_GLOB1 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/.*) + SET(VAR_SALT2 $XTEST $PATTERN $IMPORT_PATH 2) + SET(_PATTERN_GLOB2 _uniq_embed_${hash:VAR_SALT2}) + _GLOB($_PATTERN_GLOB2 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}) + SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $PATTERN \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) + SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) +} + # tag:go-specific -### @usage: GO_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern. -macro GO_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern. +macro GO_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_TEST_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern for internal go tests. -macro GO_TEST_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_TEST_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern for internal go tests. +macro GO_TEST_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_XTEST_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern for external go tests. -macro GO_XTEST_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN(XTEST $PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_XTEST_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern for external go tests. +macro GO_XTEST_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN(XTEST $PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific tag:internal -### @usage: _GO_EMBED_DIR(PATTERN) # internal -### -### Define an embed directory DIR. -macro _GO_EMBED_DIR(XTEST?"_xtest":"", DIR, IMPORT_PATH) { +### @usage: _GO_EMBED_DIR(PATTERN) # internal +### +### Define an embed directory DIR. +macro _GO_EMBED_DIR(XTEST?"_xtest":"", DIR, IMPORT_PATH) { SET(VAR_SALT $XTEST $DIR $IMPORT_PATH) SET(_PATTERN_GLOB uniq_embed_${hash:VAR_SALT}) - _GLOB($_PATTERN_GLOB ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/.*) - SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $DIR \$$_PATTERN_GLOB) - SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB) -} - + _GLOB($_PATTERN_GLOB ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/.*) + SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $DIR \$$_PATTERN_GLOB) + SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB) +} + # tag:go-specific -### @usage: GO_EMBED_DIR(DIR) -### -### Define an embed directory DIR. -macro GO_EMBED_DIR(DIR) { - _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_EMBED_DIR(DIR) +### +### Define an embed directory DIR. +macro GO_EMBED_DIR(DIR) { + _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_TEST_EMBED_DIR(DIR) -### -### Define an embed directory DIR for internal go tests. -macro GO_EMBED_TEST_DIR(DIR) { - _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_TEST_EMBED_DIR(DIR) +### +### Define an embed directory DIR for internal go tests. +macro GO_EMBED_TEST_DIR(DIR) { + _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_XTEST_EMBED_DIR(DIR) -### -### Define an embed directory DIR for external go tests. -macro GO_EMBED_XTEST_DIR(DIR) { - _GO_EMBED_DIR(XTEST $DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_XTEST_EMBED_DIR(DIR) +### +### Define an embed directory DIR for external go tests. +macro GO_EMBED_XTEST_DIR(DIR) { + _GO_EMBED_DIR(XTEST $DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -_GO_TOOLCHAIN_ENV_GOARCH=unknown -when ($ARCH_ARM64) { - _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=arm64"} -} -elsewhen ($ARCH_X86_64) { - _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=amd64"} -} - +_GO_TOOLCHAIN_ENV_GOARCH=unknown +when ($ARCH_ARM64) { + _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=arm64"} +} +elsewhen ($ARCH_X86_64) { + _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=amd64"} +} + # tag:go-specific -_GO_TOOLCHAIN_ENV_GOOS=unknown -when ($OS_DARWIN) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=darwin"} -} -elsewhen ($OS_LINUX) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=linux"} -} -elsewhen ($OS_WINDOWS) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=windows"} -} -_GO_TOOLCHAIN_ENV_PATH= - +_GO_TOOLCHAIN_ENV_GOOS=unknown +when ($OS_DARWIN) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=darwin"} +} +elsewhen ($OS_LINUX) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=linux"} +} +elsewhen ($OS_WINDOWS) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=windows"} +} +_GO_TOOLCHAIN_ENV_PATH= + # tag:go-specific -GO_TOOLCHAIN_ENV=$TOOLCHAIN_ENV $_GO_TOOLCHAIN_ENV_GOARCH $_GO_TOOLCHAIN_ENV_GOOS $_GO_TOOLCHAIN_ENV_PATH - +GO_TOOLCHAIN_ENV=$TOOLCHAIN_ENV $_GO_TOOLCHAIN_ENV_GOARCH $_GO_TOOLCHAIN_ENV_GOOS $_GO_TOOLCHAIN_ENV_PATH + # tag:go-specific -_GO_GRPC_WELLKNOWN=\ - vendor/google.golang.org/grpc \ - vendor/google.golang.org/grpc \ - vendor/google.golang.org/grpc/codes \ - vendor/google.golang.org/grpc/grpclog \ - vendor/google.golang.org/grpc/status - +_GO_GRPC_WELLKNOWN=\ + vendor/google.golang.org/grpc \ + vendor/google.golang.org/grpc \ + vendor/google.golang.org/grpc/codes \ + vendor/google.golang.org/grpc/grpclog \ + vendor/google.golang.org/grpc/status + # tag:go-specific macro _GO_GRPC() { - SET(GO_PROTO_GEN_PLUGINS grpc) - PEERDIR(${GOSTD}/context ${_GO_GRPC_WELLKNOWN}) -} - + SET(GO_PROTO_GEN_PLUGINS grpc) + PEERDIR(${GOSTD}/context ${_GO_GRPC_WELLKNOWN}) +} + # tag:go-specific ### @usage: GO_GRPC_GATEWAY_SRCS() -### -### Use of grpc-gateway plugin (Supported for Go only). -macro GO_GRPC_GATEWAY_SRCS(FILE...) { - ENABLE(UNUSED_MACRO) -} - +### +### Use of grpc-gateway plugin (Supported for Go only). +macro GO_GRPC_GATEWAY_SRCS(FILE...) { + ENABLE(UNUSED_MACRO) +} + # tag:go-specific ### @usage: GO_GRPC_GATEWAY_SWAGGER_SRCS() ### @@ -8315,22 +8315,22 @@ macro GO_GRPC_GATEWAY_SWAGGER_SRCS(FILE...) { } # tag:go-specific -_GO_PROTO_GRPC_GATEWAY_OPTS= -_GO_PROTO_GRPC_GATEWAY_OUTS= - +_GO_PROTO_GRPC_GATEWAY_OPTS= +_GO_PROTO_GRPC_GATEWAY_OUTS= + # tag:go-specific macro _GO_GRPC_GATEWAY_SRCS_IMPL(Files...) { - foreach (File : $Files) { + foreach (File : $Files) { [.proto]=$_GO_PROTO_CMD_IMPL($File OPTS $_GO_PROTO_GRPC_GATEWAY_OPTS OUTS $_GO_PROTO_GRPC_GATEWAY_OUTS) - } - - PEERDIR(${GOSTD}/context ${GOSTD}/io ${GOSTD}/net/http) + } + + PEERDIR(${GOSTD}/context ${GOSTD}/io ${GOSTD}/net/http) PEERDIR(vendor/github.com/golang/protobuf/descriptor) - PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/runtime) - PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/utilities) + PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/runtime) + PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/utilities) PEERDIR(vendor/google.golang.org/grpc/metadata) -} - +} + # tag:go-specific macro _SETUP_GO_GRPC_GATEWAY() { SET(_GO_PROTO_GRPC_GATEWAY_OPTS $_PROTO_PLUGIN_ARGS_BASE(go_grpc_gw vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway allow_repeated_fields_in_body=true:)) @@ -8354,175 +8354,175 @@ macro _GO_GRPC_GATEWAY_SWAGGER_SRCS(Files...) { } # tag:go-specific -when ($MUSL == "yes") { - _GO_DEFAULT_ALLOCATOR=$DEFAULT_ALLOCATOR -} -otherwise { - _GO_DEFAULT_ALLOCATOR=FAKE -} +when ($MUSL == "yes") { + _GO_DEFAULT_ALLOCATOR=$DEFAULT_ALLOCATOR +} +otherwise { + _GO_DEFAULT_ALLOCATOR=FAKE +} # tag:go-specific tag:internal ### @usage _GO_BASE_UNIT # internal ### ### The base module of all golang modules. Defines common properties, dependencies and rules for go build. module _GO_BASE_UNIT: _BASE_UNIT { - .EXTS=.go .gosrc .o .obj .a .symabis .mf - .CMD=TOUCH_UNIT - .NODE_TYPE=Bundle - .GLOBAL=GO_LDFLAGS - .PEERDIR_POLICY=as_build_from - .ALIASES=SRCS=_GO_SRCS RESOURCE=_GO_RESOURCE GO_TEST_SRCS=_GO_UNUSED_SRCS GO_XTEST_SRCS=_GO_UNUSED_SRCS GRPC=_GO_GRPC GO_GRPC_GATEWAY_SRCS=_GO_GRPC_GATEWAY_SRCS GO_GRPC_GATEWAY_SWAGGER_SRCS=_GO_GRPC_GATEWAY_SWAGGER_SRCS CFLAGS=CGO_CFLAGS GO_TEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_XTEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_TEST_EMBED_DIR=_GO_UNUSED_SRCS GO_XTEST_EMBED_DIR=_GO_UNUSED_SRCS + .EXTS=.go .gosrc .o .obj .a .symabis .mf + .CMD=TOUCH_UNIT + .NODE_TYPE=Bundle + .GLOBAL=GO_LDFLAGS + .PEERDIR_POLICY=as_build_from + .ALIASES=SRCS=_GO_SRCS RESOURCE=_GO_RESOURCE GO_TEST_SRCS=_GO_UNUSED_SRCS GO_XTEST_SRCS=_GO_UNUSED_SRCS GRPC=_GO_GRPC GO_GRPC_GATEWAY_SRCS=_GO_GRPC_GATEWAY_SRCS GO_GRPC_GATEWAY_SWAGGER_SRCS=_GO_GRPC_GATEWAY_SWAGGER_SRCS CFLAGS=CGO_CFLAGS GO_TEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_XTEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_TEST_EMBED_DIR=_GO_UNUSED_SRCS GO_XTEST_EMBED_DIR=_GO_UNUSED_SRCS .ALLOWED=GO_PROTO_PLUGIN USE_CXX USE_UTIL RESOURCE_FILES .IGNORED=GO_SKIP_TESTS USE_SKIFF - - ENABLE(_GO_MODULE) - SET(MODULE_TAG GO) - PEERDIR_TAGS=GO GO_PROTO GO_FBS __EMPTY__ - DEFAULT(_GO_VET_TOOL) - DEFAULT(_GO_VET_FLAGS) - DEFAULT(_GO_VET_EXTS) - DEFAULT(_GO_SONAME) - - NO_RUNTIME() - - SET(COVERAGE_FLAGS) - SET(EXTRA_OUTPUT) + + ENABLE(_GO_MODULE) + SET(MODULE_TAG GO) + PEERDIR_TAGS=GO GO_PROTO GO_FBS __EMPTY__ + DEFAULT(_GO_VET_TOOL) + DEFAULT(_GO_VET_FLAGS) + DEFAULT(_GO_VET_EXTS) + DEFAULT(_GO_SONAME) + + NO_RUNTIME() + + SET(COVERAGE_FLAGS) + SET(EXTRA_OUTPUT) SET(MODULE_LANG GO) - - PEERDIR(build/external_resources/go_tools) - - GO_PROTO_OUTS+=${output;hide;norel;nopath;noext;suf=.pb.go:File} - - when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { - PEERDIR+=$COMPILER_PLATFORM - } - - when ($CLANG == "yes" || $GCC == "yes") { - CGO_CFLAGS_VALUE += -w -pthread -fpic - CGO2_CFLAGS_VALUE += -Wno-unused-variable - } - - select ($GO_VET) { - "yes" | "on" ? { - _GO_VET=yes - _GO_VET_FLAGS+=-cgocall=false - } - "yndexer" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/goyndexer - _GO_VET_TOOL=${GOYNDEXER_RESOURCE_GLOBAL}/goyndexer - _GO_YDX_FILE=++ydx-file ${_GO_YNDEXER_EXT} - _GO_VET_FLAGS=-indexer.arc ${ARCADIA_ROOT} -indexer.indexfile ${GO_YNDEXER_OUTPUT} -indexer.loglevel info - _GO_FMT_ADD_CHECK=no - _GO_VET_ADD_CHECK=no - GO_VET_INFO_EXT=.ydx.out - GO_VET_REPORT_EXT=.ydx.txt - _GO_VET_EXTS=++vet-info-ext .ydx.out ++vet-report-ext .ydx.txt - _GO_CGO1_WRAPPER_FLAGS=--build-prefix=__ARCADIA_BUILD_ROOT_PREFIX__ --source-prefix=__ARCADIA_SOURCE_ROOT_PREFIX__ - } - "yolint" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/yolint - _GO_VET_TOOL=${YOLINT_RESOURCE_GLOBAL}/yolint + + PEERDIR(build/external_resources/go_tools) + + GO_PROTO_OUTS+=${output;hide;norel;nopath;noext;suf=.pb.go:File} + + when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { + PEERDIR+=$COMPILER_PLATFORM + } + + when ($CLANG == "yes" || $GCC == "yes") { + CGO_CFLAGS_VALUE += -w -pthread -fpic + CGO2_CFLAGS_VALUE += -Wno-unused-variable + } + + select ($GO_VET) { + "yes" | "on" ? { + _GO_VET=yes + _GO_VET_FLAGS+=-cgocall=false + } + "yndexer" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/goyndexer + _GO_VET_TOOL=${GOYNDEXER_RESOURCE_GLOBAL}/goyndexer + _GO_YDX_FILE=++ydx-file ${_GO_YNDEXER_EXT} + _GO_VET_FLAGS=-indexer.arc ${ARCADIA_ROOT} -indexer.indexfile ${GO_YNDEXER_OUTPUT} -indexer.loglevel info + _GO_FMT_ADD_CHECK=no + _GO_VET_ADD_CHECK=no + GO_VET_INFO_EXT=.ydx.out + GO_VET_REPORT_EXT=.ydx.txt + _GO_VET_EXTS=++vet-info-ext .ydx.out ++vet-report-ext .ydx.txt + _GO_CGO1_WRAPPER_FLAGS=--build-prefix=__ARCADIA_BUILD_ROOT_PREFIX__ --source-prefix=__ARCADIA_SOURCE_ROOT_PREFIX__ + } + "yolint" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/yolint + _GO_VET_TOOL=${YOLINT_RESOURCE_GLOBAL}/yolint _GO_VET_FLAGS=-migration.config=${input:"${ARCADIA_ROOT}/build/rules/go/migrations.yaml"} -importcheck=false -SA1019=false -copyproto=false -bodyclose=false -rowserrcheck=false -ytcheck=false - } - "yolint_next" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/yolint - _GO_VET_TOOL=${YOLINT_NEXT_RESOURCE_GLOBAL}/yolint + } + "yolint_next" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/yolint + _GO_VET_TOOL=${YOLINT_NEXT_RESOURCE_GLOBAL}/yolint _GO_VET_FLAGS=-copyproto=false - } + } "local" ? { _GO_VET=yes _GO_VET_FLAGS= } - default ? { - _GO_VET=no - _GO_VET_FLAGS= - } - } - SET(_GO_VET $_GO_VET) - - when ($GO_VET_TOOL == "") { - _GO_VET_TOOL_REAL=$_GO_VET_TOOL - } - otherwise { - _GO_VET_TOOL_REAL=$GO_VET_TOOL - } - - when ($GO_VET_FLAGS == "") { - _GO_VET_FLAGS_REAL=$_GO_VET_FLAGS - } - otherwise { - _GO_VET_FLAGS_REAL=$GO_VET_FLAGS - } - - when ($_GO_VET == "yes" && $NO_GO_VET != "yes") { - GO_VET_OUTPUT=++vet $_GO_VET_TOOL_REAL ++vet-flags $_GO_VET_FLAGS_REAL $GO_VET_EXTRA_FLAGS $GO_VET_OUTPUT_INFO $GO_VET_OUTPUT_REPORT $_GO_VET_EXTS - } - otherwise { - GO_VET_OUTPUT= - _GO_VET_ADD_CHECK=no - } - - when ($GO_DEBUG_PATH_RELATIVE == "yes") { - _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=;build=;tools= ++tools-root $(TOOL_ROOT) - _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>;$ARCADIA_BUILD_ROOT=>;$(TOOL_ROOT)=> - } - otherwise { - _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=/-S;build=/-B;tools=/-T ++tools-root $(TOOL_ROOT) - _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>/-S;$ARCADIA_BUILD_ROOT=>/-B;$(TOOL_ROOT)=>/-T - } - - _GO_PROCESS_SRCS() - - when ($CLANG == "yes") { - _GO_EXTLD=clang - GO_TOOLCHAIN_ENV += ${env:"CC=clang"} - } - otherwise { - _GO_EXTLD=gcc - GO_TOOLCHAIN_ENV += ${env:"CC=gcc"} - } - - when ($OS_DARWIN) { - PEERDIR+=build/external_resources/go_fake_xcrun + default ? { + _GO_VET=no + _GO_VET_FLAGS= + } + } + SET(_GO_VET $_GO_VET) + + when ($GO_VET_TOOL == "") { + _GO_VET_TOOL_REAL=$_GO_VET_TOOL + } + otherwise { + _GO_VET_TOOL_REAL=$GO_VET_TOOL + } + + when ($GO_VET_FLAGS == "") { + _GO_VET_FLAGS_REAL=$_GO_VET_FLAGS + } + otherwise { + _GO_VET_FLAGS_REAL=$GO_VET_FLAGS + } + + when ($_GO_VET == "yes" && $NO_GO_VET != "yes") { + GO_VET_OUTPUT=++vet $_GO_VET_TOOL_REAL ++vet-flags $_GO_VET_FLAGS_REAL $GO_VET_EXTRA_FLAGS $GO_VET_OUTPUT_INFO $GO_VET_OUTPUT_REPORT $_GO_VET_EXTS + } + otherwise { + GO_VET_OUTPUT= + _GO_VET_ADD_CHECK=no + } + + when ($GO_DEBUG_PATH_RELATIVE == "yes") { + _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=;build=;tools= ++tools-root $(TOOL_ROOT) + _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>;$ARCADIA_BUILD_ROOT=>;$(TOOL_ROOT)=> + } + otherwise { + _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=/-S;build=/-B;tools=/-T ++tools-root $(TOOL_ROOT) + _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>/-S;$ARCADIA_BUILD_ROOT=>/-B;$(TOOL_ROOT)=>/-T + } + + _GO_PROCESS_SRCS() + + when ($CLANG == "yes") { + _GO_EXTLD=clang + GO_TOOLCHAIN_ENV += ${env:"CC=clang"} + } + otherwise { + _GO_EXTLD=gcc + GO_TOOLCHAIN_ENV += ${env:"CC=gcc"} + } + + when ($OS_DARWIN) { + PEERDIR+=build/external_resources/go_fake_xcrun GO_EXTLD = ++extld $_GO_EXTLD ++extldflags $_GO_SONAME $LD_SDK_VERSION -undefined dynamic_lookup $C_FLAGS_PLATFORM --sysroot=$MACOS_SDK_RESOURCE_GLOBAL --start-wa ${rootrel;ext=.a:SRCS_GLOBAL} --end-wa ${rootrel;ext=.o:SRCS_GLOBAL} --cgo-peers $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG - CGO2_LDFLAGS_VALUE += $LD_SDK_VERSION -undefined dynamic_lookup -nodefaultlibs -lc - } - elsewhen ($OS_LINUX) { + CGO2_LDFLAGS_VALUE += $LD_SDK_VERSION -undefined dynamic_lookup -nodefaultlibs -lc + } + elsewhen ($OS_LINUX) { GO_EXTLD = ++extld $_GO_EXTLD ++extldflags $_GO_SONAME $C_FLAGS_PLATFORM --sysroot=$OS_SDK_ROOT_RESOURCE_GLOBAL -Wl,--whole-archive ${rootrel;ext=.a:SRCS_GLOBAL} -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} --cgo-peers $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG - CGO2_LDFLAGS_VALUE += -Wl,--unresolved-symbols=ignore-all -nodefaultlibs -lc - } - otherwise { - GO_EXTLD = ++extld $_GO_EXTLD - } - - when ($RACE == "yes") { - _GO_COMPILE_FLAGS_RACE=-race - _GO_LINK_FLAGS_RACE=-race - } - otherwise { - _GO_COMPILE_FLAGS_RACE= - _GO_LINK_FLAGS_RACE= - } - - when ($PIC == "yes") { - _GO_COMPILE_FLAGS_SHARED=-shared - _GO_ASM_FLAGS_SHARED=-shared - } - otherwise { - _GO_COMPILE_FLAGS_SHARED= - _GO_ASM_FLAGS_SHARED= - } - - GO_ASM_FLAGS_VALUE += $_GO_ASM_FLAGS_SHARED - GO_COMPILE_FLAGS_VALUE += $_GO_COMPILE_FLAGS_RACE $_GO_COMPILE_FLAGS_SHARED - GO_LINK_FLAGS_VALUE += $_GO_LINK_FLAGS_RACE - - ADDINCL(${GOSTD}/runtime) -} - + CGO2_LDFLAGS_VALUE += -Wl,--unresolved-symbols=ignore-all -nodefaultlibs -lc + } + otherwise { + GO_EXTLD = ++extld $_GO_EXTLD + } + + when ($RACE == "yes") { + _GO_COMPILE_FLAGS_RACE=-race + _GO_LINK_FLAGS_RACE=-race + } + otherwise { + _GO_COMPILE_FLAGS_RACE= + _GO_LINK_FLAGS_RACE= + } + + when ($PIC == "yes") { + _GO_COMPILE_FLAGS_SHARED=-shared + _GO_ASM_FLAGS_SHARED=-shared + } + otherwise { + _GO_COMPILE_FLAGS_SHARED= + _GO_ASM_FLAGS_SHARED= + } + + GO_ASM_FLAGS_VALUE += $_GO_ASM_FLAGS_SHARED + GO_COMPILE_FLAGS_VALUE += $_GO_COMPILE_FLAGS_RACE $_GO_COMPILE_FLAGS_SHARED + GO_LINK_FLAGS_VALUE += $_GO_LINK_FLAGS_RACE + + ADDINCL(${GOSTD}/runtime) +} + # tag:go-specific ### @usage: GO_LIBRARY([name]) ### @@ -8530,17 +8530,17 @@ module _GO_BASE_UNIT: _BASE_UNIT { ### Compile Go module as a library suitable for PEERDIR from other Go modules. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. module GO_LIBRARY: _GO_BASE_UNIT { - .CMD=GO_LINK_LIB - .NODE_TYPE=Bundle + .CMD=GO_LINK_LIB + .NODE_TYPE=Bundle .FINAL_TARGET=no .ALIASES=GO_REQUIREMENTS=LIB_REQUIREMENTS - SET(_GO_TOOL_MODE lib) - SET(MODULE_TYPE LIBRARY) + SET(_GO_TOOL_MODE lib) + SET(MODULE_TYPE LIBRARY) _REQUIRE_EXPLICIT_LICENSE(vendor) - - MODULE_SUFFIX=.a -} - + + MODULE_SUFFIX=.a +} + # tag:go-specific ### @usage: GO_PROGRAM([name]) ### @@ -8548,87 +8548,87 @@ module GO_LIBRARY: _GO_BASE_UNIT { ### Compile and link Go module to an executable program. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. module GO_PROGRAM: _GO_BASE_UNIT { - .CMD=GO_LINK_EXE - .NODE_TYPE=Bundle - .SYMLINK_POLICY=EXE + .CMD=GO_LINK_EXE + .NODE_TYPE=Bundle + .SYMLINK_POLICY=EXE .ALLOWED=INDUCED_DEPS .FINAL_TARGET=yes .ALIASES=GO_REQUIREMENTS=LD_REQUIREMENTS - SET(_GO_TOOL_MODE exe) - SET(MODULE_TYPE PROGRAM) - SET(GO_VET_OUTPUT_INFO) - - ALLOCATOR($_GO_DEFAULT_ALLOCATOR) - + SET(_GO_TOOL_MODE exe) + SET(MODULE_TYPE PROGRAM) + SET(GO_VET_OUTPUT_INFO) + + ALLOCATOR($_GO_DEFAULT_ALLOCATOR) + _USE_LINKER() - - ENABLE(COMMON_LINK_SETTINGS) - - when ($MUSL == "yes") { + + ENABLE(COMMON_LINK_SETTINGS) + + when ($MUSL == "yes") { PEERDIR += contrib/libs/musl/full - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } - - PEERDIR(${GOSTD}/runtime library/go/core/buildinfo) - - when ($RACE == "yes") { - PEERDIR += ${GOSTD}/runtime/cgo - PEERDIR += ${GOSTD}/runtime/race - } - - when ($MUSL == "yes") { - GO_WITH_MUSL = ++musl - } -} - + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } + + PEERDIR(${GOSTD}/runtime library/go/core/buildinfo) + + when ($RACE == "yes") { + PEERDIR += ${GOSTD}/runtime/cgo + PEERDIR += ${GOSTD}/runtime/race + } + + when ($MUSL == "yes") { + GO_WITH_MUSL = ++musl + } +} + # tag:go-specific -module _GO_DLL_BASE_UNIT: GO_PROGRAM { - .CMD=GO_LINK_DLL - .SYMLINK_POLICY=SO - .ALLOWED=WHOLE_ARCHIVE - SET(_GO_TOOL_MODE dll) - SET(MODULE_TYPE DLL) - - GO_PACKAGE_NAME(main) - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.dll - } - elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dylib$MODULE_VERSION - } - otherwise { - MODULE_PREFIX=lib - MODULE_SUFFIX=.so$MODULE_VERSION - } - - when ($OS_DARWIN) { - _GO_SONAME=-Wl,-install_name,$SONAME - } - elsewhen ($OS_LINUX) { - _GO_SONAME=-Wl,-soname,$SONAME - } - - when ($MODULE_VERSION) { - when ($OS_LINUX || $OS_DARWIN) { - _GO_LINK_EXE_EXT_CMD+= && $LINK_OR_COPY_CMD $TARGET ${output;nopath;noext:SONAME} - } - } -} - +module _GO_DLL_BASE_UNIT: GO_PROGRAM { + .CMD=GO_LINK_DLL + .SYMLINK_POLICY=SO + .ALLOWED=WHOLE_ARCHIVE + SET(_GO_TOOL_MODE dll) + SET(MODULE_TYPE DLL) + + GO_PACKAGE_NAME(main) + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.dll + } + elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dylib$MODULE_VERSION + } + otherwise { + MODULE_PREFIX=lib + MODULE_SUFFIX=.so$MODULE_VERSION + } + + when ($OS_DARWIN) { + _GO_SONAME=-Wl,-install_name,$SONAME + } + elsewhen ($OS_LINUX) { + _GO_SONAME=-Wl,-soname,$SONAME + } + + when ($MODULE_VERSION) { + when ($OS_LINUX || $OS_DARWIN) { + _GO_LINK_EXE_EXT_CMD+= && $LINK_OR_COPY_CMD $TARGET ${output;nopath;noext:SONAME} + } + } +} + # tag:go-specific -### @usage: GO_DLL(name major_ver [minor_ver] [PREFIX prefix]) -### -### Go ishared object module definition. -### Compile and link Go module to a shared object. -### Will select Go implementation on PEERDIR to PROTO_LIBRARY. -module GO_DLL: _GO_DLL_BASE_UNIT { -} - +### @usage: GO_DLL(name major_ver [minor_ver] [PREFIX prefix]) +### +### Go ishared object module definition. +### Compile and link Go module to a shared object. +### Will select Go implementation on PEERDIR to PROTO_LIBRARY. +module GO_DLL: _GO_DLL_BASE_UNIT { +} + # tag:go-specific tag:test ### @usage: GO_BENCH_TIMEOUT(x) ### @@ -8646,29 +8646,29 @@ macro GO_BENCH_TIMEOUT(bench_timeout) { ### Compile and link Go module as a test suitable for running with Arcadia testing support. ### All usual testing support macros like DATA, DEPENDS, SIZE, REQUIREMENTS etc. are supported. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. -module GO_TEST: GO_PROGRAM { - .CMD=GO_LINK_TEST - .ALIASES=GO_TEST_SRCS=GO_TEST_SRCS GO_XTEST_SRCS=GO_XTEST_SRCS GO_TEST_EMBED_PATTERN=GO_TEST_EMBED_PATTERN GO_XTEST_EMBED_PATTERN=GO_XTEST_EMBED_PATTERN GO_TEST_EMBED_DIR=GO_TEST_EMBED_DIR GO_XTEST_EMBED_DIR=GO_XTEST_EMBED_DIR - .ALLOWED=GO_SKIP_TESTS YT_SPEC +module GO_TEST: GO_PROGRAM { + .CMD=GO_LINK_TEST + .ALIASES=GO_TEST_SRCS=GO_TEST_SRCS GO_XTEST_SRCS=GO_XTEST_SRCS GO_TEST_EMBED_PATTERN=GO_TEST_EMBED_PATTERN GO_XTEST_EMBED_PATTERN=GO_XTEST_EMBED_PATTERN GO_TEST_EMBED_DIR=GO_TEST_EMBED_DIR GO_XTEST_EMBED_DIR=GO_XTEST_EMBED_DIR + .ALLOWED=GO_SKIP_TESTS YT_SPEC .FINAL_TARGET=no - SET(_GO_TOOL_MODE test) - SET(MODULE_TYPE PROGRAM) - ENABLE(GO_TEST_MODULE) - SET(GO_COVER_INFO_VALUE) - - # We have to add uncoditionaly PEERDIR to ${GOSTD}/os here thouth it is really - # needed when TestMain is defined in the source code of the test - PEERDIR(${GOSTD}/os) - - PEERDIR(${GOSTD}/testing/internal/testdeps) - PEERDIR(${GOSTD}/testing) - + SET(_GO_TOOL_MODE test) + SET(MODULE_TYPE PROGRAM) + ENABLE(GO_TEST_MODULE) + SET(GO_COVER_INFO_VALUE) + + # We have to add uncoditionaly PEERDIR to ${GOSTD}/os here thouth it is really + # needed when TestMain is defined in the source code of the test + PEERDIR(${GOSTD}/os) + + PEERDIR(${GOSTD}/testing/internal/testdeps) + PEERDIR(${GOSTD}/testing) + ADD_YTEST($MODULE_PREFIX$REALPRJNAME go.test) ADD_YTEST($MODULE_PREFIX$REALPRJNAME go.bench) SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) -} - +} + # tag:go-specific macro GO_MOCKGEN_FROM(Path) { SET(MOCKGEN_FROM ${Path}) @@ -8769,15 +8769,15 @@ macro ALL_PY_SRCS(TOP_LEVEL?"TOP_LEVEL":"", NAMESPACE="", RECURSIVE?"RECURSIVE": } # tag:python-specific -_PY_EXTRA_LINT_FILES_VALUE= -### @usage: PY_EXTRA_LINT_FILES(files...) -### -### Add extra Python files for linting. This macro allows adding -### Python files which has no .py extension. -macro PY_EXTRA_LINT_FILES(FILES...) { - SET_APPEND(_PY_EXTRA_LINT_FILES_VALUE $FILES) -} - +_PY_EXTRA_LINT_FILES_VALUE= +### @usage: PY_EXTRA_LINT_FILES(files...) +### +### Add extra Python files for linting. This macro allows adding +### Python files which has no .py extension. +macro PY_EXTRA_LINT_FILES(FILES...) { + SET_APPEND(_PY_EXTRA_LINT_FILES_VALUE $FILES) +} + # tag:python-specific ### @usage: PY23_LIBRARY([name]) ### @@ -9005,8 +9005,8 @@ when (!$TENSORRT_VERSION) { ANDROID_APK_TEST_ACTIVITY_VALUE=com.yandex.test.unittests/.RunTestsActivity -MAVEN_BIN=$MAVEN_RESOURCE_GLOBAL/bin - +MAVEN_BIN=$MAVEN_RESOURCE_GLOBAL/bin + when ($QT_REQUIRED) { QT_BIN=${HOST_QT_RESOURCE_GLOBAL}/bin } @@ -9046,33 +9046,33 @@ macro WINDOWS_MANIFEST(Manifest) { when ($MSVC == "yes" && $WINDOWS_MANIFEST) { LDFLAGS+=/MANIFEST:EMBED /MANIFESTINPUT:${input:WINDOWS_MANIFEST} } - + # tag:cpp-specific -_VISIBILITY_LEVEL= -### @usage: VISIBILITY(level) -### -### This macro sets visibility level for symbols compiled for the current module. 'level' -### may take only one of the following values: DEFAULT, HIDDEN. -macro VISIBILITY(LEVEL) { - SET(_VISIBILITY_LEVEL ${LEVEL}) - select ($LEVEL) { - "DEFAULT" | "HIDDEN" ? { - } - default ? { - _OK = no - } - } - ASSERT(_OK Unsupported value [$LEVEL] passed to VISIBILITY macro, expected values are DEFAULT, HIDDEN.) -} - +_VISIBILITY_LEVEL= +### @usage: VISIBILITY(level) +### +### This macro sets visibility level for symbols compiled for the current module. 'level' +### may take only one of the following values: DEFAULT, HIDDEN. +macro VISIBILITY(LEVEL) { + SET(_VISIBILITY_LEVEL ${LEVEL}) + select ($LEVEL) { + "DEFAULT" | "HIDDEN" ? { + } + default ? { + _OK = no + } + } + ASSERT(_OK Unsupported value [$LEVEL] passed to VISIBILITY macro, expected values are DEFAULT, HIDDEN.) +} + # tag:cpp-specific -_CFLAGS_VISIBILITY= -when ($_VISIBILITY_LEVEL != "" && $IGNORE_VISIBILITY != "yes") { - when ($CLANG == "yes" || $GCC == "yes") { - _CFLAGS_VISIBILITY=-fvisibility=${tolower:_VISIBILITY_LEVEL} - } -} -CFLAGS+=$_CFLAGS_VISIBILITY +_CFLAGS_VISIBILITY= +when ($_VISIBILITY_LEVEL != "" && $IGNORE_VISIBILITY != "yes") { + when ($CLANG == "yes" || $GCC == "yes") { + _CFLAGS_VISIBILITY=-fvisibility=${tolower:_VISIBILITY_LEVEL} + } +} +CFLAGS+=$_CFLAGS_VISIBILITY # tag:cpp-specific macro SDBUS_CPP_ADAPTOR(File) { @@ -9249,23 +9249,23 @@ module MCU_PROGRAM: PROGRAM { macro METAQUERYFILES(Files...) { ENABLE(UNUSED_MACRO) } - + # tag:flags tag:internal tag:windows-specific -### @usage: _MSVC_FLAGS_WINDOWS_IMPL(target_platform compiler_flags) # internal -### -### Add CFLAGS when the firts argument is WINDOWS -macro _MSVC_FLAGS_WINDOWS_IMPL(WINDOWS[], FLAGS...) { - CFLAGS($WINDOWS) -} - +### @usage: _MSVC_FLAGS_WINDOWS_IMPL(target_platform compiler_flags) # internal +### +### Add CFLAGS when the firts argument is WINDOWS +macro _MSVC_FLAGS_WINDOWS_IMPL(WINDOWS[], FLAGS...) { + CFLAGS($WINDOWS) +} + # tag:flags tag:windows-specific tag:cpp-specific -### @usage: MSVC_FLAGS([GLOBAL compiler_flag]* compiler_flags) -### -### Add the specified flags to the compilation line of C/C++files. -### Flags apply only if the compiler used is MSVC (cl.exe) -macro MSVC_FLAGS(FLAGS...) { - _MSVC_FLAGS_WINDOWS_IMPL($TARGET_PLATFORM $FLAGS) -} +### @usage: MSVC_FLAGS([GLOBAL compiler_flag]* compiler_flags) +### +### Add the specified flags to the compilation line of C/C++files. +### Flags apply only if the compiler used is MSVC (cl.exe) +macro MSVC_FLAGS(FLAGS...) { + _MSVC_FLAGS_WINDOWS_IMPL($TARGET_PLATFORM $FLAGS) +} ### @usage: COLLECT_YDB_API_SPECS_LEGACY(VarName Paths...) #deprecated ### diff --git a/build/ymake_conf.py b/build/ymake_conf.py index 30219eb85e..e2dc55ed3c 100755 --- a/build/ymake_conf.py +++ b/build/ymake_conf.py @@ -74,12 +74,12 @@ class Platform(object): self.is_cortex_a53 = self.arch in ('armv7ahf_cortex_a53', 'armv8a_cortex_a53') self.is_cortex_m33 = self.arch in ('armv8m_cortex_m33',) - self.is_power8le = self.arch == 'ppc64le' - self.is_power9le = self.arch == 'power9le' - self.is_powerpc = self.is_power8le or self.is_power9le + self.is_power8le = self.arch == 'ppc64le' + self.is_power9le = self.arch == 'power9le' + self.is_powerpc = self.is_power8le or self.is_power9le self.is_32_bit = self.is_x86 or self.is_armv7 or self.is_armv8m - self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc + self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc assert self.is_32_bit or self.is_64_bit assert not (self.is_32_bit and self.is_64_bit) @@ -88,9 +88,9 @@ class Platform(object): self.is_linux_x86_64 = self.is_linux and self.is_x86_64 self.is_linux_armv8 = self.is_linux and self.is_armv8 self.is_linux_armv7 = self.is_linux and self.is_armv7 - self.is_linux_power8le = self.is_linux and self.is_power8le - self.is_linux_power9le = self.is_linux and self.is_power9le - self.is_linux_powerpc = self.is_linux_power8le or self.is_linux_power9le + self.is_linux_power8le = self.is_linux and self.is_power8le + self.is_linux_power9le = self.is_linux and self.is_power9le + self.is_linux_powerpc = self.is_linux_power8le or self.is_linux_power9le self.is_macos = self.os == 'macos' self.is_macos_x86_64 = self.is_macos and self.is_x86_64 @@ -155,9 +155,9 @@ class Platform(object): (self.is_armv8m, 'ARCH_ARM8M'), (self.is_arm, 'ARCH_ARM'), (self.is_linux_armv8 or self.is_macos_arm64, 'ARCH_AARCH64'), - (self.is_powerpc, 'ARCH_PPC64LE'), - (self.is_power8le, 'ARCH_POWER8LE'), - (self.is_power9le, 'ARCH_POWER9LE'), + (self.is_powerpc, 'ARCH_PPC64LE'), + (self.is_power8le, 'ARCH_POWER8LE'), + (self.is_power9le, 'ARCH_POWER9LE'), (self.is_32_bit, 'ARCH_TYPE_32'), (self.is_64_bit, 'ARCH_TYPE_64'), )) @@ -268,15 +268,15 @@ def emit(key, *value): print('{0}={1}'.format(key, ' '.join(to_strings(value)))) -def emit_with_comment(comment, key, *value): +def emit_with_comment(comment, key, *value): print('# {}'.format(comment)) - emit(key, *value) - - -def emit_with_ignore_comment(key, *value): - emit_with_comment('IGNORE YMAKE CONF CONTEXT', key, *value) - - + emit(key, *value) + + +def emit_with_ignore_comment(key, *value): + emit_with_comment('IGNORE YMAKE CONF CONTEXT', key, *value) + + def append(key, *value): print('{0}+={1}'.format(key, ' '.join(to_strings(value)))) @@ -301,13 +301,13 @@ def emit_big(text): class Variables(dict): - def emit(self, with_ignore_comment=[]): - with_ignore_comment_set = set(with_ignore_comment) + def emit(self, with_ignore_comment=[]): + with_ignore_comment_set = set(with_ignore_comment) for k in sorted(self.keys()): - if k in with_ignore_comment_set: - emit_with_ignore_comment(k, self[k]) - else: - emit(k, self[k]) + if k in with_ignore_comment_set: + emit_with_ignore_comment(k, self[k]) + else: + emit(k, self[k]) def update_from_presets(self): for k in six.iterkeys(self): @@ -494,7 +494,7 @@ class Build(object): target_os = System(self.target) target_os.print_target_settings() - + if self.pic: emit('PIC', 'yes') @@ -641,8 +641,8 @@ class Build(object): print_swig_config() if self.ignore_local_files or host.is_windows or is_positive('NO_SVN_DEPENDS'): - emit_with_ignore_comment('SVN_DEPENDS') - emit_with_ignore_comment('SVN_DEPENDS_CACHE__NO_UID__') + emit_with_ignore_comment('SVN_DEPENDS') + emit_with_ignore_comment('SVN_DEPENDS_CACHE__NO_UID__') else: def find_svn(): for i in range(0, 3): @@ -664,8 +664,8 @@ class Build(object): return '' - emit_with_ignore_comment('SVN_DEPENDS', find_svn()) - emit_with_ignore_comment('SVN_DEPENDS_CACHE__NO_UID__', '${hide;kv:"disable_cache"}') + emit_with_ignore_comment('SVN_DEPENDS', find_svn()) + emit_with_ignore_comment('SVN_DEPENDS_CACHE__NO_UID__', '${hide;kv:"disable_cache"}') @staticmethod def _load_json_from_base64(base64str): @@ -697,19 +697,19 @@ class YMake(object): else: presets['YMAKE_JAVA_MODULES'] = 'yes' if presets and 'YMAKE_JAVA_MODULES' in presets and presets['YMAKE_JAVA_MODULES'] == "yes": - print('@import "${CONF_ROOT}/conf/java.ymake.conf"') + print('@import "${CONF_ROOT}/conf/java.ymake.conf"') else: - print('@import "${CONF_ROOT}/conf/jbuild.ymake.conf"') + print('@import "${CONF_ROOT}/conf/jbuild.ymake.conf"') if presets: print('# Variables set from command line by -D options') for key in sorted(presets): - if key in ('MY_YMAKE_BIN', 'REAL_YMAKE_BIN'): - emit_with_ignore_comment(key, opts().presets[key]) + if key in ('MY_YMAKE_BIN', 'REAL_YMAKE_BIN'): + emit_with_ignore_comment(key, opts().presets[key]) elif key == 'YMAKE_JAVA_MODULES': continue - else: - emit(key, opts().presets[key]) + else: + emit(key, opts().presets[key]) @staticmethod def _print_conf_content(path): @@ -717,11 +717,11 @@ class YMake(object): print(fin.read()) def print_core_conf(self): - emit('YMAKE_YNDEXER_IGNORE_BUILD_ROOT', 'yes') - print('@import "${CONF_ROOT}/ymake.core.conf"') + emit('YMAKE_YNDEXER_IGNORE_BUILD_ROOT', 'yes') + print('@import "${CONF_ROOT}/ymake.core.conf"') def print_settings(self): - emit_with_ignore_comment('ARCADIA_ROOT', self.arcadia.root) + emit_with_ignore_comment('ARCADIA_ROOT', self.arcadia.root) @staticmethod def _find_conf(conf_file): @@ -865,12 +865,12 @@ class CompilerDetector(object): raise ConfigureError('Custom compiler was requested but not specified') c_compiler_path = which(c_compiler) - + clang_vars = ['__clang_major__', '__clang_minor__', '__clang_patchlevel__'] gcc_vars = ['__GNUC__', '__GNUC_MINOR__', '__GNUC_PATCHLEVEL__'] msvc_vars = ['_MSC_VER'] apple_var = '__apple_build_version__' - + compiler_vars = self.get_compiler_vars(c_compiler_path, clang_vars + [apple_var] + gcc_vars + msvc_vars) if not compiler_vars: @@ -1045,7 +1045,7 @@ class GnuToolchainOptions(ToolchainOptions): if self.target.is_armv7 and self.target.armv7_float_abi == 'softfp': return 'ubuntu-18' - if self.target.is_powerpc: + if self.target.is_powerpc: return 'ubuntu-14' # Default OS SDK for Linux builds @@ -1107,21 +1107,21 @@ class GnuToolchain(Toolchain): self.env = self.tc.get_env() - self.env_go = {} - if self.tc.is_clang: - self.env_go = {'PATH': ['{}/bin'.format(self.tc.name_marker)]} - if self.tc.is_gcc: - self.env_go = {'PATH': ['{}/gcc/bin'.format(self.tc.name_marker)]} - if 'PATH' in self.env_go: - if target.is_linux: - self.env_go['PATH'].append('$OS_SDK_ROOT_RESOURCE_GLOBAL/usr/bin') - elif target.is_macos: - self.env_go['PATH'].extend([ - '$MACOS_SDK_RESOURCE_GLOBAL/usr/bin', - '$CCTOOLS_ROOT_RESOURCE_GLOBAL/bin', - '$GO_FAKE_XCRUN_RESOURCE_GLOBAL', - ]) - + self.env_go = {} + if self.tc.is_clang: + self.env_go = {'PATH': ['{}/bin'.format(self.tc.name_marker)]} + if self.tc.is_gcc: + self.env_go = {'PATH': ['{}/gcc/bin'.format(self.tc.name_marker)]} + if 'PATH' in self.env_go: + if target.is_linux: + self.env_go['PATH'].append('$OS_SDK_ROOT_RESOURCE_GLOBAL/usr/bin') + elif target.is_macos: + self.env_go['PATH'].extend([ + '$MACOS_SDK_RESOURCE_GLOBAL/usr/bin', + '$CCTOOLS_ROOT_RESOURCE_GLOBAL/bin', + '$GO_FAKE_XCRUN_RESOURCE_GLOBAL', + ]) + self.swift_flags_platform = [] self.swift_lib_path = None @@ -1162,7 +1162,7 @@ class GnuToolchain(Toolchain): (target.is_linux and target.is_armv8, 'aarch64-linux-gnu'), (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'hard', 'arm-linux-gnueabihf'), (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'softfp', 'arm-linux-gnueabi'), - (target.is_linux and target.is_powerpc, 'powerpc64le-linux-gnu'), + (target.is_linux and target.is_powerpc, 'powerpc64le-linux-gnu'), (target.is_iossim and target.is_arm64, 'arm64-apple-ios{}-simulator'.format(ios_version_min)), (target.is_apple and target.is_x86, 'i386-apple-darwin14'), (target.is_apple and target.is_x86_64, 'x86_64-apple-darwin14'), @@ -1211,15 +1211,15 @@ class GnuToolchain(Toolchain): # to reduce code size self.c_flags_platform.append('-mthumb') - if target.is_arm or target.is_powerpc: + if target.is_arm or target.is_powerpc: # On linux, ARM and PPC default to unsigned char # However, Arcadia requires char to be signed self.c_flags_platform.append('-fsigned-char') if self.tc.is_clang or self.tc.is_gcc and self.tc.version_at_least(8, 2): target_flags = select(default=[], selectors=[ - (target.is_linux and target.is_power8le, ['-mcpu=power8', '-mtune=power8', '-maltivec']), - (target.is_linux and target.is_power9le, ['-mcpu=power9', '-mtune=power9', '-maltivec']), + (target.is_linux and target.is_power8le, ['-mcpu=power8', '-mtune=power8', '-maltivec']), + (target.is_linux and target.is_power9le, ['-mcpu=power9', '-mtune=power9', '-maltivec']), (target.is_linux and target.is_armv8, ['-march=armv8a']), (target.is_macos_arm64, ['-mmacosx-version-min={}'.format(macos_arm64_version_min)]), (target.is_macos, ['-mmacosx-version-min={}'.format(macos_version_min)]), @@ -1257,7 +1257,7 @@ class GnuToolchain(Toolchain): self.setup_tools(project='build/platform/linux_sdk', var='$OS_SDK_ROOT_RESOURCE_GLOBAL', bin='usr/bin', ldlibs='usr/lib/x86_64-linux-gnu') elif host.is_macos: self.setup_tools(project='build/platform/binutils', var='$BINUTILS_ROOT_RESOURCE_GLOBAL', bin='x86_64-linux-gnu/bin', ldlibs=None) - elif target.is_powerpc: + elif target.is_powerpc: self.setup_tools(project='build/platform/linux_sdk', var='$OS_SDK_ROOT_RESOURCE_GLOBAL', bin='usr/bin', ldlibs='usr/x86_64-linux-gnu/powerpc64le-linux-gnu/lib') elif target.is_armv8: self.setup_tools(project='build/platform/linux_sdk', var='$OS_SDK_ROOT_RESOURCE_GLOBAL', bin='usr/bin', ldlibs='usr/lib/x86_64-linux-gnu') @@ -1298,12 +1298,12 @@ class GnuToolchain(Toolchain): super(GnuToolchain, self).print_toolchain() emit('TOOLCHAIN_ENV', format_env(self.env, list_separator=':')) - emit('_GO_TOOLCHAIN_ENV_PATH', format_env(self.env_go, list_separator=':')) + emit('_GO_TOOLCHAIN_ENV_PATH', format_env(self.env_go, list_separator=':')) emit('C_FLAGS_PLATFORM', self.c_flags_platform) emit('SWIFT_FLAGS_PLATFORM', self.swift_flags_platform) emit('SWIFT_LD_FLAGS', '-L{}'.format(self.swift_lib_path) if self.swift_lib_path else '') - emit('PERL_SDK', preset('OS_SDK') or self.tc.os_sdk) + emit('PERL_SDK', preset('OS_SDK') or self.tc.os_sdk) if preset('OS_SDK') is None: emit('OS_SDK', self.tc.os_sdk) emit('OS_SDK_ROOT', None if self.tc.os_sdk_local else self.default_os_sdk_root) @@ -1311,7 +1311,7 @@ class GnuToolchain(Toolchain): class GnuCompiler(Compiler): gcc_fstack = ['-fstack-protector'] - + def __init__(self, tc, build): """ :type tc: GnuToolchainOptions @@ -1518,8 +1518,8 @@ class GnuCompiler(Compiler): }''') append('CFLAGS', self.c_flags, '$DEBUG_INFO_FLAGS', self.c_foptions, '$C_WARNING_OPTS', '$GCC_PREPROCESSOR_OPTS', '$USER_CFLAGS', '$USER_CFLAGS_GLOBAL') - append('CXXFLAGS', '$CFLAGS', '-std=' + self.tc.cxx_std, '$CXX_WARNING_OPTS', '$USER_CXXFLAGS', '$USER_CXXFLAGS_GLOBAL') - append('CONLYFLAGS', '$USER_CONLYFLAGS', '$USER_CONLYFLAGS_GLOBAL') + append('CXXFLAGS', '$CFLAGS', '-std=' + self.tc.cxx_std, '$CXX_WARNING_OPTS', '$USER_CXXFLAGS', '$USER_CXXFLAGS_GLOBAL') + append('CONLYFLAGS', '$USER_CONLYFLAGS', '$USER_CONLYFLAGS_GLOBAL') emit('CXX_COMPILER_UNQUOTED', self.tc.cxx_compiler) emit('CXX_COMPILER', '${quo:CXX_COMPILER_UNQUOTED}') emit('NOGCCSTACKCHECK', 'yes') @@ -1643,14 +1643,14 @@ class GnuCompiler(Compiler): append('C_DEFINES', '-D__LONG_LONG_SUPPORTED') - emit('OBJ_CROSS_SUF', '$OBJ_SUF%s' % self.cross_suffix) - emit('OBJECT_SUF', '$OBJ_SUF%s.o' % self.cross_suffix) - emit('GCC_COMPILE_FLAGS', '$EXTRA_C_FLAGS -c -o $_COMPILE_OUTPUTS', '${pre=-I:_C__INCLUDE}') + emit('OBJ_CROSS_SUF', '$OBJ_SUF%s' % self.cross_suffix) + emit('OBJECT_SUF', '$OBJ_SUF%s.o' % self.cross_suffix) + emit('GCC_COMPILE_FLAGS', '$EXTRA_C_FLAGS -c -o $_COMPILE_OUTPUTS', '${pre=-I:_C__INCLUDE}') if is_positive('DUMP_COMPILER_DEPS'): - emit('DUMP_DEPS', '-MD', '${output;hide;noauto;suf=${OBJ_SUF}.o.d:SRC}') + emit('DUMP_DEPS', '-MD', '${output;hide;noauto;suf=${OBJ_SUF}.o.d:SRC}') elif is_positive('DUMP_COMPILER_DEPS_FAST'): - emit('DUMP_DEPS', '-E', '-M', '-MF', '${output;noauto;suf=${OBJ_SUF}.o.d:SRC}') + emit('DUMP_DEPS', '-E', '-M', '-MF', '${output;noauto;suf=${OBJ_SUF}.o.d:SRC}') compiler_time_trace_requested = is_positive('TIME_TRACE') or is_positive('COMPILER_TIME_TRACE') compiler_supports_time_trace = self.tc.is_clang and self.tc.version_at_least(9) @@ -1678,7 +1678,7 @@ class GnuCompiler(Compiler): '$EXTRA_OUTPUT', '$SRCFLAGS', '$_LANG_CFLAGS_VALUE', - '${input:SRC}', + '${input:SRC}', '$TOOLCHAIN_ENV', '$YNDEXER_OUTPUT', '&& $COMPILER_TIME_TRACE_POSTPROCESS', @@ -1697,31 +1697,31 @@ class GnuCompiler(Compiler): '$COMPILER_TIME_TRACE_FLAGS', '$EXTRA_OUTPUT', '$SRCFLAGS', - '${input:SRC}', + '${input:SRC}', '$TOOLCHAIN_ENV', '$YNDEXER_OUTPUT', '&& $COMPILER_TIME_TRACE_POSTPROCESS', ] + style - ignore_c_args_no_deps = [ - '${input:SRC}', - '$SRCFLAGS', - '$CLANG_TIDY_ARGS', - '$YNDEXER_ARGS', - '$YNDEXER_OUTPUT', + ignore_c_args_no_deps = [ + '${input:SRC}', + '$SRCFLAGS', + '$CLANG_TIDY_ARGS', + '$YNDEXER_ARGS', + '$YNDEXER_OUTPUT', '$COMPILER_TIME_TRACE_FLAGS', - '$EXTRA_OUTPUT', - '$CL_MACRO_INFO', + '$EXTRA_OUTPUT', + '$CL_MACRO_INFO', '$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__', '&& $COMPILER_TIME_TRACE_POSTPROCESS', - ] + ] c_args_nodeps = [c if c != '$GCC_COMPILE_FLAGS' else '$EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC}' for c in c_args if c not in ignore_c_args_no_deps] - emit('_SRC_C_NODEPS_CMD', ' '.join(c_args_nodeps)) - emit('_SRC_CPP_CMD', ' '.join(cxx_args)) - emit('_SRC_C_CMD', ' '.join(c_args)) - emit('_SRC_M_CMD', '$SRC_c($SRC $SRCFLAGS)') - emit('_SRC_MASM_CMD', '$_EMPTY_CMD') + emit('_SRC_C_NODEPS_CMD', ' '.join(c_args_nodeps)) + emit('_SRC_CPP_CMD', ' '.join(cxx_args)) + emit('_SRC_C_CMD', ' '.join(c_args)) + emit('_SRC_M_CMD', '$SRC_c($SRC $SRCFLAGS)') + emit('_SRC_MASM_CMD', '$_EMPTY_CMD') # fuzzing configuration if self.tc.is_clang: @@ -1786,8 +1786,8 @@ class Linker(object): self._print_linker_selector() def _print_linker_selector(self): - # if self.type is None then _DEFAULT_LINKER is set to empty string value - emit('_DEFAULT_LINKER_ID', self.type) + # if self.type is None then _DEFAULT_LINKER is set to empty string value + emit('_DEFAULT_LINKER_ID', self.type) class LD(Linker): @@ -1836,7 +1836,7 @@ class LD(Linker): else: self.llvm_ar_format="gnu" - self.ld_flags = [] + self.ld_flags = [] # Save linker's stdout to an additional .txt output file # e.g. LLD writes `--print-gc-sections` or `--print-icf-sections` to stdout @@ -1895,8 +1895,8 @@ class LD(Linker): self.ld_export_dynamic_flag = None self.start_group = None self.end_group = None - self.whole_archive = None - self.no_whole_archive = None + self.whole_archive = None + self.no_whole_archive = None self.ld_stripflag = None self.use_stdlib = None self.soname_option = None @@ -1910,8 +1910,8 @@ class LD(Linker): if target.is_linux or target.is_android or target.is_cygwin or target.is_none: self.start_group = '-Wl,--start-group' self.end_group = '-Wl,--end-group' - self.whole_archive = '-Wl,--whole-archive' - self.no_whole_archive = '-Wl,--no-whole-archive' + self.whole_archive = '-Wl,--whole-archive' + self.no_whole_archive = '-Wl,--no-whole-archive' self.ld_stripflag = '-s' self.soname_option = '-soname' @@ -1975,7 +1975,7 @@ class LD(Linker): emit('STRIP_TOOL_VENDOR', self.strip) emit('OBJCOPY_TOOL_VENDOR', self.objcopy) - append('LDFLAGS', '$USER_LDFLAGS', self.ld_flags) + append('LDFLAGS', '$USER_LDFLAGS', self.ld_flags) append('LDFLAGS_GLOBAL', '') emit('LD_STRIP_FLAG', self.ld_stripflag) @@ -1994,12 +1994,12 @@ class LD(Linker): else: emit('C_SYSTEM_LIBRARIES', self.use_stdlib, self.thread_library, self.sys_lib, '-lc') - emit('START_WHOLE_ARCHIVE_VALUE', self.whole_archive) - emit('END_WHOLE_ARCHIVE_VALUE', self.no_whole_archive) - - if self.ld_sdk: - emit('LD_SDK_VERSION', self.ld_sdk) - + emit('START_WHOLE_ARCHIVE_VALUE', self.whole_archive) + emit('END_WHOLE_ARCHIVE_VALUE', self.no_whole_archive) + + if self.ld_sdk: + emit('LD_SDK_VERSION', self.ld_sdk) + dwarf_tool = self.tc.dwarf_tool if dwarf_tool is None and self.tc.is_clang and (self.target.is_macos or self.target.is_ios): dsymutil = '{}/bin/{}dsymutil'.format(self.tc.name_marker, '' if self.tc.version_at_least(7) else 'llvm-') @@ -2073,66 +2073,66 @@ class LD(Linker): ) else: emit('LINK_SCRIPT_EXE_FLAGS') - emit('REAL_LINK_EXE_CMDLINE', - '$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"}', - '--source-root $ARCADIA_ROOT', + emit('REAL_LINK_EXE_CMDLINE', + '$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"}', + '--source-root $ARCADIA_ROOT', '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', - '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', - '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', - arch_flag, - '$LINK_SCRIPT_EXE_FLAGS', - '$CXX_COMPILER', - srcs_globals, - '$VCS_C_OBJ $AUTO_INPUT -o $TARGET', - exe_flags, - ld_env_style, - ) - emit('REAL_LINK_EXE', '$REAL_LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', + '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', + arch_flag, + '$LINK_SCRIPT_EXE_FLAGS', + '$CXX_COMPILER', + srcs_globals, + '$VCS_C_OBJ $AUTO_INPUT -o $TARGET', + exe_flags, + ld_env_style, + ) + emit('REAL_LINK_EXE', '$REAL_LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') # Executable Shared Library - emit('REAL_LINK_EXEC_DYN_LIB_CMDLINE', - '$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"}', - '--target $TARGET', + emit('REAL_LINK_EXEC_DYN_LIB_CMDLINE', + '$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"}', + '--target $TARGET', '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', - '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', - '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', - arch_flag, - '$LINK_DYN_LIB_FLAGS', - '$CXX_COMPILER', - srcs_globals, - '$VCS_C_OBJ $AUTO_INPUT -o $TARGET', - exec_shared_flag, - soname_flag, - exe_flags, - ld_env_style, - ) - emit('REAL_LINK_EXEC_DYN_LIB', '$REAL_LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', + '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', + arch_flag, + '$LINK_DYN_LIB_FLAGS', + '$CXX_COMPILER', + srcs_globals, + '$VCS_C_OBJ $AUTO_INPUT -o $TARGET', + exec_shared_flag, + soname_flag, + exe_flags, + ld_env_style, + ) + emit('REAL_LINK_EXEC_DYN_LIB', '$REAL_LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') # Shared Library emit('LINK_DYN_LIB_FLAGS') - emit('REAL_LINK_DYN_LIB_CMDLINE', - '$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"}', + emit('REAL_LINK_DYN_LIB_CMDLINE', + '$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"}', '--target $TARGET', '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX$MODULE_VERSION.linker.txt:REALPRJNAME}' if self.save_linker_output else '', - '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', - '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', - arch_flag, - '$LINK_DYN_LIB_FLAGS', - '$CXX_COMPILER', - srcs_globals, + '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', + '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', + arch_flag, + '$LINK_DYN_LIB_FLAGS', + '$CXX_COMPILER', + srcs_globals, '$VCS_C_OBJ $AUTO_INPUT -o $TARGET', - shared_flag, - soname_flag, - exe_flags, - ld_env_style) - emit('REAL_LINK_DYN_LIB', '$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + shared_flag, + soname_flag, + exe_flags, + ld_env_style) + emit('REAL_LINK_DYN_LIB', '$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') if self.dwarf_command is None or self.target.is_ios: - emit('DWARF_COMMAND') - else: - emit('DWARF_COMMAND', self.dwarf_command, ld_env_style) + emit('DWARF_COMMAND') + else: + emit('DWARF_COMMAND', self.dwarf_command, ld_env_style) if is_positive("TIDY"): emit('LINK_EXE', '$REAL_LINK_EXE') else: @@ -2143,7 +2143,7 @@ class LD(Linker): emit('LINK_DYN_LIB', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND') emit('LINK_EXEC_DYN_LIB', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_EXEC_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND') emit('SWIG_DLL_JAR_CMD', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_SWIG_DLL_JAR_CMD && $DWARF_COMMAND') - + tail_link_lib = '$AUTO_INPUT ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p AR"} $TOOLCHAIN_ENV ${kv;hide:"pc light-red"} ${kv;hide:"show_out"}' if is_positive("TIDY"): archiver = '$YMAKE_PYTHON ${input:"build/scripts/clang_tidy_arch.py"} --source-root $ARCADIA_ROOT --build-root $ARCADIA_BUILD_ROOT --output-file' @@ -2429,7 +2429,7 @@ class MSVCCompiler(MSVC, Compiler): flags_debug = ['/Ob0', '/Od', '/D_DEBUG'] flags_release = ['/Ox', '/Ob2', '/Oi', '/DNDEBUG'] - flags_c_only = [] + flags_c_only = [] cxx_flags = [ # Provide proper __cplusplus value # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ @@ -2508,12 +2508,12 @@ class MSVCCompiler(MSVC, Compiler): ] if target.is_armv7: - masm_io = '-o ${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}' + masm_io = '-o ${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}' else: - masm_io = '/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}' + masm_io = '/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}' - emit('OBJ_CROSS_SUF', '$OBJ_SUF') - emit('OBJECT_SUF', '$OBJ_SUF.obj') + emit('OBJ_CROSS_SUF', '$OBJ_SUF') + emit('OBJECT_SUF', '$OBJ_SUF.obj') emit('WIN32_WINNT', '{value}'.format(value=win32_winnt)) defines.append('/D{name}=$WIN32_WINNT'.format(name=self.WIN32_WINNT.Macro)) @@ -2575,8 +2575,8 @@ class MSVCCompiler(MSVC, Compiler): emit('CFLAGS_PER_TYPE', '@[debug|$CFLAGS_DEBUG]@[release|$CFLAGS_RELEASE]') append('CFLAGS', flags, flags_msvs_only, '$CFLAGS_PER_TYPE', '$DEBUG_INFO_FLAGS', '$C_WARNING_OPTS', '$C_DEFINES', '$USER_CFLAGS', '$USER_CFLAGS_GLOBAL') - append('CXXFLAGS', '$CFLAGS', '/std:' + self.tc.cxx_std, cxx_flags, cxx_defines, '$CXX_WARNING_OPTS', '$USER_CXXFLAGS', '$USER_CXXFLAGS_GLOBAL') - append('CONLYFLAGS', flags_c_only, '$USER_CONLYFLAGS', '$USER_CONLYFLAGS_GLOBAL') + append('CXXFLAGS', '$CFLAGS', '/std:' + self.tc.cxx_std, cxx_flags, cxx_defines, '$CXX_WARNING_OPTS', '$USER_CXXFLAGS', '$USER_CXXFLAGS_GLOBAL') + append('CONLYFLAGS', flags_c_only, '$USER_CONLYFLAGS', '$USER_CONLYFLAGS_GLOBAL') append('BC_CFLAGS', '$CFLAGS') append('BC_CXXFLAGS', '$BC_CFLAGS', '$CXXFLAGS') @@ -2611,26 +2611,26 @@ class MSVCCompiler(MSVC, Compiler): emit('CL_WRAPPER') emit('ML_WRAPPER') - emit('_SRC_C_NODEPS_CMD', - '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo${OUTFILE} ${SRC} ${EXTRA_C_FLAGS} ${pre=/I :INC} ' + emit('_SRC_C_NODEPS_CMD', + '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo${OUTFILE} ${SRC} ${EXTRA_C_FLAGS} ${pre=/I :INC} ' '${CFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}' - ) - emit('_SRC_CPP_CMD', - '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ' - '${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE} ${requirements;hide:CC_REQUIREMENTS} ' + ) + emit('_SRC_CPP_CMD', + '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ' + '${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE} ${requirements;hide:CC_REQUIREMENTS} ' '${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}' - ) - emit('_SRC_C_CMD', - '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ' + ) + emit('_SRC_C_CMD', + '${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input;msvs_source:SRC} ' '${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CFLAGS} ${CONLYFLAGS} ${SRCFLAGS} ${requirements;hide:CC_REQUIREMENTS} ' '${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}' - ) - emit('_SRC_M_CMD', '$_EMPTY_CMD') - emit('_SRC_MASM_CMD', - '${cwd:ARCADIA_BUILD_ROOT} ${TOOLCHAIN_ENV} ${ML_WRAPPER} ${MASM_COMPILER} ${MASMFLAGS} ${SRCFLAGS} ' + + ) + emit('_SRC_M_CMD', '$_EMPTY_CMD') + emit('_SRC_MASM_CMD', + '${cwd:ARCADIA_BUILD_ROOT} ${TOOLCHAIN_ENV} ${ML_WRAPPER} ${MASM_COMPILER} ${MASMFLAGS} ${SRCFLAGS} ' + masm_io + '${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p AS"} ${kv;hide:"pc yellow"}' - ) - + ) + class MSVCLinker(MSVC, Linker): def __init__(self, tc, build): @@ -2680,13 +2680,13 @@ class MSVCLinker(MSVC, Linker): if self.tc.use_clang: flags_debug_only.append('/STACK:4194304') - if is_negative_str(preset('NO_DEBUGINFO', 'no')): - if self.tc.ide_msvs: - flags_debug_only.append('/DEBUG:FASTLINK' if not self.tc.use_clang else '/DEBUG') - flags_release_only.append('/DEBUG') - else: - # No FASTLINK for ya make, because resulting PDB would require .obj files (build_root's) to persist - flags_common.append('/DEBUG') + if is_negative_str(preset('NO_DEBUGINFO', 'no')): + if self.tc.ide_msvs: + flags_debug_only.append('/DEBUG:FASTLINK' if not self.tc.use_clang else '/DEBUG') + flags_release_only.append('/DEBUG') + else: + # No FASTLINK for ya make, because resulting PDB would require .obj files (build_root's) to persist + flags_common.append('/DEBUG') if not self.tc.ide_msvs: flags_common += ['/LIBPATH:"{}"'.format(path) for path in libpaths] @@ -2741,10 +2741,10 @@ class MSVCLinker(MSVC, Linker): emit('LINK_IMPLIB_VALUE') emit('LINK_IMPLIB', '/IMPLIB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.lib}') - if is_negative_str(preset('NO_DEBUGINFO', 'no')): - emit('LINK_EXTRA_OUTPUT', '/PDB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.pdb}') - else: - emit('LINK_EXTRA_OUTPUT') + if is_negative_str(preset('NO_DEBUGINFO', 'no')): + emit('LINK_EXTRA_OUTPUT', '/PDB:${output;noext;rootrel;pre=$MODULE_PREFIX:REALPRJNAME.pdb}') + else: + emit('LINK_EXTRA_OUTPUT') if not self.tc.under_wine: emit('LIB_WRAPPER', '${YMAKE_PYTHON}', '${input:"build/scripts/fix_msvc_output.py"}', 'lib') @@ -2772,13 +2772,13 @@ class MSVCLinker(MSVC, Linker): # the tail of link commands will be added in the third command file srcs_globals = '--start-wa --ya-start-command-file ${qe;rootrel;ext=.lib:SRCS_GLOBAL} --ya-end-command-file --end-wa \ --ya-start-command-file ${qe;rootrel;ext=.obj:SRCS_GLOBAL} --ya-end-command-file' - emit('REAL_LINK_DYN_LIB_CMDLINE', '${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER} ${LINK_WRAPPER_DYNLIB} ${LINK_EXE_CMD} \ - ${LINK_IMPLIB_VALUE} /DLL /OUT:${qe;rootrel:TARGET} ${LINK_EXTRA_OUTPUT} ${EXPORTS_VALUE} \ - ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ - ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', + emit('REAL_LINK_DYN_LIB_CMDLINE', '${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER} ${LINK_WRAPPER_DYNLIB} ${LINK_EXE_CMD} \ + ${LINK_IMPLIB_VALUE} /DLL /OUT:${qe;rootrel:TARGET} ${LINK_EXTRA_OUTPUT} ${EXPORTS_VALUE} \ + ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ + ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', srcs_globals, '--ya-start-command-file ${VCS_C_OBJ_RR} ${qe;rootrel:AUTO_INPUT} ${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ $LINK_EXE_FLAGS $LINK_STDLIBS $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE --ya-end-command-file') - emit('REAL_LINK_DYN_LIB', '$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + emit('REAL_LINK_DYN_LIB', '$REAL_LINK_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') emit('SWIG_DLL_JAR_CMD', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_SWIG_DLL_JAR_CMD') @@ -2788,25 +2788,25 @@ class MSVCLinker(MSVC, Linker): emit('LINK_LIB', '${GENERATE_MF} &&', head_link_lib, '/OUT:${qe;rootrel:TARGET}', tail_link_lib) emit('GLOBAL_LINK_LIB', head_link_lib, '/OUT:${qe;rootrel:GLOBAL_TARGET}', tail_link_lib) - emit('LINK_EXE_CMDLINE', '${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && ${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER}', - '${LINK_EXE_CMD} /OUT:${qe;rootrel:TARGET} \ - ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ - ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} ', + emit('LINK_EXE_CMDLINE', '${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && ${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER}', + '${LINK_EXE_CMD} /OUT:${qe;rootrel:TARGET} \ + ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ + ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL} ', '${LINK_EXTRA_OUTPUT}', srcs_globals, '--ya-start-command-file ${VCS_C_OBJ_RR} ${qe;rootrel:AUTO_INPUT} $LINK_EXE_FLAGS $LINK_STDLIBS $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE \ ${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} --ya-end-command-file \ ${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"}') - emit('LINK_EXE', '$LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + emit('LINK_EXE', '$LINK_EXE_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') emit('LINK_DYN_LIB', '${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB ${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"}') - emit('LINK_EXEC_DYN_LIB_CMDLINE', '${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && ${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER} ${LINK_WRAPPER_DYNLIB} ${LINK_EXE_CMD} \ - /OUT:${qe;rootrel:TARGET} ${LINK_EXTRA_OUTPUT} ${EXPORTS_VALUE} \ - ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ - ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', srcs_globals, + emit('LINK_EXEC_DYN_LIB_CMDLINE', '${GENERATE_MF} && $GENERATE_VCS_C_INFO_NODEP && ${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LINK_WRAPPER} ${LINK_WRAPPER_DYNLIB} ${LINK_EXE_CMD} \ + /OUT:${qe;rootrel:TARGET} ${LINK_EXTRA_OUTPUT} ${EXPORTS_VALUE} \ + ${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \ + ${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', srcs_globals, '--ya-start-command-file ${VCS_C_OBJ_RR} ${qe;rootrel:AUTO_INPUT} ${qe;rootrel;ext=.lib:PEERS} ${qe;rootrel;ext=.dll;noext;suf=.lib:PEERS} \ $LINK_EXE_FLAGS $LINK_STDLIBS $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE --ya-end-command-file \ ${hide;kv:"soe"} ${hide;kv:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${hide;kv:"pc blue"}') - emit('LINK_EXEC_DYN_LIB', '$LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') + emit('LINK_EXEC_DYN_LIB', '$LINK_EXEC_DYN_LIB_IMPL($_WHOLE_ARCHIVE_PEERS_VALUE)') emit('LINK_GLOBAL_FAT_OBJECT', '${TOOLCHAIN_ENV} ${cwd:ARCADIA_BUILD_ROOT} ${LIB_WRAPPER} ${LINK_LIB_CMD} /OUT:${qe;rootrel:TARGET} \ --ya-start-command-file ${qe;rootrel;ext=.lib:SRCS_GLOBAL} ${qe;rootrel;ext=.obj:SRCS_GLOBAL} ${qe;rootrel:AUTO_INPUT} $LINK_LIB_FLAGS --ya-end-command-file') @@ -2929,7 +2929,7 @@ class Perl(object): }) variables.reset_if_any(reset_value='PERL-NOT-FOUND') - variables.emit(with_ignore_comment=variables.keys()) + variables.emit(with_ignore_comment=variables.keys()) def _iter_config(self, config_keys): # Run perl -V:version -V:etc... @@ -3059,13 +3059,13 @@ class Cuda(object): else: cmd = '$CXX_COMPILER --cuda-path=$CUDA_ROOT $C_FLAGS_PLATFORM -c ${input:SRC} -o ${output;suf=${OBJ_SUF}${NVCC_OBJ_EXT}:SRC} ${pre=-I:_C__INCLUDE} $CXXFLAGS $SRCFLAGS $TOOLCHAIN_ENV ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p CU"} ${kv;hide:"pc green"}' # noqa E501 - emit('_SRC_CU_CMD', cmd) - emit('_SRC_CU_PEERDIR', ' '.join(sorted(self.peerdirs))) + emit('_SRC_CU_CMD', cmd) + emit('_SRC_CU_PEERDIR', ' '.join(sorted(self.peerdirs))) def have_cuda_in_arcadia(self): host, target = self.build.host_target - if not any((host.is_linux_x86_64, host.is_macos_x86_64, host.is_windows_x86_64, host.is_linux_powerpc)): + if not any((host.is_linux_x86_64, host.is_macos_x86_64, host.is_windows_x86_64, host.is_linux_powerpc)): return False if host != target: @@ -3134,7 +3134,7 @@ class Cuda(object): return select(( (host.is_linux_x86_64 and target.is_linux_x86_64, '$CUDA_HOST_TOOLCHAIN_RESOURCE_GLOBAL/bin/clang'), (host.is_linux_x86_64 and target.is_linux_armv8, '$CUDA_HOST_TOOLCHAIN_RESOURCE_GLOBAL/bin/clang'), - (host.is_linux_powerpc and target.is_linux_powerpc, '$CUDA_HOST_TOOLCHAIN_RESOURCE_GLOBAL/bin/clang'), + (host.is_linux_powerpc and target.is_linux_powerpc, '$CUDA_HOST_TOOLCHAIN_RESOURCE_GLOBAL/bin/clang'), (host.is_macos_x86_64 and target.is_macos_x86_64, '$CUDA_HOST_TOOLCHAIN_RESOURCE_GLOBAL/usr/bin/clang'), )) @@ -3237,9 +3237,9 @@ def main(): build = Build(arcadia, options.build_type, options.toolchain_params, force_ignore_local_files=not options.local_distbuild) build.print_build() - - emit_with_ignore_comment('CONF_SCRIPT_DEPENDS', __file__) - + + emit_with_ignore_comment('CONF_SCRIPT_DEPENDS', __file__) + if __name__ == '__main__': main() |