Skip to content

Commit

Permalink
Merge branch 'xcfa-refactor' into por/dpor
Browse files Browse the repository at this point in the history
# Conflicts:
#	subprojects/xcfa/xcfa-analysis/src/main/java/hu/bme/mit/theta/xcfa/analysis/por/XcfaDporLts.kt
  • Loading branch information
csanadtelbisz committed Sep 1, 2023
2 parents 3ed48a0 + 274e775 commit 1064119
Show file tree
Hide file tree
Showing 554 changed files with 15,948 additions and 10,252 deletions.
4 changes: 3 additions & 1 deletion .github/actions/badge-creation/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ runs:
path: ${{ inputs.path }}/badge.svg
- name: setup rsync for windows
if: runner.os == 'Windows'
uses: GuillaumeFalourd/setup-rsync@2b503a403f7185e6872bbc56f903d7395ddd75a2
shell: bash
run: |
choco install -y rsync
- name: Deploy badges
if: github.ref == 'refs/heads/master' && always() && github.event_name != 'pull_request'
uses: leventeBajczi/github-pages-deploy-action-winfix@6d31a3c68a3912555731864c0d5ef4239b02369d # v0.3
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/install-llvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Install LLVM'
inputs:
version:
required: true

runs:
using: "composite"
steps:
- name: Run install script
shell: bash
run: |
# wget https://apt.llvm.org/llvm.sh
# chmod +x llvm.sh
sudo $GITHUB_ACTION_PATH/llvm.sh ${{ inputs.version }}
sudo ln -sf $(which clang-${{inputs.version}}) /usr/bin/clang
sudo ln -sf $(which llvm-config-${{inputs.version}}) /usr/bin/llvm-config
- name: Test version
shell: bash
run: |
ls -l $(which clang)
ls -l $(which llvm-config)
clang --version
llvm-config --version
175 changes: 175 additions & 0 deletions .github/actions/install-llvm/llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#!/bin/bash
################################################################################
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
################################################################################
#
# This script will install the llvm toolchain on the different
# Debian and Ubuntu versions

set -eux

usage() {
set +x
echo "Usage: $0 [llvm_major_version] [all] [OPTIONS]" 1>&2
echo -e "all\t\t\tInstall all packages." 1>&2
echo -e "-n=code_name\t\tSpecifies the distro codename, for example bionic" 1>&2
echo -e "-h\t\t\tPrints this help." 1>&2
echo -e "-m=repo_base_url\tSpecifies the base URL from which to download." 1>&2
exit 1;
}

CURRENT_LLVM_STABLE=16
BASE_URL="http://apt.llvm.org"

# Check for required tools
needed_binaries=(lsb_release wget add-apt-repository gpg)
missing_binaries=()
for binary in "${needed_binaries[@]}"; do
if ! which $binary &>/dev/null ; then
missing_binaries+=($binary)
fi
done
if [[ ${#missing_binaries[@]} -gt 0 ]] ; then
echo "You are missing some tools this script requires: ${missing_binaries[@]}"
echo "(hint: apt install lsb-release wget software-properties-common gnupg)"
exit 4
fi

# Set default values for commandline arguments
# We default to the current stable branch of LLVM
LLVM_VERSION=$CURRENT_LLVM_STABLE
ALL=0
DISTRO=$(lsb_release -is)
VERSION=$(lsb_release -sr)
UBUNTU_CODENAME=""
CODENAME_FROM_ARGUMENTS=""
# Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives)
source /etc/os-release
DISTRO=${DISTRO,,}
case ${DISTRO} in
debian)
# Debian Trixie has a workaround because of
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038383
if [[ "${VERSION}" == "unstable" ]] || [[ "${VERSION}" == "testing" ]] || [[ "${VERSION_CODENAME}" == "trixie" ]]; then
CODENAME=unstable
LINKNAME=
else
# "stable" Debian release
CODENAME=${VERSION_CODENAME}
LINKNAME=-${CODENAME}
fi
;;
*)
# ubuntu and its derivatives
if [[ -n "${UBUNTU_CODENAME}" ]]; then
CODENAME=${UBUNTU_CODENAME}
if [[ -n "${CODENAME}" ]]; then
LINKNAME=-${CODENAME}
fi
fi
;;
esac

# read optional command line arguments
if [ "$#" -ge 1 ] && [ "${1::1}" != "-" ]; then
if [ "$1" != "all" ]; then
LLVM_VERSION=$1
else
# special case for ./llvm.sh all
ALL=1
fi
OPTIND=2
if [ "$#" -ge 2 ]; then
if [ "$2" == "all" ]; then
# Install all packages
ALL=1
OPTIND=3
fi
fi
fi

while getopts ":hm:n:" arg; do
case $arg in
h)
usage
;;
m)
BASE_URL=${OPTARG}
;;
n)
CODENAME=${OPTARG}
if [[ "${CODENAME}" == "unstable" ]]; then
# link name does not apply to unstable repository
LINKNAME=
else
LINKNAME=-${CODENAME}
fi
CODENAME_FROM_ARGUMENTS="true"
;;
esac
done

if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root!"
exit 1
fi

declare -A LLVM_VERSION_PATTERNS
LLVM_VERSION_PATTERNS[9]="-9"
LLVM_VERSION_PATTERNS[10]="-10"
LLVM_VERSION_PATTERNS[11]="-11"
LLVM_VERSION_PATTERNS[12]="-12"
LLVM_VERSION_PATTERNS[13]="-13"
LLVM_VERSION_PATTERNS[14]="-14"
LLVM_VERSION_PATTERNS[15]="-15"
LLVM_VERSION_PATTERNS[16]="-16"
LLVM_VERSION_PATTERNS[17]=""

if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then
echo "This script does not support LLVM version $LLVM_VERSION"
exit 3
fi

LLVM_VERSION_STRING=${LLVM_VERSION_PATTERNS[$LLVM_VERSION]}

# join the repository name
if [[ -n "${CODENAME}" ]]; then
REPO_NAME="deb ${BASE_URL}/${CODENAME}/ llvm-toolchain${LINKNAME}${LLVM_VERSION_STRING} main"

# check if the repository exists for the distro and version
if ! wget -q --method=HEAD ${BASE_URL}/${CODENAME} &> /dev/null; then
if [[ -n "${CODENAME_FROM_ARGUMENTS}" ]]; then
echo "Specified codename '${CODENAME}' is not supported by this script."
else
echo "Distribution '${DISTRO}' in version '${VERSION}' is not supported by this script."
fi
exit 2
fi
fi


# install everything

if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then
# download GPG key once
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
fi

if [[ -z "`apt-key list 2> /dev/null | grep -i llvm`" ]]; then
# Delete the key in the old format
apt-key del AF4F7421
fi
add-apt-repository "${REPO_NAME}"
apt-get update
PKG="clang-$LLVM_VERSION" # lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION"
if [[ $ALL -eq 1 ]]; then
# same as in test-install.sh
# No worries if we have dups
PKG="$PKG clang-tidy-$LLVM_VERSION clang-format-$LLVM_VERSION clang-tools-$LLVM_VERSION llvm-$LLVM_VERSION-dev lld-$LLVM_VERSION lldb-$LLVM_VERSION llvm-$LLVM_VERSION-tools libomp-$LLVM_VERSION-dev libc++-$LLVM_VERSION-dev libc++abi-$LLVM_VERSION-dev libclang-common-$LLVM_VERSION-dev libclang-$LLVM_VERSION-dev libclang-cpp$LLVM_VERSION-dev libunwind-$LLVM_VERSION-dev"
if test $LLVM_VERSION -gt 14; then
PKG="$PKG libclang-rt-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev"
fi
fi
apt-get install -y $PKG
4 changes: 4 additions & 0 deletions .github/workflows/linux-build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install LLVM and Clang
uses: ./.github/actions/install-llvm
with:
version: "15"
- name: Run tests
uses: ./.github/actions/test-action
- name: Positive outcome badge
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: Install LLVM and Clang
uses: ./.github/actions/install-llvm
with:
version: "15"
- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tasks {
}

val reportTasks = subprojects.mapNotNull { subproject ->
subproject.tasks.named("jacocoTestReport", JacocoReport::class).orNull
subproject.tasks.findByName("jacocoTestReport")?.let { it as JacocoReport }
}

dependsOn(reportTasks.flatMap { it.dependsOn })
Expand Down
6 changes: 5 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.FileOutputStream
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand Down Expand Up @@ -90,6 +89,11 @@ fun generateVersionsSource(): String {
}

tasks {
withType<KotlinCompile>() {
kotlinOptions {
jvmTarget = "17"
}
}
val generateVersions by creating {
description = "Updates Versions.kt from project properties."
group = "build"
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/antlr-grammar.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.nio.file.Files

apply<AntlrPlugin>()

Expand Down
17 changes: 17 additions & 0 deletions buildSrc/src/main/kotlin/kotlin-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,21 @@ tasks {
jvmTarget = "17"
}
}
}

// Check if "antlr-common" plugin is applied and if the "generateGrammarSource" task is available
// If yes, add a task dependency from "compileKotlin" to "generateGrammarSource"
project.plugins.withType<AntlrPlugin> {
val generateGrammarTask = tasks.findByName("generateGrammarSource")
if (generateGrammarTask != null) {
project.tasks.named("compileKotlin").configure {
dependsOn(generateGrammarTask)
}
}
val generateTestGrammarTask = tasks.findByName("generateTestGrammarSource")
if (generateTestGrammarTask != null) {
project.tasks.named("compileTestKotlin").configure {
dependsOn(generateTestGrammarTask)
}
}
}
69 changes: 0 additions & 69 deletions doc/wiki/docs/Formalisms/sts/sts/aiger/AigerCoiTest.java

This file was deleted.

Loading

0 comments on commit 1064119

Please sign in to comment.