Skip to content

Commit

Permalink
Switch to cpp-linter/clang-tools-static-binaries (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxianpeng authored Jan 9, 2024
1 parent 98e244a commit d5d7b8b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
needs: [build]
strategy:
matrix:
version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17 ]
version: [ 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
27 changes: 14 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,28 +124,29 @@ Supported versions
clang-format
************
.. csv-table::
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7"
:stub-columns: 1

Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️

clang-tidy
**********
.. csv-table::
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7"
:stub-columns: 1

Linux,✔️,❌,❌,❌,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️

Know issues:
.. warning::
All clang-tidy v14+ builds for MacOS are still ~1.7 GB in size.

1. clang-tidy-14, clang-tidy-15 and clang-tidy-16 has Segmentation fault on Ubuntu 22.02.
2. clang-tidy-14, clang-tidy-15, clang-tidy-16, clang-tidy-17 is over 1 GB for MacOSX
------------

Thanks to the project
`clang-tools-static-binaries <https://github.com/muttleyxd/clang-tools-static-binaries>`_
for all the binaries.
`clang-tools-static-binaries <https://github.com/muttleyxd/clang-tools-static-binaries>`_.
We now used the `fork repository <https://github.com/cpp-linter/clang-tools-static-binaries>`_
that fixed the clang-tidy v14+ Segmentation fault (core dumped). see `#56 <https://github.com/cpp-linter/clang-tools-pip/issues/56>`_ for details.
4 changes: 2 additions & 2 deletions clang_tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def is_installed(tool_name: str, version: str) -> Optional[Path]:


def clang_tools_binary_url(
tool: str, version: str, release_tag: str = "master-8f72ab3c"
tool: str, version: str, release_tag: str = "master-be694ee7"
) -> str:
"""Assemble the URL to the binary.
Expand All @@ -74,7 +74,7 @@ def clang_tools_binary_url(
:returns: The URL used to download the specified tool.
"""
base_url = (
"https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/"
"https://github.com/cpp-linter/clang-tools-static-binaries/releases/download/"
+ release_tag
)
download_url = f"{base_url}/{tool}-{version}_{install_os}-amd64{suffix}"
Expand Down
1 change: 1 addition & 0 deletions tests/clang-format-12_linux-amd64.sha512sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d916477bdedd48245b6eedeb8680fcb0665a0145c7b078ddc4ba3f1fbc16eb6b081dc89f41242f228b723a472eb734836d1914178abdd94293a25a9e62eefc11 clang-format-12_linux-amd64
1 change: 1 addition & 0 deletions tests/clang-format-12_macosx-amd64.sha512sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25a5854bf43bc37114d67cd8bbf88dd72da5ca3dc31c61bf0f245aec330eb657cd085344b66285095a257da94425480fee4188e95f98a368998d3632a467f32b clang-format-12_macosx-amd64
1 change: 1 addition & 0 deletions tests/clang-format-12_windows-amd64.sha512sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4b96e93eedcbceafc0dea62cf46a002ba3d2a165215a83fbfe1e2a73d21888a3b36bc7da092fcad38fa56e615d7cb9d375a34eddc642ee08a4a29b836f938762 *clang-format-12_windows-amd64
1 change: 0 additions & 1 deletion tests/clang-query-12_linux-amd64.sha512sum

This file was deleted.

1 change: 0 additions & 1 deletion tests/clang-query-12_macosx-amd64.sha512sum

This file was deleted.

1 change: 0 additions & 1 deletion tests/clang-query-12_windows-amd64.sha512sum

This file was deleted.

8 changes: 4 additions & 4 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def test_check_install_os():


@pytest.mark.parametrize(
"tag", ["master-8f72ab3c", pytest.param("latest", marks=pytest.mark.xfail)]
"tag", ["master-be694ee7", pytest.param("latest", marks=pytest.mark.xfail)]
)
def test_download_file(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, tag: str):
"""Test that deliberately fails to download a file."""
monkeypatch.chdir(str(tmp_path))
url = clang_tools_binary_url("clang-query", "12", release_tag=tag)
url = clang_tools_binary_url("clang-format", "12", release_tag=tag)
file_name = download_file(url, "file.tar.gz", True)
assert file_name is not None

Expand All @@ -27,8 +27,8 @@ def test_get_sha(monkeypatch: pytest.MonkeyPatch):
"""Test the get_sha() function used to fetch the
releases' corresponding SHA512 checksum."""
monkeypatch.chdir(PurePath(__file__).parent.as_posix())
expected = Path(f"clang-query-12_{install_os}-amd64.sha512sum").read_text(
expected = Path(f"clang-format-12_{install_os}-amd64.sha512sum").read_text(
encoding="utf-8"
)
url = clang_tools_binary_url("clang-query", "12", release_tag="master-8f72ab3c")
url = clang_tools_binary_url("clang-format", "12", release_tag="master-be694ee7")
assert get_sha_checksum(url) == expected

0 comments on commit d5d7b8b

Please sign in to comment.