Skip to content

Commit 84b7a43

Browse files
authored
Merge pull request #527 from secure-software-engineering/development
Update `master`
2 parents b45553a + 7b7c8de commit 84b7a43

183 files changed

Lines changed: 1527 additions & 3182 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docker/Dockerfile.devenv

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt -y update && apt -y upgrade && apt install bash -y
4+
RUN DEBIAN_FRONTEND=noninteractive apt -y install wget gpg software-properties-common lsb-release git make python3 python3-pip vim -y
5+
RUN apt -y update && apt -y install cmake clang-14 ninja-build sudo
6+
7+
RUN pip install pre-commit
8+
9+
RUN set -exu; \
10+
useradd -p test -s /bin/bash -m vscode; \
11+
groupadd docker; \
12+
usermod -aG docker vscode; \
13+
usermod -aG sudo vscode;
14+
15+
USER vscode
16+
17+
ENV CC "/usr/bin/clang-14"
18+
ENV CXX "/usr/bin/clang++-14"
19+
ENV PATH "/usr/local/llvm-14/bin:/home/vscode/.local/bin:$PATH"
20+
ENV CMAKE_GENERATOR "Ninja"

.docker/config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dockerfile": "Dockerfile.devenv"
3+
}

.github/workflows/docker.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docker Image
2+
3+
on:
4+
push:
5+
branches: [ development ]
6+
7+
jobs:
8+
push_to_registries:
9+
name: Push Docker image to multiple registries
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v3
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v2
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
# If we want to publish an image of PhASAR to the official docker hub we
22+
# can just use the following code and set the corresponding secrets.
23+
# - name: Log in to Docker Hub
24+
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
# with:
26+
# username: ${{ secrets.DOCKER_USERNAME }}
27+
# password: ${{ secrets.DOCKER_TOKEN }}
28+
29+
- name: Log in to the Container registry
30+
uses: docker/login-action@v2
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@v4
39+
with:
40+
images: ghcr.io/${{ github.repository }}
41+
# here we could add a second image for the official docker registry
42+
# sse/phasar
43+
- name: Build and push Docker images
44+
uses: docker/build-push-action@v3
45+
with:
46+
context: .
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
path = external/googletest
77
url = https://github.com/google/googletest.git
88
branch = master
9-
[submodule "external/WALi-OpenNWA"]
10-
path = external/WALi-OpenNWA
11-
url = https://github.com/pdschubert/WALi-OpenNWA.git
129
[submodule "external/json-schema-validator"]
1310
path = external/json-schema-validator
1411
url = https://github.com/pboettch/json-schema-validator.git

Brewfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
3131
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -g")
3232
else()
3333
message(STATUS "Selected Release Build")
34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -march=native")
34+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe")
3535
endif()
3636

3737
# Enable testing
@@ -243,10 +243,6 @@ if (PHASAR_IN_TREE)
243243
)
244244
endif()
245245

246-
# WALi-OpenNWA
247-
add_subdirectory(external/WALi-OpenNWA)
248-
include_directories(external/WALi-OpenNWA/Source/wali/include)
249-
250246
# Set up clang-tidy to run during PhASAR's compilation to indicate code smells
251247
if (PHASAR_ENABLE_CLANG_TIDY_DURING_BUILD)
252248
message(STATUS "Enabled clang-tidy during build")

Dockerfile

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,61 @@
1-
FROM ubuntu:20.04
2-
ARG LLVM_INSTALL_DIR="/usr/local/llvm-12"
1+
FROM ubuntu:22.04
2+
ARG LLVM_INSTALL_DIR="/usr/local/llvm-14"
33
LABEL Name=phasar Version=1.0.0
44

55
RUN apt -y update && apt install bash sudo -y
66

7+
78
WORKDIR /usr/src/phasar
89
RUN mkdir -p /usr/src/phasar/utils
910

1011
COPY ./utils/InitializeEnvironment.sh /usr/src/phasar/utils/
1112
RUN ./utils/InitializeEnvironment.sh
1213

14+
RUN apt-get -y install --no-install-recommends \
15+
cmake \
16+
ninja-build \
17+
libstdc++6 \
18+
libboost-all-dev
19+
1320
COPY ./utils/InstallAptDependencies.sh /usr/src/phasar/utils/
1421
RUN ./utils/InstallAptDependencies.sh
1522

23+
RUN apt-get update && \
24+
apt-get install -y software-properties-common
25+
26+
RUN apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key && \
27+
add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main' && \
28+
apt-get update && \
29+
apt-get -y install --no-install-recommends \
30+
clang-14 \
31+
llvm-14-dev \
32+
libllvm14 \
33+
libclang-common-14-dev \
34+
libclang-14-dev \
35+
libclang-cpp14-dev \
36+
clang-tidy-14
37+
1638
RUN pip3 install Pygments pyyaml
1739

1840
# installing boost
1941
RUN apt install libboost-all-dev -y
2042

21-
# installing LLVM
22-
COPY utils/safeCommandsSet.sh /usr/src/phasar/utils/safeCommandsSet.sh
23-
COPY utils/install-llvm.sh /usr/src/phasar/utils/install-llvm.sh
24-
RUN ./utils/install-llvm.sh $(nproc) . ${LLVM_INSTALL_DIR} "llvmorg-12.0.0"
2543

2644
# installing wllvm
2745
RUN pip3 install wllvm
2846

29-
ENV CC=${LLVM_INSTALL_DIR}/bin/clang
30-
ENV CXX=${LLVM_INSTALL_DIR}/bin/clang++
31-
ENV LD_LIBRARY_PATH=${LLVM_INSTALL_DIR}/lib:$LD_LIBRARY_PATH
47+
ENV CC=/usr/bin/clang-14
48+
ENV CXX=/usr/bin/clang++-14
3249

3350
COPY . /usr/src/phasar
3451

3552
RUN git submodule init
3653
RUN git submodule update
37-
RUN mkdir -p build && \
38-
cd build && \
39-
cmake -DCMAKE_BUILD_TYPE=Release .. && \
40-
make -j $(nproc) && \
41-
make install && \
42-
ldconfig
54+
RUN mkdir -p build && cd build && \
55+
cmake .. \
56+
-DCMAKE_BUILD_TYPE=Release \
57+
-DCMAKE_CXX_COMPILER=$CXX \
58+
-G Ninja && \
59+
cmake --build .
4360

4461
ENTRYPOINT [ "./build/tools/phasar-llvm/phasar-llvm" ]

LICENSE.txt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -99,36 +99,6 @@ pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
9999
ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
100100
md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
101101

102-
103-
WALi-OpenNWA
104-
-------------------------------------------------------------------------------
105-
OpenNWA portions:
106-
Copyright (c) 2009-2012 Amanda Burton, Evan Driscoll, Aditya Thakur,
107-
and Thomas Reps
108-
109-
WALi portions:
110-
Copyright (c) 2010 Nicholas Kidd, Akash Lal, and Thomas Reps
111-
Copyright (c) 2007 Nicholas Kidd, Akash Lal, and Thomas Reps
112-
113-
Permission is hereby granted, free of charge, to any person obtaining a copy
114-
of this software and associated documentation files (the "Software"), to deal
115-
in the Software without restriction, including without limitation the rights
116-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117-
copies of the Software, and to permit persons to whom the Software is
118-
furnished to do so, subject to the following conditions:
119-
120-
The above copyright notice and this permission notice shall be included in
121-
all copies or substantial portions of the Software.
122-
123-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
129-
THE SOFTWARE.
130-
131-
132102
Boost
133103
-------------------------------------------------------------------------------
134104
Boost Software License - Version 1.0 - August 17th, 2003

README.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,31 +73,9 @@ Done!
7373

7474

7575
### Installing PhASAR a MacOS system
76-
Mac OS 10.13.1 or higher only!
77-
To install the framework on a Mac we will rely on Homebrew. (https://brew.sh/)
78-
79-
Please follow the instructions down below.
80-
81-
```
82-
$ brew install boost
83-
$ brew install python3
84-
# Install llvm version 10
85-
$ brew install llvm
86-
# Setting the paths
87-
# Use LLVM's Clang rather than Apple's Clang compiler
88-
$ export CC=/usr/local/opt/llvm/bin/clang
89-
$ export CXX=/usr/local/opt/llvm/bin/clang++
90-
# Set PATH env variable to /usr/local/opt/llvm/bin
91-
# Go to PhASAR directory run the following commands
92-
$ git submodule init
93-
$ git submodule update
94-
$ mkdir build
95-
$ cd build/
96-
$ cmake -DCMAKE_BUILD_TYPE=Release ..
97-
$ make -j $(nproc) # or use a different number of cores to compile it
98-
$ sudo make install # if you wish a system-wise installation
99-
```
100-
76+
Due to unfortunate updates to MacOS and the handling of C++, especially on the newer M1 processors, we can't support native development on Mac.
77+
The easiest solution to develop PhASAR on a Mac right now is to use [dockers development environments](https://docs.docker.com/desktop/dev-environments/). Clone this repository as described in their documentation. Afterwards, you have to login once manually, as a root user by running `docker exec -it -u root <container name> /bin/bash` to complete the rest of the install process as described in this readme (install submodules, run bootstrap.sh, ...).
78+
Now you can just attach your docker container to VS Code or any other IDE, which supports remote development.
10179

10280
### Compiling PhASAR (if not already done using the installation scripts)
10381
Set the system's variables for the C and C++ compiler to clang:

external/WALi-OpenNWA

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)