Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into _update-deps/runti…
Browse files Browse the repository at this point in the history
…meverification/haskell-backend
  • Loading branch information
devops committed Jul 25, 2024
2 parents 5398c72 + ae6d419 commit 738b082
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 71 deletions.
77 changes: 14 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ for details about supported configurations and system setup.
## Contents

1. [Prerequisite Install Guide](#prerequisite-install-guide)
2. [Build and Install Guide](#build-and-install-guide)
2. [Build and Install Guide]
3. [IDE Setup](#ide-setup)
4. [Running the Test Suite](#running-the-test-suite)
5. [Changing the KORE Data Structures](#changing-the-kore-data-structures)
Expand All @@ -72,69 +72,13 @@ must first be installed.

## The Short Version

On Ubuntu Linux 22.04 (Jammy):
Regardless of system, unless you cloned with `--recusrive` you will first
have to run `git submodule update --init --recursive`.

```shell
git submodule update --init --recursive
sudo apt-get install \
bison \
build-essential \
clang-15 \
cmake \
curl \
flex \
g++ \
gcc \
libboost-test-dev \
libfmt-dev \
libgmp-dev \
libjemalloc-dev \
libmpfr-dev \
libsecp256k1-dev \
libunwind-dev \
libyaml-dev \
libz3-dev \
lld-15 \
llvm-15-tools \
m4 \
maven \
openjdk-17-jdk \
pkg-config \
python3 \
python3-dev \
z3 \
zlib1g-dev
curl -sSL https://get.haskellstack.org/ | sh
```

If you install this list of dependencies, continue directly to the [Build and Install Guide](#build-and-install-guide).

On macOS using [Homebrew](https://brew.sh/):

```shell
git submodule update --init --recursive
brew install \
bison \
boost \
cmake \
flex \
fmt \
gcc \
gmp \
openjdk \
jemalloc \
libyaml \
llvm \
make \
maven \
mpfr \
pkg-config \
python \
secp256k1 \
stack \
zlib \
z3
```
You then need the build and runtime dependencies. If you are on a
Debian-based system (including Ubuntu) or MacOS with [Homebrew] installed,
you can run `./install-build-deps` and continue directly to the
[Build and Install Guide].

## The Long Version

Expand Down Expand Up @@ -451,3 +395,10 @@ of artifacts, you can run `mvn dependency:purge-local-repository`.
If tests fail but you want to run the build anyway to see what happens, you can use `mvn package -DskipTests`.
If you still cannot build, please contact a K developer.
<!-------------------------------------------------------------------->
[Build and Install Guide]: #build-and-install-guide
[Homebrew]: https://brew.sh/
2 changes: 1 addition & 1 deletion deps/llvm-backend_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.61
0.1.62
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "K Framework";
inputs = {
llvm-backend.url = "github:runtimeverification/llvm-backend/v0.1.61";
llvm-backend.url = "github:runtimeverification/llvm-backend/v0.1.62";
haskell-backend = {
url = "github:runtimeverification/haskell-backend/v0.1.47";
inputs.rv-utils.follows = "llvm-backend/rv-utils";
Expand Down
85 changes: 85 additions & 0 deletions install-build-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env bash
#
# Install OS packages containing dependencies required to build K.
#
set -Eeuo pipefail

die() { local ec="$1"; shift; echo "ERROR: $@"; exit $ec; }

inst_Debian() {
echo '===== Debian packages:'
sudo apt-get install -q \
bison \
build-essential \
clang-15 \
cmake \
curl \
flex \
g++ \
gcc \
libboost-test-dev \
libfmt-dev \
libgmp-dev \
libjemalloc-dev \
libmpfr-dev \
libsecp256k1-dev \
libunwind-dev \
libyaml-dev \
libz3-dev \
lld-15 \
llvm-15-tools \
m4 \
maven \
openjdk-17-jdk \
pkg-config \
python3 \
python3-dev \
z3 \
zlib1g-dev

if stack --version >/dev/null 2>&1; then
echo 'Using existing Haskell Stack installation.'
else
echo '===== Haskell Stack:'
curl -sSL https://get.haskellstack.org/ | sh
fi
}

inst_MacOS() {
echo '===== Brew packages'
brew install \
bison \
boost \
cmake \
flex \
fmt \
gcc \
gmp \
openjdk \
jemalloc \
libyaml \
llvm \
make \
maven \
mpfr \
pkg-config \
python \
secp256k1 \
stack \
zlib \
z3
}

try() {
local command="$1"; shift
local platform="$1"; shift

echo "===== Checking for $command for platform $platform"
$command --version >/dev/null 2>&1 || return 1
echo "----- Found platform $platform"
inst_$platform
}

try apt-get Debian && exit 0
try brew MacOS && exit 0
die 1 'Cannot find known platform. Your system appears to be unsupported.'
2 changes: 1 addition & 1 deletion pyk/src/pyk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def __init__(self, bug_report: Path) -> None:
def add_file(self, finput: Path, arcname: Path) -> None:
if str(finput) not in self._file_remap:
self._file_remap[str(finput)] = str(arcname)
with tarfile.open(self._bug_report, 'a') as tar:
with tarfile.open(self._bug_report, 'a', format=tarfile.GNU_FORMAT) as tar:
tar.add(finput, arcname=arcname)
_LOGGER.info(f'Added file to bug report {self._bug_report}:{arcname}: {finput}')

Expand Down

0 comments on commit 738b082

Please sign in to comment.