diff options
author | prettyboy <prettyboy@yandex-team.com> | 2023-09-08 18:04:29 +0300 |
---|---|---|
committer | prettyboy <prettyboy@yandex-team.com> | 2023-09-08 19:16:03 +0300 |
commit | 54065fe53a95def89c154ae1072ef82c8521b370 (patch) | |
tree | 47418c069ac5b9fca4c8e1c98514b5037d4b35f9 | |
parent | 817e41979557df1ec8f1f65f1a69d8e99fe3d948 (diff) | |
download | ydb-54065fe53a95def89c154ae1072ef82c8521b370.tar.gz |
[build/plugins/ytest] Allow prebuilt linters for opensource (try 2)
Без этого, ydb или не сможет запускать flake8 с помощью ya make.
diff который выедет в os ydb:
```
prettyboy@mous~> diff /tmp/aa /tmp/bb
93a94,97
> │ │ ├── flake8_py2
> │ │ │ └── ya.make
> │ │ ├── flake8_py3
> │ │ │ └── ya.make
283a288,293
> │ │ ├── black_linter
> │ │ │ ├── resources.json
> │ │ │ └── ya.make.prebuilt
> │ │ ├── flake8_linter
> │ │ │ ├── resources.json
> │ │ │ └── ya.make.prebuilt
50026a50037,50038
> │ ├── black_linter
> │ │ └── ya.make
50090a50103,50104
> │ ├── flake8_linter
> │ │ └── ya.make
85521c85535
< 7459 directories, 78059 files
---
> 7465 directories, 78067 files
```
-rw-r--r-- | build/external_resources/flake8_py2/ya.make | 23 | ||||
-rw-r--r-- | build/external_resources/flake8_py3/ya.make | 23 | ||||
-rw-r--r-- | build/plugins/ytest.py | 3 | ||||
-rw-r--r-- | build/prebuilt/tools/black_linter/resources.json | 22 | ||||
-rw-r--r-- | build/prebuilt/tools/black_linter/ya.make.prebuilt | 13 | ||||
-rw-r--r-- | build/prebuilt/tools/flake8_linter/resources.json | 22 | ||||
-rw-r--r-- | build/prebuilt/tools/flake8_linter/ya.make.prebuilt | 13 | ||||
-rw-r--r-- | tools/black_linter/ya.make | 13 | ||||
-rw-r--r-- | tools/flake8_linter/ya.make | 17 | ||||
-rw-r--r-- | ydb/apps/dstool/ya.make | 1 |
10 files changed, 147 insertions, 3 deletions
diff --git a/build/external_resources/flake8_py2/ya.make b/build/external_resources/flake8_py2/ya.make new file mode 100644 index 0000000000..1469b52cf3 --- /dev/null +++ b/build/external_resources/flake8_py2/ya.make @@ -0,0 +1,23 @@ +RESOURCES_LIBRARY() + +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_LINUX AND HOST_ARCH_AARCH64 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 + sbr:3961411314 FOR DARWIN-ARM64 + sbr:3961412335 FOR DARWIN + sbr:3961411785 FOR LINUX-PPC64LE + sbr:3961413236 FOR LINUX + sbr:3961412784 FOR WIN32 + sbr:3961410704 FOR LINUX-AARCH64 +) + +END() diff --git a/build/external_resources/flake8_py3/ya.make b/build/external_resources/flake8_py3/ya.make new file mode 100644 index 0000000000..6e49cbabd4 --- /dev/null +++ b/build/external_resources/flake8_py3/ya.make @@ -0,0 +1,23 @@ +RESOURCES_LIBRARY() + +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_LINUX AND HOST_ARCH_AARCH64 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 + sbr:3968796664 FOR DARWIN-ARM64 + sbr:3968797422 FOR DARWIN + sbr:3968796981 FOR LINUX-PPC64LE + sbr:3968797878 FOR LINUX + sbr:3968796477 FOR LINUX-AARCH64 + sbr:3968797636 FOR WIN32 +) + +END() diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py index 32f1289e45..243c2e43c8 100644 --- a/build/plugins/ytest.py +++ b/build/plugins/ytest.py @@ -1244,9 +1244,6 @@ def on_add_linter_check(unit, *args): if no_lint_value in ("none", "none_internal"): return - if unit.get("OPENSOURCE") == "yes": - return - keywords = { "DEPENDS": unlimited, "FILES": unlimited, diff --git a/build/prebuilt/tools/black_linter/resources.json b/build/prebuilt/tools/black_linter/resources.json new file mode 100644 index 0000000000..21f88f0b45 --- /dev/null +++ b/build/prebuilt/tools/black_linter/resources.json @@ -0,0 +1,22 @@ +{ + "by_platform": { + "darwin": { + "uri": "sbr:4312044253" + }, + "darwin-arm64": { + "uri": "sbr:4312093363" + }, + "linux": { + "uri": "sbr:4312064267" + }, + "linux-aarch64": { + "uri": "sbr:4312063561" + }, + "linux-ppc64le": { + "uri": "sbr:4312048745" + }, + "win32-clang-cl": { + "uri": "sbr:4312072792" + } + } +} diff --git a/build/prebuilt/tools/black_linter/ya.make.prebuilt b/build/prebuilt/tools/black_linter/ya.make.prebuilt new file mode 100644 index 0000000000..49e793f079 --- /dev/null +++ b/build/prebuilt/tools/black_linter/ya.make.prebuilt @@ -0,0 +1,13 @@ +SET_RESOURCE_URI_FROM_JSON(SANDBOX_RESOURCE_URI ${ARCADIA_ROOT}/build/prebuilt/tools/black_linter/resources.json) + +IF (SANDBOX_RESOURCE_URI != "") + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(BLACK_LINTER ${SANDBOX_RESOURCE_URI}) + + PRIMARY_OUTPUT(${BLACK_LINTER_RESOURCE_GLOBAL}/black_linter${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/build/prebuilt/tools/flake8_linter/resources.json b/build/prebuilt/tools/flake8_linter/resources.json new file mode 100644 index 0000000000..565c8be7f9 --- /dev/null +++ b/build/prebuilt/tools/flake8_linter/resources.json @@ -0,0 +1,22 @@ +{ + "by_platform": { + "darwin": { + "uri": "sbr:4307900052" + }, + "darwin-arm64": { + "uri": "sbr:4307900057" + }, + "linux": { + "uri": "sbr:4307890075" + }, + "linux-aarch64": { + "uri": "sbr:4307901240" + }, + "linux-ppc64le": { + "uri": "sbr:4307897255" + }, + "win32-clang-cl": { + "uri": "sbr:4307903123" + } + } +} diff --git a/build/prebuilt/tools/flake8_linter/ya.make.prebuilt b/build/prebuilt/tools/flake8_linter/ya.make.prebuilt new file mode 100644 index 0000000000..dc71bad749 --- /dev/null +++ b/build/prebuilt/tools/flake8_linter/ya.make.prebuilt @@ -0,0 +1,13 @@ +SET_RESOURCE_URI_FROM_JSON(SANDBOX_RESOURCE_URI ${ARCADIA_ROOT}/build/prebuilt/tools/flake8_linter/resources.json) + +IF (SANDBOX_RESOURCE_URI != "") + ENABLE(PREBUILT) + + PREBUILT_PROGRAM() + + DECLARE_EXTERNAL_RESOURCE(FLAKE8_LINTER ${SANDBOX_RESOURCE_URI}) + + PRIMARY_OUTPUT(${FLAKE8_LINTER_RESOURCE_GLOBAL}/flake8_linter${MODULE_SUFFIX}) + + END() +ENDIF() diff --git a/tools/black_linter/ya.make b/tools/black_linter/ya.make new file mode 100644 index 0000000000..ed2d642132 --- /dev/null +++ b/tools/black_linter/ya.make @@ -0,0 +1,13 @@ +IF (USE_PREBUILT_TOOLS OR OPENSOURCE) + INCLUDE(${ARCADIA_ROOT}/build/prebuilt/tools/black_linter/ya.make.prebuilt) +ENDIF() + +IF (NOT PREBUILT) + INCLUDE(${ARCADIA_ROOT}/tools/black_linter/bin/ya.make) +ENDIF() + +IF (NOT OPENSOURCE) + RECURSE( + bin + ) +ENDIF() diff --git a/tools/flake8_linter/ya.make b/tools/flake8_linter/ya.make new file mode 100644 index 0000000000..cd0469d8b6 --- /dev/null +++ b/tools/flake8_linter/ya.make @@ -0,0 +1,17 @@ +IF (USE_PREBUILT_TOOLS OR OPENSOURCE) + INCLUDE(${ARCADIA_ROOT}/build/prebuilt/tools/flake8_linter/ya.make.prebuilt) +ENDIF() + +IF (NOT PREBUILT) + INCLUDE(${ARCADIA_ROOT}/tools/flake8_linter/bin/ya.make) +ENDIF() + +IF (NOT OPENSOURCE) + RECURSE( + bin + ) + + RECURSE_FOR_TESTS( + bin/tests + ) +ENDIF() diff --git a/ydb/apps/dstool/ya.make b/ydb/apps/dstool/ya.make index 65e95e3cf4..61b07fc2dd 100644 --- a/ydb/apps/dstool/ya.make +++ b/ydb/apps/dstool/ya.make @@ -11,6 +11,7 @@ IF (OPENSOURCE) PEERDIRS arc/api/public build/external_resources/antlr3 + build/external_resources/flake8_py3 build/platform certs contrib |