Skip to content

Commit

Permalink
update: upgrade clang to 18.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
edimetia3d committed May 27, 2024
1 parent b7c1270 commit 17938db
Show file tree
Hide file tree
Showing 13 changed files with 2,492 additions and 1,130 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ venv
build
dist
*.egg-info
*.so
*.so
llvm_cache
19 changes: 19 additions & 0 deletions _build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function repair_wheel {
fi
}

# build llvm
bash /io/build_llvm.sh

# Compile wheels
rm -rf /io/wheelhouse/*
mkdir -p /io/wheelhouse/
Expand All @@ -25,3 +28,19 @@ done
for whl in ~/src/wheelhouse/*.whl; do
repair_wheel "$whl"
done

# build stub
PYTHON3=/opt/python/cp311-cp311/bin/python3
pushd ~/src/stubs
$PYTHON3 -m venv stub_build_venv
source stub_build_venv/bin/activate
$PYTHON3 -m pip install --upgrade build setuptools wheel
$PYTHON3 -m pip install ../ --upgrade
$PYTHON3 -m pip install pybind11-stubgen --upgrade
/opt/python/cp311-cp311/bin/pybind11-stubgen pylibclang._C -o $PWD/tmp --ignore-unresolved-names capsule
mv tmp/pylibclang/* pylibclang-stubs/
rm -rf tmp
$PYTHON3 -m build --no-isolation
cp ./dist/* /io/wheelhouse/
deactivate
popd
5 changes: 1 addition & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ PLAT=manylinux_2_28_x86_64
DOCKER_IMAGE="quay.io/pypa/${PLAT}"
docker pull $DOCKER_IMAGE
docker run --rm -i -e PLAT=${PLAT} -v `pwd`:/io $DOCKER_IMAGE bash /io/_build_wheels.sh
python3 -m pip install --upgrade build twine
python3 -m build -o ./wheelhouse --sdist
bash ./stubs/build.sh
cp ./stubs/dist/* ./wheelhouse


if [ "$1" = "upload" ];
then
Expand Down
25 changes: 25 additions & 0 deletions build_llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $SCRIPT_DIR

BUILD_DIR=$SCRIPT_DIR/llvm_cache/build
INSTALL_DIR=$SCRIPT_DIR/llvm_cache/install


mkdir -p $BUILD_DIR
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR

pushd $SCRIPT_DIR/llvm_cache/llvm-project-llvmorg-*
cmake llvm \
-B $BUILD_DIR \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=Release
popd

pushd $BUILD_DIR
cmake --build . --target install-libclang --parallel 8
popd
Loading

0 comments on commit 17938db

Please sign in to comment.