Skip to content

Commit

Permalink
Merge branch 'develop' into add-pyk-to-sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli authored Jun 26, 2024
2 parents eb3ce9a + 3bc2373 commit 333007f
Show file tree
Hide file tree
Showing 8 changed files with 331 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/actions/with-k-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ FROM ubuntu:${BASE_DISTRO}
ARG K_DEB_PATH
ARG INSTALL_BACKEND_DEBS
ARG LLVM_BACKEND_DEB_PATH
ARG HASKELL_BACKEND_DEB_PATH

COPY ${K_DEB_PATH} /kframework.deb
COPY ${LLVM_BACKEND_DEB_PATH} /llvm-backend.deb
COPY ${HASKELL_BACKEND_DEB_PATH} /haskell-backend.deb

RUN apt-get -y update \
&& apt-get -y install \
Expand All @@ -19,7 +21,7 @@ RUN apt-get -y update \
/kframework.deb

RUN if [ "${INSTALL_BACKEND_DEBS}" = "true" ]; then \
apt-get -y install /llvm-backend.deb; \
apt-get -y install /llvm-backend.deb /haskell-backend.deb; \
fi

RUN apt-get -y clean
Expand Down
10 changes: 9 additions & 1 deletion .github/actions/with-k-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,28 @@ runs:
DOCKERFILE=${{ github.action_path }}/Dockerfile
K_DEB_PATH=${{ inputs.k-deb-path }}
LLVM_BACKEND_DEB_PATH=llvm-backend.deb
HASKELL_BACKEND_DEB_PATH=haskell-backend.deb
gh release download \
--repo runtimeverification/llvm-backend \
--pattern "*ubuntu_${BASE_DISTRO}.deb" \
--output "${LLVM_BACKEND_DEB_PATH}" \
v$(cat deps/llvm-backend_release)
gh release download \
--repo runtimeverification/haskell-backend \
--pattern "*ubuntu_${BASE_DISTRO}.deb" \
--output "${HASKELL_BACKEND_DEB_PATH}" \
$(cat deps/haskell-backend_release)
docker build . \
--file ${DOCKERFILE} \
--tag ${TAG} \
--build-arg BASE_DISTRO=${BASE_DISTRO} \
--build-arg K_DEB_PATH=${K_DEB_PATH} \
--build-arg INSTALL_BACKEND_DEBS=${INSTALL_BACKEND_DEBS} \
--build-arg LLVM_BACKEND_DEB_PATH=${LLVM_BACKEND_DEB_PATH}
--build-arg LLVM_BACKEND_DEB_PATH=${LLVM_BACKEND_DEB_PATH} \
--build-arg HASKELL_BACKEND_DEB_PATH=${HASKELL_BACKEND_DEB_PATH}
- name: 'Run Docker container'
shell: bash {0}
Expand Down
2 changes: 1 addition & 1 deletion package/debian/kframework-frontend/rules.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export PREFIX
dh $@

override_dh_auto_build:
mvn --batch-mode package -DskipTests -Dllvm.backend.skip
mvn --batch-mode package -DskipTests -Dllvm.backend.skip -Dhaskell.backend.skip

override_dh_auto_install:
package/package --frontend
Expand Down
1 change: 1 addition & 0 deletions pyk/src/pyk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def exec_kompile(options: KompileCommandOptions) -> None:
type_inference_mode=options.type_inference_mode,
warnings=options.warnings,
warnings_to_errors=options.warnings_to_errors,
ignore_warnings=options.ignore_warnings,
no_exc_wrap=options.no_exc_wrap,
)
except RuntimeError as err:
Expand Down
5 changes: 5 additions & 0 deletions pyk/src/pyk/cli/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class KompileOptions(Options):
bison_lists: bool
no_exc_wrap: bool
outer_parsed_json: bool
ignore_warnings: list[str]

@staticmethod
def default() -> dict[str, Any]:
Expand All @@ -230,6 +231,7 @@ def default() -> dict[str, Any]:
'bison_lists': False,
'no_exc_wrap': False,
'outer_parsed_json': False,
'ignore_warnings': [],
}

@staticmethod
Expand Down Expand Up @@ -475,6 +477,9 @@ def kompile_args(self) -> ArgumentParser:
action='store_true',
help='Do not wrap the output on the CLI.',
)
args.add_argument(
'--ignore-warnings', '-Wno', dest='ignore_warnings', action='append', help='Ignore provided warnings'
)
return args

@cached_property
Expand Down
10 changes: 10 additions & 0 deletions pyk/src/pyk/ktool/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def kompile(
type_inference_mode: str | TypeInferenceMode | None = None,
warnings: str | Warnings | None = None,
warnings_to_errors: bool = False,
ignore_warnings: Iterable[str] = (),
no_exc_wrap: bool = False,
# ---
debug: bool = False,
Expand All @@ -78,6 +79,7 @@ def kompile(
type_inference_mode=type_inference_mode,
warnings=warnings,
warnings_to_errors=warnings_to_errors,
ignore_warnings=ignore_warnings,
no_exc_wrap=no_exc_wrap,
debug=debug,
verbose=verbose,
Expand All @@ -96,6 +98,7 @@ def kompile(
type_inference_mode=type_inference_mode,
warnings=warnings,
warnings_to_errors=warnings_to_errors,
ignore_warnings=ignore_warnings,
no_exc_wrap=no_exc_wrap,
debug=debug,
verbose=verbose,
Expand All @@ -111,6 +114,7 @@ def _booster_kompile(
type_inference_mode: str | TypeInferenceMode | None,
warnings: str | Warnings | None,
warnings_to_errors: bool,
ignore_warnings: Iterable[str],
no_exc_wrap: bool,
# ---
debug: bool,
Expand Down Expand Up @@ -146,6 +150,7 @@ def kompile_llvm() -> None:
type_inference_mode=type_inference_mode,
warnings=warnings,
warnings_to_errors=warnings_to_errors,
ignore_warnings=ignore_warnings,
no_exc_wrap=no_exc_wrap,
debug=debug,
verbose=verbose,
Expand All @@ -161,6 +166,7 @@ def kompile_haskell() -> None:
type_inference_mode=type_inference_mode,
warnings=warnings,
warnings_to_errors=warnings_to_errors,
ignore_warnings=ignore_warnings,
no_exc_wrap=no_exc_wrap,
debug=debug,
verbose=verbose,
Expand Down Expand Up @@ -273,6 +279,7 @@ def __call__(
type_inference_mode: str | TypeInferenceMode | None = None,
warnings: str | Warnings | None = None,
warnings_to_errors: bool = False,
ignore_warnings: Iterable[str] = (),
no_exc_wrap: bool = False,
debug: bool = False,
verbose: bool = False,
Expand Down Expand Up @@ -321,6 +328,9 @@ def __call__(
if outer_parsed_json:
args += ['--outer-parsed-json']

if ignore_warnings:
args += ['-Wno', ','.join(ignore_warnings)]

try:
proc_res = run_process(args, logger=_LOGGER, cwd=cwd, check=check)
except CalledProcessError as err:
Expand Down
Loading

0 comments on commit 333007f

Please sign in to comment.