a few type fixes (#172) #1296
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build on platforms | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
debian: | |
strategy: | |
matrix: | |
version: ["trixie", "sid"] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Debian ${{ matrix.version }} | |
run: | | |
sudo apt purge -y podman | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update | |
sudo apt-get -y install podman | |
podman --version | |
DOCKER_BUILDKIT=1 docker build --network=host --file docker/Dockerfile.debian${{ matrix.version }} --output out . | |
unzip out/mesonlsp-debian-static.zip | |
sudo cp mesonlsp / | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-debian-${{ matrix.version }}-x86_64-unknown-linux-gnu | |
path: /mesonlsp | |
alpine: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Alpine | |
run: | | |
sudo apt purge -y podman | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update | |
sudo apt-get -y install podman | |
podman --version | |
DOCKER_BUILDKIT=1 docker build --network=host --file Dockerfile --output out . | |
yes | unzip out/mesonlsp-alpine-static.zip | |
sudo cp mesonlsp / | |
sudo cp mesonlint / | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-x86_64-unknown-linux-musl | |
path: /mesonlsp | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlint-x86_64-unknown-linux-musl | |
path: /mesonlint | |
alpine-aarch64: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Alpine | |
run: | | |
sudo apt purge -y podman | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update | |
sudo apt-get -y install podman qemu-user-static | |
podman --version | |
DOCKER_BUILDKIT=1 docker build --platform linux/arm64 --network=host --file Dockerfile --output out . | |
yes | unzip out/mesonlsp-alpine-static.zip | |
sudo cp mesonlsp / | |
sudo cp mesonlint / | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-aarch64-unknown-linux-musl | |
path: /mesonlsp | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlint-aarch64-unknown-linux-musl | |
path: /mesonlint | |
windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0 | |
with: | |
cache: true | |
path-type: inherit | |
msystem: MINGW64 | |
pacboy: >- | |
gcc:p | |
curl:p | |
libarchive:p | |
meson:p | |
ninja:p | |
crt:p | |
dlfcn:p | |
libunwind:p | |
python:p | |
python-pip:p | |
python-mingw-ldd:p | |
- name: Build on Windows | |
run: | | |
pip install pygls lsprotocol | |
meson setup _build -Doptimization=3 -Ddebug=true -Db_lto=true | |
ninja -C _build | |
sed -i "1i import sys" /d/a/_temp/msys64/mingw64/lib/python3.12/site-packages/pygls/client.py | |
sed -i "s/stderr=asyncio.subprocess.PIPE/stderr=sys.stderr/g" /d/a/_temp/msys64/mingw64/lib/python3.12/site-packages/pygls/client.py | |
ninja -C _build test || (cat _build/meson-logs/testlog.txt && exit 1) | |
cat _build/meson-logs/testlog.txt | |
_build/tests/libcxathrow/cxathrowtest.exe | |
strings _build/src/mesonlsp.exe|grep \\.dll$ | |
(find /d/ | grep "libarchive-13.dll") || true | |
mingw-ldd.exe _build/src/mesonlsp.exe --output-format per-dep-list --dll-lookup-dirs /d/a/_temp/msys64/mingw64/bin/ | |
mkdir -p /d/Artifacts | |
cp _build/src/mesonlsp.exe /d/Artifacts | |
cp $(mingw-ldd.exe _build/src/mesonlsp.exe --output-format per-dep-list --dll-lookup-dirs /d/a/_temp/msys64/mingw64/bin/ |& grep "=>"|sed s/.*=\>.//g|sort -u|grep -v not.found) /d/Artifacts | |
ls /d/Artifacts | |
(find /d/ | grep "mesonlsp.exe") || true | |
./scripts/create_license_file.sh | |
cp 3rdparty.txt /d/Artifacts | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-x86_64-pc-windows-gnu | |
path: D:/Artifacts | |
macos: | |
strategy: | |
matrix: | |
id: | |
[ | |
{ version: 13, triple: "x86_64-apple-darwin" }, | |
{ version: 14, triple: "aarch64-apple-darwin" }, | |
] | |
runs-on: macos-${{ matrix.id.version }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on macOS ${{ matrix.id.version }} | |
run: | | |
brew unlink pkg-config | |
brew link --overwrite python@3.12 || true | |
brew install zip google-benchmark libarchive pkg-config pkgconf fmt zstd bzip2 libiconv expat xz lz4 zlib subversion mercurial || true | |
svn --version | |
hg --version | |
python3 -m pip install --break-system-packages meson ninja pygls lsprotocol | |
mkdir libs | |
sudo cp $(brew --prefix)/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.a libs | |
ls libs | |
export LDFLAGS="-L$PWD/libs" | |
export CPPFLAGS="-I$(brew --prefix)/opt/libarchive/include -I$(brew --prefix)/opt/zstd/include -I$(brew --prefix)/opt/bzip2/include -I$(brew --prefix)/opt/expat/include -I$(brew --prefix)/opt/zlib/include -I$(brew --prefix)/opt/bzip2/include -I$(brew --prefix)/opt/expat/include -I$(brew --prefix)/opt/zlib/include" | |
export PKG_CONFIG_PATH="$(brew --prefix)/opt/zstd/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/opt/expat/lib/pkgconfig:$(brew --prefix)/opt/zlib/lib/pkgconfig:$(brew --prefix)/opt/expat/lib/pkgconfig:$(brew --prefix)/opt/zlib/lib/pkgconfig" | |
sudo rm $(brew --prefix)/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.dylib || sudo rm /opt/homebrew/opt/{libarchive,zstd,zlib,expat,xz,lz4,libb2}/lib/*.dylib | |
brew link --overwrite pkg-config | |
export PATH="/opt/homebrew/opt/libarchive/bin:$PATH" | |
meson setup _build -Doptimization=3 -Ddebug=true -Db_lto=true --default-library=static --prefer-static | |
ninja -C _build | |
for i in {0..10}; do ninja -C _build test; done | |
otool -L _build/src/mesonlsp | |
cp _build/src/mesonlsp ${{ github.workspace }}/mesonlsp | |
_build/tests/libcxathrow/cxathrowtest | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-${{ matrix.id.triple }} | |
path: ${{ github.workspace }}/mesonlsp | |
sanitizers: | |
strategy: | |
matrix: | |
buildtype: [debug, plain, release] | |
sanitizer: ["address", "undefined", "leak", "address,undefined"] | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:39 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Fedora 39 | |
run: | | |
sudo dnf install libasan* libhwasan* liblsan* libtsan* libubsan* zip ninja-build gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y | |
pip install meson pygls lsprotocol | |
sudo dnf clean all | |
meson setup _clang --buildtype ${{ matrix.buildtype }} -Db_sanitize=${{ matrix.sanitizer }} | |
cd _clang | |
ninja | |
meson test "mesonlsp:" || cat /__w/mesonlsp/mesonlsp/_clang/meson-logs/testlog.txt | |
cd .. | |
./_clang/src/mesonlsp --full | |
./_clang/src/lint/mesonlint --fix | |
./scripts/run_regression_tests.sh | |
for i in $(find __regressions|grep meson.build$|shuf|head -n 90); do echo $i; ./_clang/src/libparsing/lexingtool $i 2>/dev/null || ./_clang/src/libparsing/lexingtool $i; done | |
for i in $(find __regressions|grep meson.build$|shuf|head -n 90); do echo $i; ./_clang/src/libparsing/parsingtool $i 2>/dev/null || ./_clang/src/libparsing/parsingtool $i; done | |
fedora_in_container: | |
strategy: | |
matrix: | |
version: [39, 40] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:${{ matrix.version }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Fedora ${{ matrix.version }} | |
run: | | |
sudo dnf install zip ninja-build gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y | |
pip install meson pygls lsprotocol | |
sudo dnf clean all | |
./scripts/ci_create_zip.sh Fedora${{ matrix.version }} -j$(nproc) | |
unzip -o /Fedora${{ matrix.version }}.zip | |
sudo cp mesonlsp / | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-fedora-${{ matrix.version }} | |
path: /mesonlsp | |
fedora_in_container_clang: | |
strategy: | |
matrix: | |
version: [39, 40] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:${{ matrix.version }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build on Fedora ${{ matrix.version }} | |
run: | | |
sudo dnf install zip ninja-build clang gcc g++ git pip libcurl-devel google-benchmark-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config mercurial subversion -y | |
pip install meson pygls lsprotocol | |
sudo dnf clean all | |
export CC=clang | |
export CXX=clang++ | |
./scripts/ci_create_zip.sh Fedora${{ matrix.version }}-clang -j1 | |
unzip -o /Fedora${{ matrix.version }}-clang.zip | |
sudo cp mesonlsp / | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: mesonlsp-fedora-${{ matrix.version }}-clang | |
path: /mesonlsp |