From 3f98002a66f18a5c09856c5e66a6c1e48b0ee1a9 Mon Sep 17 00:00:00 2001 From: lekcyjna123 <34948061+lekcyjna123@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:08:04 +0100 Subject: [PATCH] Drop python2 usage (#158) * Remove python2 references from SymCC --------- Co-authored-by: Lekcyjna <309016@uwr.edu.pl> Co-authored-by: aurelf --- .github/workflows/run_tests.yml | 2 -- Dockerfile | 1 - README.md | 2 +- runtime/qsym_backend/CMakeLists.txt | 22 ++-------------------- runtime/qsym_backend/qsym | 2 +- util/quicktest.sh | 2 +- 6 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index e3666317..8eb6533b 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -30,7 +30,6 @@ jobs: sudo apt-get install -y \ llvm-${{ matrix.llvm_version }}-dev \ libz3-dev \ - python2 - name: Build SymCC with the QSYM backend run: | mkdir build @@ -64,7 +63,6 @@ jobs: sudo apt-get install -y \ llvm-${{ matrix.llvm_version }}-dev \ libz3-dev \ - python2 - name: Build SymCC with the QSYM backend run: | mkdir build diff --git a/Dockerfile b/Dockerfile index 5d93d01d..ca7c871b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,6 @@ RUN apt-get update \ llvm-15-dev \ llvm-15-tools \ ninja-build \ - python2 \ python3-pip \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 41779957..5a6afede 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Under Ubuntu Groovy the following one liner should install all required packages: ``` -sudo apt install -y git cargo clang-14 cmake g++ git libz3-dev llvm-14-dev llvm-14-tools ninja-build python2 python3-pip zlib1g-dev && sudo pip3 install lit +sudo apt install -y git cargo clang-14 cmake g++ git libz3-dev llvm-14-dev llvm-14-tools ninja-build python3-pip zlib1g-dev && sudo pip3 install lit ``` Alternatively, see below for using the provided Dockerfile, or the file diff --git a/runtime/qsym_backend/CMakeLists.txt b/runtime/qsym_backend/CMakeLists.txt index 34c01320..3df23d26 100644 --- a/runtime/qsym_backend/CMakeLists.txt +++ b/runtime/qsym_backend/CMakeLists.txt @@ -17,24 +17,6 @@ set(QSYM_SOURCE_DIR "qsym/qsym/pintool") -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/expr__gen.cpp - COMMAND python2 gen_expr.py ${CMAKE_CURRENT_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${QSYM_SOURCE_DIR}/codegen - COMMENT "Generating Qsym's expr__gen.cpp" - VERBATIM - DEPENDS - ${QSYM_SOURCE_DIR}/codegen/expr.cpp - ${QSYM_SOURCE_DIR}/codegen/gen_expr.py) - -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/expr_builder__gen.cpp - COMMAND python2 gen_expr_builder.py ${CMAKE_CURRENT_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${QSYM_SOURCE_DIR}/codegen - COMMENT "Generating Qsym's expr__gen.cpp" - VERBATIM - DEPENDS - ${QSYM_SOURCE_DIR}/codegen/expr_builder.cpp - ${QSYM_SOURCE_DIR}/codegen/gen_expr_builder.py) - find_package(LLVM REQUIRED CONFIG) add_definitions(${LLVM_DEFINITIONS}) include_directories(SYSTEM ${LLVM_INCLUDE_DIRS}) @@ -57,8 +39,8 @@ configure CMake with -DZ3_TRUST_SYSTEM_VERSION=on (see also docs/Configuration.t endif() add_library(SymRuntime SHARED - ${CMAKE_CURRENT_BINARY_DIR}/expr__gen.cpp - ${CMAKE_CURRENT_BINARY_DIR}/expr_builder__gen.cpp + ${QSYM_SOURCE_DIR}/expr.cpp + ${QSYM_SOURCE_DIR}/expr_builder.cpp ${QSYM_SOURCE_DIR}/expr_cache.cpp ${QSYM_SOURCE_DIR}/expr_evaluate.cpp ${QSYM_SOURCE_DIR}/solver.cpp diff --git a/runtime/qsym_backend/qsym b/runtime/qsym_backend/qsym index fd5e08ea..ccd2f41f 160000 --- a/runtime/qsym_backend/qsym +++ b/runtime/qsym_backend/qsym @@ -1 +1 @@ -Subproject commit fd5e08eaea764af9a2e2c8bfefead8b23c2a3c5f +Subproject commit ccd2f41f2efb1b0517b83458c181e060497fa589 diff --git a/util/quicktest.sh b/util/quicktest.sh index 020a37f0..aead0f98 100755 --- a/util/quicktest.sh +++ b/util/quicktest.sh @@ -19,7 +19,7 @@ sudo apt-get update sudo apt-get upgrade -y # install requirements -sudo apt-get install -y git cargo clang-10 cmake g++ git libz3-dev llvm-10-dev llvm-10-tools ninja-build python2 python3-pip zlib1g-dev +sudo apt-get install -y git cargo clang-10 cmake g++ git libz3-dev llvm-10-dev llvm-10-tools ninja-build python3-pip zlib1g-dev sudo pip3 install lit # Clone project