From 2d1b9838454875df47c03b8a2aa45f9637fb762d Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 2 Sep 2024 15:15:00 +1000 Subject: [PATCH 1/6] ci: add scala lifter compilation --- .github/workflows/test.yml | 26 +++++++++++++++++++++++++- offlineASL-scala/readme.md | 14 +++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52de67dd..33bcce20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,7 @@ jobs: - run: dune build @offline-coverage -j4 offline-cpp: - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04 # for recent llvm version steps: - uses: actions/checkout@v4 @@ -81,3 +81,27 @@ jobs: - name: 'syntax check generated C++ lifter' run: meson compile -C offlineASL-cpp/build + + offline-scala: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v25 + - run: echo 'preparing nix shell environment' + + - uses: actions/setup-java@v4 + with: + distribution: adopt + java-version: 17 + + - uses: coursier/cache-action@v6 + - run: cs install mill + + - run: dune build --profile release + - run: echo ':gen A64 .* scala true offlineASL-scala/lifter/generated' | OCAMLRUNPARAM=b dune exec asli + + - run: mill lifter.assembly + - run: mill main.compile + - run: mill main.run --opcode 0x8b031041 diff --git a/offlineASL-scala/readme.md b/offlineASL-scala/readme.md index 6246252c..00964fd6 100644 --- a/offlineASL-scala/readme.md +++ b/offlineASL-scala/readme.md @@ -1,9 +1,9 @@ -Build standalone Scala lifter interface +Build standalone Scala lifter interface. -``` -# (in parent direictory) -~ echo ':gen A64 aarch64.+ scala true scalaOfflineASL/lifter/generated' | dune exec asli -~ cd scalaOfflineASL -~ ./mill lifter.assembly -~ ./mill main.run +Requires Mill (e.g. installed by Coursier). Run in parent directory: +```bash +echo ':gen A64 aarch64.+ scala true offlineASL-scala/lifter/generated' | dune exec asli +cd offlineASL-scala +mill lifter.assembly +mill main.run --opcode 0x8b031041 ``` From 970a3635b6431ad483170b46f49607b5b80f258f Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 2 Sep 2024 16:05:51 +1000 Subject: [PATCH 2/6] use coursier/setup-action --- .github/workflows/test.yml | 18 ++++++++---------- offlineASL-scala/readme.md | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33bcce20..b5ab30a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,17 +91,15 @@ jobs: - uses: cachix/install-nix-action@v25 - run: echo 'preparing nix shell environment' - - uses: actions/setup-java@v4 - with: - distribution: adopt - java-version: 17 - - uses: coursier/cache-action@v6 - - run: cs install mill + - uses: coursier/setup-action@v1 + with: + jvm: adopt:11 + apps: sbt mill - run: dune build --profile release - - run: echo ':gen A64 .* scala true offlineASL-scala/lifter/generated' | OCAMLRUNPARAM=b dune exec asli + - run: mkdir -p offlineASL-scala/lifter/src/generated + - run: echo ':gen A64 .* scala true offlineASL-scala/lifter/src/generated' | OCAMLRUNPARAM=b dune exec asli - - run: mill lifter.assembly - - run: mill main.compile - - run: mill main.run --opcode 0x8b031041 + - run: 'cd offlineASL-scala && mill lifter.assembly' + - run: 'cd offlineASL-scala && mill main.run --help' diff --git a/offlineASL-scala/readme.md b/offlineASL-scala/readme.md index 00964fd6..6b51eaa1 100644 --- a/offlineASL-scala/readme.md +++ b/offlineASL-scala/readme.md @@ -2,6 +2,7 @@ Build standalone Scala lifter interface. Requires Mill (e.g. installed by Coursier). Run in parent directory: ```bash +mkdir -p offlineASL-scala/lifter/src/generated echo ':gen A64 aarch64.+ scala true offlineASL-scala/lifter/generated' | dune exec asli cd offlineASL-scala mill lifter.assembly From 9a9cf00a8f19be94effbed0ce05485acc99f4fb4 Mon Sep 17 00:00:00 2001 From: Kait Lam <39479354+katrinafyi@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:22:01 +1000 Subject: [PATCH 3/6] java 17 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5ab30a5..da3641fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: - uses: coursier/cache-action@v6 - uses: coursier/setup-action@v1 with: - jvm: adopt:11 + jvm: adopt:17 apps: sbt mill - run: dune build --profile release From bdc4b860bf24d7d052a89421ff2aa79625703a93 Mon Sep 17 00:00:00 2001 From: Kait Lam <39479354+katrinafyi@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:24:08 +1000 Subject: [PATCH 4/6] add note about notimplemented [no ci] --- offlineASL-scala/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/offlineASL-scala/readme.md b/offlineASL-scala/readme.md index 6b51eaa1..4b395717 100644 --- a/offlineASL-scala/readme.md +++ b/offlineASL-scala/readme.md @@ -8,3 +8,6 @@ cd offlineASL-scala mill lifter.assembly mill main.run --opcode 0x8b031041 ``` +This should compile successfully. However, the last command will fail since +the default instruction-building interface simply throws "not implemented" +on all methods. From 6100f07196303f00db7cbf68ee0b6e9fa06c515a Mon Sep 17 00:00:00 2001 From: Kait Lam <39479354+katrinafyi@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:27:19 +1000 Subject: [PATCH 5/6] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da3641fb..db880304 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: - uses: coursier/cache-action@v6 - uses: coursier/setup-action@v1 with: - jvm: adopt:17 + jvm: adoptium:1.17 apps: sbt mill - run: dune build --profile release From 7893d93c605de60f042f20d957c73b8f1f40a273 Mon Sep 17 00:00:00 2001 From: rina Date: Thu, 5 Sep 2024 15:48:21 +1000 Subject: [PATCH 6/6] fix readme steps and remove sbt --- .github/workflows/test.yml | 2 +- offlineASL-scala/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db880304..e746ce1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,7 +95,7 @@ jobs: - uses: coursier/setup-action@v1 with: jvm: adoptium:1.17 - apps: sbt mill + apps: mill - run: dune build --profile release - run: mkdir -p offlineASL-scala/lifter/src/generated diff --git a/offlineASL-scala/readme.md b/offlineASL-scala/readme.md index 4b395717..742c22b2 100644 --- a/offlineASL-scala/readme.md +++ b/offlineASL-scala/readme.md @@ -3,7 +3,7 @@ Build standalone Scala lifter interface. Requires Mill (e.g. installed by Coursier). Run in parent directory: ```bash mkdir -p offlineASL-scala/lifter/src/generated -echo ':gen A64 aarch64.+ scala true offlineASL-scala/lifter/generated' | dune exec asli +echo ':gen A64 aarch64.+ scala true offlineASL-scala/lifter/src/generated' | dune exec asli cd offlineASL-scala mill lifter.assembly mill main.run --opcode 0x8b031041