From db26c3b328a5db14f515e704a0ffb2e4bdcc17c0 Mon Sep 17 00:00:00 2001 From: bugarela Date: Wed, 4 Sep 2024 08:45:52 -0300 Subject: [PATCH 1/5] Add bat file to easily run Apalache on Windows --- bin/apalache-mc.bat | 39 +++++++++++++++++++++++++++++++ src/universal/bin/apalache-mc.bat | 39 +++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100755 bin/apalache-mc.bat create mode 100644 src/universal/bin/apalache-mc.bat diff --git a/bin/apalache-mc.bat b/bin/apalache-mc.bat new file mode 100755 index 0000000000..962158597b --- /dev/null +++ b/bin/apalache-mc.bat @@ -0,0 +1,39 @@ +@echo off +rem Run the APALACHE model checker +rem +rem NOTE: The primary intended use for this script is to be copied into the +rem packaged produced. +rem +rem Gabriela Moreira, 2024 + +rem Set the directory where the script is run from +set "DIR=%~dp0" + +rem Set the path to the APALACHE JAR file +set "APALACHE_JAR=%DIR%\..\lib\apalache.jar" + +rem Set JVM arguments +set "JVM_ARGS=" + +rem Check if the APALACHE JAR file exists +if not exist "%APALACHE_JAR%" ( + echo ERROR: No file found at %APALACHE_JAR% + echo Ensure you have run 'make package' and are running the script from the + echo distribution package, or else set APALACHE_JAR to point to your custom + echo build jar. + exit /b 1 +) + +rem Check if the heap size is already set +echo %JVM_ARGS% | findstr /C:"-Xmx" >nul || echo %JVM_ARGS% | findstr /C:"-XX:MaxRAMPercentage" >nul || set "JVM_ARGS=-Xmx4096m" + +rem Check whether the command-line arguments contain the debug flag +echo %* | find "--debug" >nul && ( + echo # Tool home: %DIR% + echo # Package: %APALACHE_JAR% + echo # JVM args: %JVM_ARGS% + echo # +) + +rem Run the Java command +java %JVM_ARGS% -jar "%APALACHE_JAR%" %* diff --git a/src/universal/bin/apalache-mc.bat b/src/universal/bin/apalache-mc.bat new file mode 100644 index 0000000000..962158597b --- /dev/null +++ b/src/universal/bin/apalache-mc.bat @@ -0,0 +1,39 @@ +@echo off +rem Run the APALACHE model checker +rem +rem NOTE: The primary intended use for this script is to be copied into the +rem packaged produced. +rem +rem Gabriela Moreira, 2024 + +rem Set the directory where the script is run from +set "DIR=%~dp0" + +rem Set the path to the APALACHE JAR file +set "APALACHE_JAR=%DIR%\..\lib\apalache.jar" + +rem Set JVM arguments +set "JVM_ARGS=" + +rem Check if the APALACHE JAR file exists +if not exist "%APALACHE_JAR%" ( + echo ERROR: No file found at %APALACHE_JAR% + echo Ensure you have run 'make package' and are running the script from the + echo distribution package, or else set APALACHE_JAR to point to your custom + echo build jar. + exit /b 1 +) + +rem Check if the heap size is already set +echo %JVM_ARGS% | findstr /C:"-Xmx" >nul || echo %JVM_ARGS% | findstr /C:"-XX:MaxRAMPercentage" >nul || set "JVM_ARGS=-Xmx4096m" + +rem Check whether the command-line arguments contain the debug flag +echo %* | find "--debug" >nul && ( + echo # Tool home: %DIR% + echo # Package: %APALACHE_JAR% + echo # JVM args: %JVM_ARGS% + echo # +) + +rem Run the Java command +java %JVM_ARGS% -jar "%APALACHE_JAR%" %* From 2048a731c325af56e6575519710215f557a514ba Mon Sep 17 00:00:00 2001 From: bugarela Date: Wed, 4 Sep 2024 08:46:19 -0300 Subject: [PATCH 2/5] Fix typo --- script/release-prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release-prepare.sh b/script/release-prepare.sh index 3d623dcbef..be5d5d9bda 100755 --- a/script/release-prepare.sh +++ b/script/release-prepare.sh @@ -36,7 +36,7 @@ then # Explicitly set the release version sbt "setVersion ${RELEASE_VERSION}" else - # Derive the relesae version by removing the -SNAPSHOT suffix + # Derive the release version by removing the -SNAPSHOT suffix sbt removeVersionSnapshot RELEASE_VERSION=$("$DIR"/get-version.sh) fi From cce9b89ecf5d5b4289a5ae24fb0578c21c4b012a Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 5 Sep 2024 15:03:24 -0300 Subject: [PATCH 3/5] Delete file that is not used in the distribution --- bin/apalache-mc.bat | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100755 bin/apalache-mc.bat diff --git a/bin/apalache-mc.bat b/bin/apalache-mc.bat deleted file mode 100755 index 962158597b..0000000000 --- a/bin/apalache-mc.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -rem Run the APALACHE model checker -rem -rem NOTE: The primary intended use for this script is to be copied into the -rem packaged produced. -rem -rem Gabriela Moreira, 2024 - -rem Set the directory where the script is run from -set "DIR=%~dp0" - -rem Set the path to the APALACHE JAR file -set "APALACHE_JAR=%DIR%\..\lib\apalache.jar" - -rem Set JVM arguments -set "JVM_ARGS=" - -rem Check if the APALACHE JAR file exists -if not exist "%APALACHE_JAR%" ( - echo ERROR: No file found at %APALACHE_JAR% - echo Ensure you have run 'make package' and are running the script from the - echo distribution package, or else set APALACHE_JAR to point to your custom - echo build jar. - exit /b 1 -) - -rem Check if the heap size is already set -echo %JVM_ARGS% | findstr /C:"-Xmx" >nul || echo %JVM_ARGS% | findstr /C:"-XX:MaxRAMPercentage" >nul || set "JVM_ARGS=-Xmx4096m" - -rem Check whether the command-line arguments contain the debug flag -echo %* | find "--debug" >nul && ( - echo # Tool home: %DIR% - echo # Package: %APALACHE_JAR% - echo # JVM args: %JVM_ARGS% - echo # -) - -rem Run the Java command -java %JVM_ARGS% -jar "%APALACHE_JAR%" %* From 2d4df36e9929816e059dfd9a2f88c1c07ebb2cca Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 5 Sep 2024 15:07:06 -0300 Subject: [PATCH 4/5] Update installation instructions --- docs/src/apalache/installation/jvm.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/src/apalache/installation/jvm.md b/docs/src/apalache/installation/jvm.md index f704b6b9d2..3987a96fb4 100644 --- a/docs/src/apalache/installation/jvm.md +++ b/docs/src/apalache/installation/jvm.md @@ -10,17 +10,15 @@ a directory of your choice. Depending on your OS, you have two options. *Option 1: Linux, macOS.* You can run the script `./bin/apalache-mc`, or, better, add the `./bin` directory to your `PATH` and run `apalache-mc`. -*Option 2: Windows.* You have to run Java directly with +*Option 2: Windows.* You can run the script `./bin/apalache-mc.bat` - ``` - java.exe -jar ./lib/apalache.jar - ``` +Alternatively, you can run Java directly with - The arguments `` are explained in [Running the Tool](../running.md). +``` +java.exe -jar ./lib/apalache.jar +``` -If you would like to contribute a command-line script for running Apalache in -Windows, please [open a pull -request](https://github.com/informalsystems/apalache/blob/main/CONTRIBUTING.md#making-a-pull-request). +The arguments `` are explained in [Running the Tool](../running.md). [Eclipse Temurin]: https://adoptium.net/ [Zulu]: https://www.azul.com/downloads/?version=java-17-lts&package=jdk#download-openjdk From 585ced5b0dfaf7084427d2caca3282c398fbd81a Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 5 Sep 2024 15:16:31 -0300 Subject: [PATCH 5/5] Fix typos --- docs/src/apalache/installation/source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/apalache/installation/source.md b/docs/src/apalache/installation/source.md index f285d3d443..a5f5ec985c 100644 --- a/docs/src/apalache/installation/source.md +++ b/docs/src/apalache/installation/source.md @@ -26,8 +26,8 @@ If you prefer to keep the built package inside of the Apalache source repository, you have three options after running `make`: - Add the `./bin` directory in the source repository to your `PATH`, which will - make `apalche-mc` available. -- Install [direnv][] and run `direnv allow`, which will put `apalche-mc` in your + make `apalache-mc` available. +- Install [direnv][] and run `direnv allow`, which will put `apalache-mc` in your path when you are inside the Apalache repo directory. - Run `./bin/apalache-mc` directly.