Skip to content

Commit

Permalink
Clang 11.0.0 (#1)
Browse files Browse the repository at this point in the history
* Upgrade to llvm-11.0.0.

Signed-off-by: Tao He <[email protected]>

* Fixes for ENV on Windows.

* Fixes for ENV on Windows.

* Fixes artifacts uploading.

* Update doc tags.

* Add readme.md to long description.

* Resolve soft links before packing artifacts.
  • Loading branch information
sighingnow authored Oct 24, 2020
1 parent cd10f77 commit 381fbf5
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 53 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/libclang-linux-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: libclang-linux-amd64

on: [push, pull_request]

env:
LLVM_VER: 11.0.0

jobs:
build-and-deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
Expand All @@ -10,27 +13,24 @@ jobs:
- uses: actions/checkout@v2
- name: get llvm-project
run: |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz
tar xf llvm-project-10.0.1.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VER/llvm-project-$LLVM_VER.tar.xz
tar xf llvm-project-$LLVM_VER.tar.xz
- name: make build directory
run: mkdir -p llvm-project-10.0.1/build
run: mkdir -p llvm-project-$LLVM_VER/build
- name: cmake
run: cd llvm-project-10.0.1/build && cmake ../llvm -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -DNDEBUG -static-libgcc -static-libstdc++ -s" -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8
run: cd llvm-project-$LLVM_VER/build && cmake ../llvm -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -DNDEBUG -static-libgcc -static-libstdc++ -s" -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8
- name: build
run: cd llvm-project-10.0.1/build && make libclang -j$(nproc)
run: cd llvm-project-$LLVM_VER/build && make libclang -j$(nproc)
- name: print dependencies
run: ldd llvm-project-10.0.1/build/lib/libclang.so
- name: rename output binary
run: |
cd llvm-project-10.0.1/build/lib
mv libclang.so libclang.so.10.linux-amd64
run: ldd llvm-project-$LLVM_VER/build/lib/libclang.so
- name: create and print sha512sum
run: |
cd llvm-project-10.0.1/build/lib
sha512sum libclang.so.10.linux-amd64 > libclang.so.10.linux-amd64.sha512sum
cd llvm-project-$LLVM_VER/build/lib
sha512sum libclang.so > libclang.so.$LLVM_VER.linux-amd64.sha512sum
echo "Checksum is: "
cat libclang.so.10.linux-amd64.sha512sum
cat libclang.so.$LLVM_VER.linux-amd64.sha512sum
tar zcvfh libclang.so.$LLVM_VER.linux-amd64.tar.gz libclang.so libclang.so.$LLVM_VER.linux-amd64.sha512sum
- uses: actions/upload-artifact@v2
with:
name: libclang.so.10.linux-amd64
path: llvm-project-10.0.1/build/lib/libclang.so.10.linux-amd64
name: libclang.so.${{env.LLVM_VER}}.linux-amd64.tar.gz
path: llvm-project-${{env.LLVM_VER}}/build/lib/libclang.so.${{env.LLVM_VER}}.linux-amd64.tar.gz
30 changes: 15 additions & 15 deletions .github/workflows/libclang-macosx-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: libclang-macosx-amd64

on: [push, pull_request]

env:
LLVM_VER: 11.0.0

jobs:
build-and-deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
Expand All @@ -10,27 +13,24 @@ jobs:
- uses: actions/checkout@v2
- name: get llvm-project
run: |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz
tar xf llvm-project-10.0.1.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VER/llvm-project-$LLVM_VER.tar.xz
tar xf llvm-project-$LLVM_VER.tar.xz
- name: make build directory
run: mkdir -p llvm-project-10.0.1/build
run: mkdir -p llvm-project-$LLVM_VER/build
- name: cmake
run: cd llvm-project-10.0.1/build && cmake ../llvm -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -s -DNDEBUG -static-libgcc -static-libstdc++" -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
run: cd llvm-project-$LLVM_VER/build && cmake ../llvm -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -s -DNDEBUG -static-libgcc -static-libstdc++" -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
- name: build
run: cd llvm-project-10.0.1/build && make libclang -j$(sysctl -n hw.ncpu)
run: cd llvm-project-$LLVM_VER/build && make libclang -j$(sysctl -n hw.ncpu)
- name: print dependencies
run: otool -L llvm-project-10.0.1/build/lib/libclang.dylib
- name: rename output binary
run: |
cd llvm-project-10.0.1/build/lib
mv libclang.dylib libclang.dylib.10.macosx-amd64
run: otool -L llvm-project-$LLVM_VER/build/lib/libclang.dylib
- name: create and print sha512sum
run: |
cd llvm-project-10.0.1/build/lib
shasum -a512 libclang.dylib.10.macosx-amd64 > libclang.dylib.10.macosx-amd64.sha512sum
cd llvm-project-$LLVM_VER/build/lib
shasum -a512 libclang.dylib > libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
echo "Checksum is: "
cat libclang.dylib.10.macosx-amd64.sha512sum
cat libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
tar zcvf libclang.dylib.$LLVM_VER.macosx-amd64.tar.gz libclang.dylib libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
- uses: actions/upload-artifact@v2
with:
name: libclang.dylib.10.macosx-amd64
path: llvm-project-10.0.1/build/lib/libclang.dylib.10.macosx-amd64
name: libclang.dylib.${{env.LLVM_VER}}.macosx-amd64.tar.gz
path: llvm-project-${{env.LLVM_VER}}/build/lib/libclang.dylib.${{env.LLVM_VER}}.macosx-amd64.tar.gz
27 changes: 14 additions & 13 deletions .github/workflows/libclang-windows-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: libclang-windows-amd64

on: [push, pull_request]

env:
LLVM_VER: 11.0.0

jobs:
build-and-deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
Expand All @@ -11,26 +14,24 @@ jobs:
- name: get llvm-project
run: |
choco install wget
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_VER/llvm-project-$env:LLVM_VER.tar.xz
$env:Path = "C:\Program Files\Git\usr\bin;$env:Path"
tar xf llvm-project-10.0.1.tar.xz --exclude=llvm-project-10.0.1/clang/test/Driver/Inputs* --exclude=llvm-project-10.0.1/libclc/amdgcn-mesa3d --exclude=llvm-project-10.0.1/libcxx/test/std/input.output/filesystems/Inputs/static_test_env/*
tar xf llvm-project-$env:LLVM_VER.tar.xz --exclude=llvm-project-$env:LLVM_VER/clang/test/Driver/Inputs* --exclude=llvm-project-$env:LLVM_VER/libclc/amdgcn-mesa3d --exclude=llvm-project-$env:LLVM_VER/libcxx/test/std/input.output/filesystems/Inputs/static_test_env/*
- name: make build directory
run: mkdir -p llvm-project-10.0.1/build
run: mkdir -p llvm-project-$env:LLVM_VER/build
- name: cmake
run: cd llvm-project-10.0.1/build && cmake ../llvm -Thost=x64 -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_CXX_FLAGS="/MP" -DLLVM_USE_CRT_MINSIZEREL="MT"
run: cd llvm-project-$env:LLVM_VER/build && cmake ../llvm -Thost=x64 -DLLVM_ENABLE_PROJECTS=clang -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_CXX_FLAGS="/MP" -DLLVM_USE_CRT_MINSIZEREL="MT"
- name: build
run: cd llvm-project-10.0.1/build && cmake --build . --config MinSizeRel --target libclang
- name: rename output binary
run: |
mv llvm-project-10.0.1\build\MinSizeRel\bin\libclang.dll llvm-project-10.0.1\build\MinSizeRel\bin\libclang.dll.10.windows-amd64
run: cd llvm-project-$env:LLVM_VER/build && cmake --build . --config MinSizeRel --target libclang
- name: create and print sha512sum
run: |
$env:Path = "C:\Program Files\Git\usr\bin;$env:Path"
cd llvm-project-10.0.1\build\MinSizeRel\bin
sha512sum.exe libclang.dll.10.windows-amd64 > libclang.dll.10.windows-amd64.sha512sum
cd llvm-project-$env:LLVM_VER\build\MinSizeRel\bin
sha512sum.exe libclang.dll > libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum
echo "Checksum is: "
Get-Content -Path libclang.dll.10.windows-amd64.sha512sum
Get-Content -Path libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum
tar zcvf libclang.dll.$env:LLVM_VER.windows-amd64.tar.gz libclang.dll libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum
- uses: actions/upload-artifact@v2
with:
name: libclang.dll.10.windows-amd64
path: llvm-project-10.0.1\build\MinSizeRel\bin\libclang.dll.10.windows-amd64
name: libclang.dll.${{env.LLVM_VER}}.windows-amd64.tar.gz
path: llvm-project-${{env.LLVM_VER}}\build\MinSizeRel\bin\libclang.dll.${{env.LLVM_VER}}.windows-amd64.tar.gz
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = '10.0.1'
version = '11.0.0'
# The full version, including alpha/beta/rc tags.
release = '10.0.1'
release = '11.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:Date: 2020-08-07
:Version: 10.0.1
:Date: 2020-10-24
:Version: 11.0.0
:Authors: - LLVM Team

.. meta::
Expand Down
1 change: 1 addition & 0 deletions python/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ def __repr__(self):
TypeKind.OCLRESERVEID = TypeKind(160)

TypeKind.EXTVECTOR = TypeKind(176)
TypeKind.ATOMIC = TypeKind(177)

class RefQualifierKind(BaseEnumeration):
"""Describes a specific ref-qualifier of a type."""
Expand Down
2 changes: 1 addition & 1 deletion python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
add_custom_target(check-clang-python
COMMAND ${CMAKE_COMMAND} -E env
CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>
${PYTHON_EXECUTABLE} -m unittest discover
"${Python3_EXECUTABLE}" -m unittest discover
DEPENDS libclang
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)

Expand Down
2 changes: 1 addition & 1 deletion python/tests/cindex/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_diagnostic_children(self):
self.assertRegexpMatches(children[0].spelling,
'.*declared here')
self.assertEqual(children[0].location.line, 1)
self.assertEqual(children[0].location.column, 1)
self.assertEqual(children[0].location.column, 6)

def test_diagnostic_string_repr(self):
tu = get_tu('struct MissingSemicolon{}')
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ def run(self):
self.copy_file(os.path.join(source_dir, libname),
os.path.join(target_dir, libname))

with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md'), encoding='utf-8', mode='r') as fp:
long_description = fp.read()

setup(
name='libclang',
version='10.0.1',
description='Clang Python Bindings.',
long_description='Clang Python Bindings, mirrored from the official LLVM repo: https://github.com/llvm/llvm-project/tree/master/clang/bindings/python, to make the installation process easier.',
version='11.0.0',
description='Clang Python Bindings, mirrored from the official LLVM repo: https://github.com/llvm/llvm-project/tree/master/clang/bindings/python, to make the installation process easier.',
long_description=long_description,
long_description_content_type='text/markdown',
author='Tao He',
author_email='[email protected]',
url='https://github.com/sighingnow/libclang',
Expand Down Expand Up @@ -96,6 +99,7 @@ def run(self):

project_urls={
'Documentation': 'https://libclang.readthedocs.io',
'Source': 'https://github.com/sighingonw/libclang',
'Source': 'https://github.com/sighingnow/libclang',
'Tracker': 'https://github.com/sighingnow/libclang/issues',
},
)

0 comments on commit 381fbf5

Please sign in to comment.