Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with opium framework(OCaml) version #186985

Open
OnofreTZK opened this issue Aug 16, 2022 · 1 comment
Open

Help with opium framework(OCaml) version #186985

OnofreTZK opened this issue Aug 16, 2022 · 1 comment

Comments

@OnofreTZK
Copy link

Issue description

Some of my personal projects use versions 0.19.0 and 0.20.0 of opium and the one available at ocamlPackages is 0.18.0. This is breaking everything due to a change in http client(cohttp to httpaf) and other refactorations.

I've tried some configs in order to customize my nix-shell but I didn't manage make it work.

I came here to ask for help

Steps to reproduce

my opium-overlay.nix:

self: super: {
  opium_kernel = super.ocaml-ng.ocamlPackages_4_12.opium_kernel.overrideAttrs (old: rec {
    pname = "opium";
    version = "0.20.0";

    useDune2 = true;

    minimalOCamlVersion = "4.12.1";

    src = super.fetchurl {
      url = "https://github.com/rgrinberg/opium/releases/download/${version}/opium-${version}.tbz";
      sha256 = "09ygcxxd5warkdzz17rgpidrd0pg14cy2svvnvy1hna080lzg7vp";
    };
    
    meta = with super.lib; {
      homepage = "https://github.com/rgrinberg/opium";
      description = "Sinatra like web toolkit for OCaml";
      license = licenses.mit;
      maintainers = [ maintainers ];
    };
  });
  
}

my shell.nix:

let
  pkgs = import <nixpkgs> {
    overlays = [
      (import ./opium-overlay.nix)
    ];
  };
  ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_12;
  #updated_opium = pkgs.callPackage ./opium-overlay.nix { };
in
pkgs.mkShell {
  # build tools
  nativeBuildInputs = with ocamlPackages; [ 
    ocaml 
    findlib 
    dune_2 
    ocaml-lsp 
  ];
  
  # dependencies
  buildInputs = with ocamlPackages; [ 
    caqti
    caqti-lwt
    caqti-driver-postgresql 
    uuidm
    ppx_deriving_yojson
    lwt_ppx
    cohttp-lwt-unix
    mirage-crypto-rng
    sha
    cmdliner
    httpaf
    fmt
    mtime
    ptime
    magic-mime
    mirage-crypto
    re
    uri
    result
    astring
    base64
    alcotest
    qcheck-alcotest
    opium
  ];
}

Technical details

The shell is launching without problems but the version of opium still 0.18.0.

@vbgl
Copy link
Contributor

vbgl commented Jan 22, 2023

opium has been updated to 0.20.0: #206977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants