From e0591b2e56b0010869307b7b836ae7d14e03fa97 Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Thu, 23 Mar 2023 03:49:38 +0100 Subject: [PATCH 1/4] ocamlPackages.cohttp_static_handler: init at 0.15.0 --- pkgs/development/ocaml-modules/janestreet/0.15.nix | 9 +++++++++ pkgs/top-level/ocaml-packages.nix | 1 + 2 files changed, 10 insertions(+) diff --git a/pkgs/development/ocaml-modules/janestreet/0.15.nix b/pkgs/development/ocaml-modules/janestreet/0.15.nix index 7433c116b68f..bf61ae1d939c 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.15.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.15.nix @@ -254,6 +254,15 @@ with self; propagatedBuildInputs = [ async_websocket cohttp-async ppx_jane uri-sexp ]; }; + cohttp_static_handler = janePackage { + duneVersion = "3"; + pname = "cohttp_static_handler"; + version = "0.15.0"; + hash = "sha256-ENaH8ChvjeMc9WeNIhkeNBB7YK9vB4lw95o6FFZI1ys="; + meta.description = "A library for easily creating a cohttp handler for static files"; + propagatedBuildInputs = [ cohttp-async ]; + }; + core = janePackage { pname = "core"; version = "0.15.1"; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d1e599d8970f..e6da9aca10cb 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -895,6 +895,7 @@ let magic-mime = callPackage ../development/ocaml-modules/magic-mime { }; + mariadb = callPackage ../development/ocaml-modules/mariadb { inherit (pkgs) mariadb; }; From 089467fefb3d6c0a568a379af110de4447c6dc2f Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Thu, 23 Mar 2023 03:50:11 +0100 Subject: [PATCH 2/4] ocamlPackages.owee: 0.4 -> 0.6 --- pkgs/development/ocaml-modules/owee/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/development/ocaml-modules/owee/default.nix b/pkgs/development/ocaml-modules/owee/default.nix index 7b15437a7ed2..3b8e6f58cfb2 100644 --- a/pkgs/development/ocaml-modules/owee/default.nix +++ b/pkgs/development/ocaml-modules/owee/default.nix @@ -2,19 +2,20 @@ buildDunePackage rec { minimalOCamlVersion = "4.06"; - useDune2 = true; + duneVersion = "2"; pname = "owee"; - version = "0.4"; + version = "0.6"; src = fetchurl { - url = "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; - sha256 = "sha256:055bi0yfdki1pqagbhrwmfvigyawjgsmqw04zhpp6hds8513qzvb"; + url = + "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; + sha256 = "sha256-GwXV5t4GYbDiGwyvQyW8NZoYvn4qXlLnjX331Bj1wjM="; }; - meta = { + meta = with lib; { description = "An experimental OCaml library to work with DWARF format"; homepage = "https://github.com/let-def/owee/"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.vbgl ]; + license = licenses.mit; + maintainers = with maintainers; [ vbgl alizter ]; }; } From 1d9610bb9330f12b615d697a5ff063314859fa3b Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Thu, 23 Mar 2023 17:48:54 +0100 Subject: [PATCH 3/4] ocamlPackages.magic-trace: init at 1.1.0 --- .../ocaml-modules/magic-trace/default.nix | 27 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 1 + 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/ocaml-modules/magic-trace/default.nix diff --git a/pkgs/development/ocaml-modules/magic-trace/default.nix b/pkgs/development/ocaml-modules/magic-trace/default.nix new file mode 100644 index 000000000000..1f1417f67275 --- /dev/null +++ b/pkgs/development/ocaml-modules/magic-trace/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage, async, cohttp_static_handler +, core_unix, owee, ppx_jane, shell }: + +buildDunePackage rec { + pname = "magic-trace"; + version = "1.1.0"; + + minimalOCamlVersion = "4.12"; + duneVersion = "3"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "magic-trace"; + rev = "v${version}"; + sha256 = "sha256-615AOkrbQI6vRosA5Kz3Epipe9f9+Gs9+g3bVl5gzBY="; + }; + + buildInputs = [ async cohttp_static_handler core_unix owee ppx_jane shell ]; + + meta = with lib; { + description = + "Collects and displays high-resolution traces of what a process is doing"; + license = licenses.mit; + maintainers = [ maintainers.alizter ]; + homepage = "https://github.com/janestreet/magic-trace"; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index e6da9aca10cb..3f8667af9ae7 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -895,6 +895,7 @@ let magic-mime = callPackage ../development/ocaml-modules/magic-mime { }; + magic-trace = callPackage ../development/ocaml-modules/magic-trace { }; mariadb = callPackage ../development/ocaml-modules/mariadb { inherit (pkgs) mariadb; From d1833117a89aca751b0a12220c933c33e9e74a03 Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Thu, 23 Mar 2023 18:37:20 +0100 Subject: [PATCH 4/4] ocamlPackages.spacetime_lib: patch for compat with owee 0.6 --- .../ocaml-modules/spacetime_lib/default.nix | 5 +++-- .../ocaml-modules/spacetime_lib/spacetime.diff | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff diff --git a/pkgs/development/ocaml-modules/spacetime_lib/default.nix b/pkgs/development/ocaml-modules/spacetime_lib/default.nix index 442d06e4f698..7e2e4002c1ea 100644 --- a/pkgs/development/ocaml-modules/spacetime_lib/default.nix +++ b/pkgs/development/ocaml-modules/spacetime_lib/default.nix @@ -6,8 +6,7 @@ lib.throwIfNot (lib.versionAtLeast "4.12" ocaml.version) buildDunePackage rec { pname = "spacetime_lib"; version = "0.3.0"; - - useDune2 = true; + duneVersion = "2"; src = fetchFromGitHub { owner = "lpw25"; @@ -16,6 +15,8 @@ buildDunePackage rec { sha256 = "0biisgbycr5v3nm5jp8i0h6vq76vzasdjkcgh8yr7fhxc81jgv3p"; }; + patches = [ ./spacetime.diff ]; + propagatedBuildInputs = [ owee ]; preConfigure = '' diff --git a/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff b/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff new file mode 100644 index 000000000000..baad34ce08b5 --- /dev/null +++ b/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff @@ -0,0 +1,14 @@ +diff --git a/src/elf_locations.ml b/src/elf_locations.ml +index a08b359..0db9274 100644 +--- a/src/elf_locations.ml ++++ b/src/elf_locations.ml +@@ -37,7 +37,8 @@ let resolve_from_dwarf t ~program_counter = + | Some section -> + let body = Owee_buf.cursor (Owee_elf.section_body t.map section) in + let rec aux () = +- match Owee_debug_line.read_chunk body with ++ let pointers_to_other_sections = Owee_elf.debug_line_pointers t.map t.sections in ++ match Owee_debug_line.read_chunk body ~pointers_to_other_sections with + | None -> () + | Some (header, chunk) -> + (* CR-soon mshinwell: fix owee .mli to note that [state] is