Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to clang/llvm 14 #34754

Merged
merged 44 commits into from
Jun 3, 2022
Merged

Switch to clang/llvm 14 #34754

merged 44 commits into from
Jun 3, 2022

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Use clang-14 and LLVM infrastructure version 14 for builds. This closes #34681.

@robot-clickhouse robot-clickhouse added the pr-build Pull request with build/testing/packaging improvement label Feb 19, 2022
@@ -196,10 +196,8 @@ if __name__ == "__main__":
parser.add_argument("--clickhouse-repo-path", default=os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir))
parser.add_argument("--output-dir", required=True)
parser.add_argument("--build-type", choices=("debug", ""), default="")
parser.add_argument("--compiler", choices=("clang-11", "clang-11-darwin", "clang-11-darwin-aarch64", "clang-11-aarch64",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed outdated options.

BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-13_debug_none_bundled_unsplitted_disable_False_binary"}
BINARY_URL_TO_DOWNLOAD=${BINARY_URL_TO_DOWNLOAD:="https://clickhouse-builds.s3.yandex.net/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/$BINARY_TO_DOWNLOAD/clickhouse"}
BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-14_debug_none_bundled_unsplitted_disable_False_binary"}
BINARY_URL_TO_DOWNLOAD=${BINARY_URL_TO_DOWNLOAD:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/$BINARY_TO_DOWNLOAD/clickhouse"}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed default URL to AWS.
By the way, it is unused because it is set explicitly before calling this script.

@@ -2,7 +2,7 @@
set -euo pipefail


CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.yandex.net/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-13_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-14_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse"}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@@ -200,14 +200,6 @@ cmake -DUSE_DEBUG_HELPERS=1 -DUSE_STATIC_LIBRARIES=0 -DSPLIT_SHARED_LIBRARIES=1

В процессе сборки могут появится сообщения `libprotobuf WARNING` про protobuf файлы в библиотеке libhdfs2. Это не имеет значения.

В случае получения ошибок вида `error: variable 'y' set but not used [-Werror,-Wunused-but-set-variable]` ножно попробовать использовать другую версию компилятора сlang. Например, на момент написания данного текста описанная выше команда по установке clang для Ubuntu 20.04 по-умолчанию устанавливает clang-13, с которым возникает эта ошибка. Для решения проблемы можно установить clang-12 с помощью команд:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oud afval.

@alexey-milovidov
Copy link
Member Author

For some reason it started to require "startup files" for shared linking, like crtbeginS.o in cross-builds.

@azat
Copy link
Collaborator

azat commented Feb 20, 2022

@alexey-milovidov let's also update debian/control

clang-13,
llvm-13,
lld-13,

For those, who are building using dpkg-buildpackage w/o your packager wrapper.

@nickitat
Copy link
Member

I faced an issue with dwarf parsing after switching to clang-14.
maybe we should add "-gdwarf-4" as a quick fix (it worked for me)? some details.

@azat
Copy link
Collaborator

azat commented Feb 21, 2022

maybe we should add "-gdwarf-4" as a quick fix (it worked for me)? some details.

@nickitat FYI #34777 had been just merged.

@nickitat
Copy link
Member

yeah, i was late to the party )

@robot-clickhouse robot-clickhouse added the submodule changed At least one submodule changed in this PR. label Apr 7, 2022
@alexey-milovidov
Copy link
Member Author

Now I need to fix clang-tidy report.

@robot-clickhouse robot-clickhouse removed the submodule changed At least one submodule changed in this PR. label Apr 15, 2022
@alexey-milovidov
Copy link
Member Author

azat added a commit to azat/ClickHouse that referenced this pull request May 24, 2022
This should fix DWARF version for ASM sources (from ClickHouse#34754):

    $ llvm-dwarfdump -r 1 clickhouse | grep Compile -A10 | grep -A10 'version = 0x0005'
    ...
    --
    0x1de11022: Compile Unit: length = 0x000000e7, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x551dc0, addr_size = 0x08 (next unit at 0x1de1110d)

    0x1de1102e: DW_TAG_compile_unit
                  DW_AT_stmt_list   (0x057e3442)
                  DW_AT_low_pc      (0x00000000101cde0c)
                  DW_AT_high_pc     (0x00000000101cde5e)
                  DW_AT_name        ("/ClickHouse/contrib/libunwind/src/UnwindRegistersSave.S")
                  DW_AT_comp_dir    ("/fasttest-workspace/build")
                  DW_AT_producer    ("Ubuntu clang version 14.0.1-++20220426083040+0e27d08cdeb3-1~exp1~20220426083051.129")
                  DW_AT_language    (DW_LANG_Mips_Assembler)
    ...

Follow-up for: ClickHouse#34777 (cc @alexey-milovidov)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@alexey-milovidov alexey-milovidov self-assigned this Jun 3, 2022
@alexey-milovidov alexey-milovidov merged commit 1529d47 into master Jun 3, 2022
@alexey-milovidov alexey-milovidov deleted the llvm-14 branch June 3, 2022 11:07
@azat azat mentioned this pull request Sep 11, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-build Pull request with build/testing/packaging improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch CI builds to clang-14
7 participants