Skip to content

Commit

Permalink
Merge branch 'main' into update
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinafyi authored Jul 3, 2024
2 parents d005c31 + 4284c45 commit d00308b
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "update Nix packages"
on:
schedule:
- cron: '53 18 * * 1' # AEST 4:53 am
- cron: '53 18 * * 0-4' # AEST 4:53 am
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ installed binaries will go.

Then, set up your user with Nix and enable some features:
```bash
printf '%s\n' "extra-experimental-features = nix-command flakes" "extra-trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf
printf '%s\n' "extra-trusted-users = $USER" "extra-experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf
```
<!--
As your usual user, run:
Expand Down
12 changes: 7 additions & 5 deletions aslp/asli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,30 @@
, cohttp-lwt-unix
, mlbdd
, yojson
, ppx_blob
, zarith_stubs_js
, asli
, testers
}:

buildDunePackage {
pname = "asli";
version = "unstable-2024-05-08";
version = "unstable-2024-07-01";

minimalOCamlVersion = "4.09";

src = fetchFromGitHub {
owner = "UQ-PAC";
repo = "aslp";
rev = "abd63cb88c81f34822dd3d0779517430d0aa9ba8";
sha256 = "sha256-rZoqaXuHVKD/1zi6wZDovS64gdNlA7CYEqsBb5+Lkf4=";
rev = "535a65099f69f03739071fc8ccb9f127302f03a1";
hash = "sha256-qN8+bMMw1qVeVaaCfJ0amn9WB5hJdUtrCgkUnEUdbdQ=";
};

checkInputs = [ alcotest ];
nativeCheckInputs = [ jdk ];
buildInputs = [ mlbdd linenoise ];
buildInputs = [ mlbdd linenoise ppx_blob ];
nativeBuildInputs = [ ott menhir ];
propagatedBuildInputs = [ dune-site z3 pcre pprint zarith ocaml_z3 ocaml_pcre yojson cohttp-lwt-unix ];
propagatedBuildInputs = [ dune-site z3 pcre pprint zarith ocaml_z3 ocaml_pcre yojson cohttp-lwt-unix zarith_stubs_js ];

preConfigure = ''
mkdir -p $out/share/asli
Expand Down
41 changes: 41 additions & 0 deletions aslp/aslp_web.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ lib
, fetchFromGitHub
, buildDunePackage
, nix-gitignore
, asli
, js_of_ocaml
, js_of_ocaml-ppx
, js_of_ocaml-compiler
, nodejs-slim
, python3
}:

buildDunePackage rec {
pname = "aslp_web";
version = "unstable-2024-06-28";

buildInputs = [ asli js_of_ocaml js_of_ocaml-ppx ];
nativeBuildInputs = [ python3 js_of_ocaml-compiler nodejs-slim ];

src = fetchFromGitHub {
owner = "katrinafyi";
repo = "aslp-web";
rev = "46241099742be60f644d05be475c60166f944a55";
hash = "sha256-bOiYHpKYmPcvSlZ2kLT/X8xuNDYRJoS+PbkHUKykXKE=";
};

postPatch = ''
export aslp=${asli.name}
export aslp_commit=${asli.src.rev or "unknown"}
export aslp_web=$name
export aslp_web_commit=${src.rev or "unknown"}
substituteAllInPlace web/index.html
'';

meta = {
homepage = "https://github.com/katrinafyi/aslp-web";
description = "aslp on the web";
maintainers = with lib.maintainers; [ katrinafyi ];
};
}
8 changes: 6 additions & 2 deletions aslp/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ final: prev:

aslp-cpp = prev.callPackage ./aslp-cpp.nix { };

inherit (final.ocamlPackages_pac) aslp asli;
inherit (final.ocamlPackages_pac) aslp asli aslp_web;

overlay_ocamlPackages = ofinal: oprev: {
asli = ofinal.callPackage ./asli.nix { inherit (final) z3; ocaml_z3 = ofinal.z3; };

asli = ofinal.callPackage ./asli.nix { inherit (final) z3; ocaml_z3 = ofinal.z3; zarith_stubs_js = ofinal.zarith_stubs_js_0_17; };
aslp = ofinal.asli;
# .overrideAttrs { src = prev.lib.cleanSource ~/progs/aslp; }

zarith_stubs_js_0_17 = ofinal.callPackage ./zarith_stubs_js.nix { };
aslp_web = ofinal.callPackage ./aslp_web.nix { };

mlbdd = ofinal.callPackage ./mlbdd.nix { };

buildDunePackage = final.makeOverridable ({ pname, version, ... }@args:
Expand Down
26 changes: 26 additions & 0 deletions aslp/zarith_stubs_js.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ lib
, buildDunePackage
, fetchFromGitHub
, pkgs
, asli
, bisect_ppx
, ppx_inline_test
}:

buildDunePackage {
pname = "zarith_stubs_js";
version = "0.17.0";

src = fetchFromGitHub {
owner = "janestreet";
repo = "zarith_stubs_js";
rev = "v0.17.0";
hash = "sha256-QNhs9rHZetwgKAOftgQQa6aU8cOux8JOe3dBRrLJVh0=";
};

meta = {
homepage = "https://github.com/janestreet/zarith_stubs_js";
description = "Javascripts stubs for the Zarith library";
maintainers = with lib.maintainers; [ katrinafyi ];
};
}
27 changes: 27 additions & 0 deletions bap/0001-asli_lifter.ml-use-FileSource-type.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From f8a59507a0e8fc0117ca3d11ad1ed7c870cce2e9 Mon Sep 17 00:00:00 2001
From: rina <[email protected]>
Date: Mon, 1 Jul 2024 12:14:48 +1000
Subject: [PATCH] asli_lifter.ml: use FileSource type

---
asli_lifter.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/asli_lifter.ml b/asli_lifter.ml
index 2e7680f..9315781 100644
--- a/asli_lifter.ml
+++ b/asli_lifter.ml
@@ -470,8 +470,8 @@ let lifter env lenv label =
| _ -> i

let load prelude specs =
- let prelude = LoadASL.read_file prelude true false in
- let mra = List.map (fun tool -> LoadASL.read_file tool false false) specs in
+ let prelude = LoadASL.read_file (LoadASL.FileSource prelude) true false in
+ let mra = List.map (fun tool -> LoadASL.read_file (LoadASL.FileSource tool) false false) specs in
let env = Eval.build_evaluation_environment (List.concat (prelude::mra)) in
let denv = Dis.build_env env in
KB.promise Theory.Semantics.slot (lifter env denv)
--
2.45.2

24 changes: 24 additions & 0 deletions bap/0001-bap_build-filter-empty-library-files.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 7bf9b895dfeaeb33b1f18523358f485039850b6a Mon Sep 17 00:00:00 2001
From: rina <[email protected]>
Date: Mon, 1 Jul 2024 14:11:10 +1000
Subject: [PATCH] bap_build: filter empty library files

---
lib/bap_build/bap_build.ml | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/bap_build/bap_build.ml b/lib/bap_build/bap_build.ml
index a6ece6c1..e1b127a3 100644
--- a/lib/bap_build/bap_build.ml
+++ b/lib/bap_build/bap_build.ml
@@ -80,6 +80,7 @@ module Plugin_rules = struct
then raise Not_found;
String.split_on_char ' ' arch |>
List.map ~f:(Fl.resolve_path ~base)
+ |> List.filter ~f:(fun x -> x <> "")
with Not_found -> []

let externals pkgs =
--
2.45.2

9 changes: 6 additions & 3 deletions bap/bap-asli-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
, stdenv
, fetchFromGitHub
# ocamlPackages
, ocaml
, findlib
, asli
, bap-build
, bap
}:

Expand All @@ -19,12 +21,15 @@ stdenv.mkDerivation rec {
};

buildInputs = [ asli bap findlib ];
nativeBuildInputs = [ ocaml ];
dontDetectOcamlConflicts = true;

patches = [ ./0001-asli_lifter.ml-use-FileSource-type.patch ];

buildPhase = ''
runHook preBuild
bapbuild -package asli.libASL asli.plugin
OCAMLRUNPARAM=b ${bap-build}/bin/bapbuild -package asli.libASL asli.plugin -dont-catch-errors
mkdir -p $out/lib/bap
# needed to maintain runtime dependencies.
Expand All @@ -41,6 +46,4 @@ stdenv.mkDerivation rec {
runHook preInstall
runHook postInstall
'';

meta.broken = true;
}
4 changes: 0 additions & 4 deletions bap/bap-aslp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,5 @@ in stdenv.mkDerivation {
command = "bap --help";
version = "asli-specs";
};

meta = {
broken = true;
};
}

43 changes: 43 additions & 0 deletions bap/bap-build.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ lib
, fetchFromGitHub
, buildDunePackage
, ocaml_oasis
, ocamlbuild
, ppx_bap
, ppx_sexp_value
, core_kernel
, findlib
}:

buildDunePackage {
pname = "bap-build";
version = "unstable-2024-04-25";

minimalOCamlVersion = "4.09";

src = fetchFromGitHub {
owner = "BinaryAnalysisPlatform";
repo = "bap";
rev = "95e81738c440fbc928a627e4b5ab3cccfded66e2";
hash = "sha256-gogcwqK7EK4Fs4HiCXKxWeFpJ1vJlJupMtJu+8M9kjs=";
};

dontConfigure = true;

patches = [ ./0001-bap_build-filter-empty-library-files.patch ];

postPatch = ''
# bap-build does not actually make use of ppx_bap
substituteInPlace tools/dune --replace-warn '(preprocess (pps ppx_bap))' ""
'';

buildInputs = [ ocamlbuild findlib core_kernel ];
nativeBuildInputs = [ ocaml_oasis ];
propagatedBuildInputs = [];

meta = {
homepage = "https://github.com/BinaryAnalysisPlatform/bap/blob/master/tools/bapbuild.ml";
description = "bapbuild executable for plugin building";
maintainers = with lib.maintainers; [ katrinafyi ];
};
}
2 changes: 2 additions & 0 deletions bap/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ final: prev:
bap-aslp = ofinal.callPackage ./bap-aslp.nix { };
bap-plugins = ofinal.callPackage ./bap-plugins.nix { };
bap-primus = ofinal.callPackage ./bap-primus.nix { };

bap-build = ofinal.callPackage ./bap-build.nix { };
};

inherit (final.ocamlPackages_pac) bap-aslp bap-asli-plugin bap-primus;
Expand Down
6 changes: 3 additions & 3 deletions basil/basil.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

mkSbtDerivation {
pname = "basil";
version = "unstable-2024-03-08";
version = "unstable-2024-06-12";

nativeBuildInputs = [ jdk makeBinaryWrapper ];

src = fetchFromGitHub {
owner = "UQ-PAC";
repo = "bil-to-boogie-translator";
rev = "b6a2409f60b977985ee0c97959cdcfe04bdb35f0";
sha256 = "sha256-EiJFcTK6XnUXjvlElqWo5V3+qwoazH8ZrPb8EzSLGbQ=";
rev = "d2e1624c605100bca1df5958ef85c4d6d13c9f35";
sha256 = "sha256-OX4AqJ7H4LGIxCIhQTPg6vK17lYcJUX5sE1JI3cferE=";
};

depsSha256 = "sha256-++gg+SKskDyaqHowNG2RPS7evuCzPYvvXMC4Rkp7b6U=";
Expand Down
6 changes: 3 additions & 3 deletions gtirb/gtirb-semantics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ let
in
buildDunePackage {
pname = "gtirb_semantics";
version = "unstable-2024-02-21";
version = "unstable-2024-07-01";

src = fetchFromGitHub {
owner = "UQ-PAC";
repo = "gtirb-semantics";
rev = "23fe5e2ac50aded95f1447d66aaec14e0bde4814";
sha256 = "sha256-Y0nFoCCFFcHhyb3lsOYkA4qMT03eElmaMdVeuCnMMHs=";
rev = "98f81f3af920645589167385f225f9444a5c3110";
sha256 = "sha256-qHwjnCCRa1388qO9Ob2BntPTg6iaMu/fnroePnB1mEU=";
};

buildInputs = [ python' asli ocaml-hexstring ocaml-protoc-plugin yojson ];
Expand Down

0 comments on commit d00308b

Please sign in to comment.