diff options
author | hiddenpath <hiddenpath@yandex-team.com> | 2024-04-02 23:50:23 +0300 |
---|---|---|
committer | hiddenpath <hiddenpath@yandex-team.com> | 2024-04-03 00:02:31 +0300 |
commit | 8923c6d2c438e0aeed2e06b8b0275e1864eeee33 (patch) | |
tree | 6b5e476699fc0be5091cb650654ef5f602c8afff /build | |
parent | d18afd09df2a08cd023012593b46109b77713a6c (diff) | |
download | ydb-8923c6d2c438e0aeed2e06b8b0275e1864eeee33.tar.gz |
Update golang to 1.22.1
2967d19c907adf59101a1f47b4208bd0b04a6186
Diffstat (limited to 'build')
-rw-r--r-- | build/conf/go.conf | 13 | ||||
-rw-r--r-- | build/external_resources/go_tools/go1.22.json (renamed from build/external_resources/go_tools/go1.21.json) | 10 | ||||
-rw-r--r-- | build/external_resources/go_tools/ya.make | 4 | ||||
-rw-r--r-- | build/mapping.conf.json | 10 | ||||
-rw-r--r-- | build/plugins/gobuild.py | 19 | ||||
-rw-r--r-- | build/scripts/go_tool.py | 12 |
6 files changed, 37 insertions, 31 deletions
diff --git a/build/conf/go.conf b/build/conf/go.conf index f44a87ae9d..e497cb7b54 100644 --- a/build/conf/go.conf +++ b/build/conf/go.conf @@ -59,8 +59,11 @@ elsewhen ($ARCH_ARM64) { 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.21 -when ($GOSTD_VERSION == "1.21") { +GOSTD_VERSION=1.22 +when ($GOSTD_VERSION == "1.22") { + GOSTD=contrib/go/_std_1.22/src +} +elsewhen ($GOSTD_VERSION == "1.21") { GOSTD=contrib/go/_std_1.21/src } otherwise { @@ -211,7 +214,7 @@ macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { # tag:go-specific macro _GO_COMPILE_CGO1(NAME, FLAGS[], FILES...) { - .CMD=${hide:_CGO_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_TC_PATH/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:_CGO_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_TC_PATH/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"} $GO_TOOLCHAIN_ENV ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} } # tag:go-specific @@ -856,6 +859,10 @@ module GO_PROGRAM: _GO_BASE_UNIT { PEERDIR(${GOSTD}/runtime library/go/core/buildinfo) + when ($CGO_ENABLED == "yes") { + PEERDIR += ${GOSTD}/runtime/cgo + } + when ($RACE == "yes") { PEERDIR += ${GOSTD}/runtime/cgo PEERDIR += ${GOSTD}/runtime/race diff --git a/build/external_resources/go_tools/go1.21.json b/build/external_resources/go_tools/go1.22.json index 30dd9f3369..6d1bc822fc 100644 --- a/build/external_resources/go_tools/go1.21.json +++ b/build/external_resources/go_tools/go1.22.json @@ -1,19 +1,19 @@ { "by_platform": { "darwin-arm64": { - "uri": "sbr:5720722976" + "uri": "sbr:6067021677" }, "darwin-x86_64": { - "uri": "sbr:5720717636" + "uri": "sbr:6067013969" }, "linux-x86_64": { - "uri": "sbr:5720706939" + "uri": "sbr:6066996288" }, "linux-aarch64": { - "uri": "sbr:5720713011" + "uri": "sbr:6067006318" }, "win32-x86_64": { - "uri": "sbr:5720736838" + "uri": "sbr:6067029960" } } } diff --git a/build/external_resources/go_tools/ya.make b/build/external_resources/go_tools/ya.make index 697ae83a5e..fb979cd8e2 100644 --- a/build/external_resources/go_tools/ya.make +++ b/build/external_resources/go_tools/ya.make @@ -1,6 +1,8 @@ RESOURCES_LIBRARY() -IF(GOSTD_VERSION == 1.21) +IF(GOSTD_VERSION == 1.22) + DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(GO_TOOLS go1.22.json) +ELSEIF(GOSTD_VERSION == 1.21) DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(GO_TOOLS go1.21.json) ELSE() MESSAGE(FATAL_ERROR Unsupported version [${GOSTD_VERSION}] of Go Standard Library) diff --git a/build/mapping.conf.json b/build/mapping.conf.json index cd3f53693a..24989eac34 100644 --- a/build/mapping.conf.json +++ b/build/mapping.conf.json @@ -46,6 +46,11 @@ "5720706939": "https://devtools-registry.s3.yandex.net/5720706939", "5720713011": "https://devtools-registry.s3.yandex.net/5720713011", "5720736838": "https://devtools-registry.s3.yandex.net/5720736838", + "6067013969": "https://devtools-registry.s3.yandex.net/6067013969", + "6067021677": "https://devtools-registry.s3.yandex.net/6067021677", + "6066996288": "https://devtools-registry.s3.yandex.net/6066996288", + "6067006318": "https://devtools-registry.s3.yandex.net/6067006318", + "6067029960": "https://devtools-registry.s3.yandex.net/6067029960", "5543659225": "https://devtools-registry.s3.yandex.net/5543659225", "5560184603": "https://devtools-registry.s3.yandex.net/5560184603", "5553311553": "https://devtools-registry.s3.yandex.net/5553311553", @@ -455,6 +460,11 @@ "5720706939": "OTHER_RESOURCE-none-1.21.6-y_go1.21.6.linux-amd64.tar.gz", "5720713011": "OTHER_RESOURCE-none-1.21.6-y_go1.21.6.linux-arm64.tar.gz", "5720736838": "OTHER_RESOURCE-none-1.21.6-y_go1.21.6.windows-amd64.tar.gz", + "6067013969": "OTHER_RESOURCE-none-1.22.1-y_go1.22.1.darwin-amd64.tar.gz", + "6067021677": "OTHER_RESOURCE-none-1.22.1-y_go1.22.1.darwin-arm64.tar.gz", + "6066996288": "OTHER_RESOURCE-none-1.22.1-y_go1.22.1.linux-amd64.tar.gz", + "6067006318": "OTHER_RESOURCE-none-1.22.1-y_go1.22.1.linux-arm64.tar.gz", + "6067029960": "OTHER_RESOURCE-none-1.22.1-y_go1.22.1.windows-amd64.tar.gz", "5543659225": "OTHER_RESOURCE-none-none-clang-darwin-arm64.tgz", "5560184603": "OTHER_RESOURCE-none-none-clang-mingw64.tgz", "5553311553": "OTHER_RESOURCE-none-none-clang-new-darwin-arm64.tgz", diff --git a/build/plugins/gobuild.py b/build/plugins/gobuild.py index d0f205ca39..af073ff6ab 100644 --- a/build/plugins/gobuild.py +++ b/build/plugins/gobuild.py @@ -30,6 +30,10 @@ def get_import_path(unit): module_path = rootrel_arc_src(unit.path(), unit) assert len(module_path) > 0 + + if go_package_name(unit) == "main": + return "main" + import_path = module_path.replace('\\', '/') if import_path.startswith(std_lib_prefix): import_path = import_path[len(std_lib_prefix) :] @@ -38,6 +42,10 @@ def get_import_path(unit): else: import_path = arc_project_prefix + import_path assert len(import_path) > 0 + + if import_path.endswith("/gotest"): + return import_path[:-7] + return import_path @@ -63,15 +71,6 @@ def compare_versions(version1, version2): 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: @@ -236,8 +235,6 @@ def on_go_process_srcs(unit): 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 diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py index 26920553b5..7cbfe06372 100644 --- a/build/scripts/go_tool.py +++ b/build/scripts/go_tool.py @@ -18,7 +18,7 @@ import process_whole_archive_option as pwa arc_project_prefix = 'a.yandex-team.ru/' # FIXME: make version-independent -std_lib_prefix = 'contrib/go/_std_1.19/src/' +std_lib_prefix = 'contrib/go/_std_1.22/src/' vendor_prefix = 'vendor/' vet_info_ext = '.vet.out' vet_report_ext = '.vet.txt' @@ -435,14 +435,6 @@ def do_compile_go(args): 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) @@ -451,8 +443,6 @@ def do_compile_asm(args): # 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 |