| 21 May 2021 |
jschievink | ah, I see | 12:40:28 |
jschievink | thanks! | 12:40:30 |
| 7c6f434c joined the room. | 13:07:46 |
sephi | I’ve hit a new error when building my derivation:
File "lib/app/interactive/dune", line 5, characters 51-74:
5 | (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "shell.filename_extended" not found.
Since I have pkgs.ocamlPackages.shell in my buildInputs, I’d like to check what pkgs.ocamlPackages.shell is, so I tried nix edit nixpkgs.ocamlPackages.shell and it opened pkgs/development/ocaml-modules/janestreet/janePackage_0_13.nix (which is more or less this https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix), which takes a pname and seems to be called here https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/ocaml-packages.nix#L1288. I don’t understand where the value of the pname parameter comes from, nor where the shell derivation is defined. Any idea?
| 13:46:03 |
Regnat | In reply to @sephi:matrix.org
I’ve hit a new error when building my derivation:
File "lib/app/interactive/dune", line 5, characters 51-74:
5 | (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "shell.filename_extended" not found.
Since I have pkgs.ocamlPackages.shell in my buildInputs, I’d like to check what pkgs.ocamlPackages.shell is, so I tried nix edit nixpkgs.ocamlPackages.shell and it opened pkgs/development/ocaml-modules/janestreet/janePackage_0_13.nix (which is more or less this https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix), which takes a pname and seems to be called here https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/ocaml-packages.nix#L1288. I don’t understand where the value of the pname parameter comes from, nor where the shell derivation is defined. Any idea?
I guess it comes from https://github.com/NixOS/nixpkgs/blob/nixos-20.09/pkgs/development/ocaml-modules/janestreet/0.13.nix#L406-L412 | 13:54:24 |
sephi | Good catch, thanks! | 13:59:01 |
sterni | In reply to @sephi:matrix.org
I’ve hit a new error when building my derivation:
File "lib/app/interactive/dune", line 5, characters 51-74:
5 | (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "shell.filename_extended" not found.
Since I have pkgs.ocamlPackages.shell in my buildInputs, I’d like to check what pkgs.ocamlPackages.shell is, so I tried nix edit nixpkgs.ocamlPackages.shell and it opened pkgs/development/ocaml-modules/janestreet/janePackage_0_13.nix (which is more or less this https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix), which takes a pname and seems to be called here https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/ocaml-packages.nix#L1288. I don’t understand where the value of the pname parameter comes from, nor where the shell derivation is defined. Any idea?
depends on the ocaml vresion you are using | 14:35:36 |
sterni | In reply to @sephi:matrix.org
I’ve hit a new error when building my derivation:
File "lib/app/interactive/dune", line 5, characters 51-74:
5 | (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "shell.filename_extended" not found.
Since I have pkgs.ocamlPackages.shell in my buildInputs, I’d like to check what pkgs.ocamlPackages.shell is, so I tried nix edit nixpkgs.ocamlPackages.shell and it opened pkgs/development/ocaml-modules/janestreet/janePackage_0_13.nix (which is more or less this https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix), which takes a pname and seems to be called here https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/ocaml-packages.nix#L1288. I don’t understand where the value of the pname parameter comes from, nor where the shell derivation is defined. Any idea?
* depends on the ocaml version you are using | 14:35:43 |
sterni | for recent versions it's in pkgs/development/ocaml-modules/janestreet/0.14.nix | 14:36:08 |
sephi | Sorry for asking that many questions: I’m now trying to use dune to compile the filename_extended package that’s in the shell package (which doesn’t seem to be included in pkgs.ocamlPackages.shell). I thought I could just set pname = "filename_extended"; and the build phase would run dune build -p filename_extended and it would work, but for some reason it doesn’t:
[nix-shell:/tmp/shell]$ dune build -p filename_extended
Error: I don't know about package filename_extended (passed through -p)
Does anyone know how to build "subpackages"? I’ve also tried shell.filename_extended without success
| 14:45:55 |
sephi | * Sorry for asking so many questions: I’m now trying to use dune to compile the filename_extended package that’s in the shell package (which doesn’t seem to be included in pkgs.ocamlPackages.shell). I thought I could just set pname = "filename_extended"; and the build phase would run dune build -p filename_extended and it would work, but for some reason it doesn’t:
[nix-shell:/tmp/shell]$ dune build -p filename_extended
Error: I don't know about package filename_extended (passed through -p)
Does anyone know how to build "subpackages"? I’ve also tried shell.filename_extended without success
| 14:46:05 |
| Zane joined the room. | 14:46:23 |
Milan (they/them) 🏳️⚧️ | Asking questions is just fine! However #nix:nixos.org might be a better place for these. | 14:46:54 |
symphorien | In reply to @sephi:matrix.org
Sorry for asking so many questions: I’m now trying to use dune to compile the filename_extended package that’s in the shell package (which doesn’t seem to be included in pkgs.ocamlPackages.shell). I thought I could just set pname = "filename_extended"; and the build phase would run dune build -p filename_extended and it would work, but for some reason it doesn’t:
[nix-shell:/tmp/shell]$ dune build -p filename_extended
Error: I don't know about package filename_extended (passed through -p)
Does anyone know how to build "subpackages"? I’ve also tried shell.filename_extended without success
is is because there is a rewrite of - to _ or something like that ? | 14:49:40 |
sephi | Thanks, I’ll try there :) (btw I feel the channel description could be improved to mention packaging, I thought the channel was just for questions/discussions about the language itself) | 14:49:23 |
sephi | symphorien: doesn’t seem so (I’ve tried both but none of them worked) | 14:55:59 |
sterni | they should usually all be present automatically, maybe you are referencing a version that doesn't have the subpackage? | 15:00:24 |
sephi | Well if I just run dune build without any package names, then all packages get built. Maybe that’s how I should do it? Just run dune build in the buildPhase, omitting the -p? | 15:04:12 |
sterni | shell.filename_extended should be present if you build shell | 15:11:33 |
sterni | sephi: at least for ocamlPackages_4_12 (which has shell 0.14.0) it is present: grep -C 2 filename_extended $(nix-build -A ocamlPackages.shell)/lib/ocaml/4.12.0/site-lib/shell/dune-package | 15:15:50 |
sterni | what version of nixpkgs are you using? | 15:17:03 |
sterni | okay seems somewhat recent | 15:20:07 |
sephi | I’m using nixos-unstable ("21.05pre289339.83d907fd760") | 15:20:06 |
sterni | what is the current set of expressions you have? | 15:20:34 |
sephi | But from what I can see you’re right, the filename_extended plugin seems bundled in the package | 15:20:48 |
sterni | yeah subpackages should be :) | 15:21:15 |
sephi | Here’s my derivation:
let
pkgs = import <nixos-unstable> { };
in pkgs.ocamlPackages.buildDunePackage rec {
pname = "comby";
version = "1.5.1";
useDune2 = true;
minimumOcamlVersion = "4.11.0";
src = pkgs.fetchFromGitHub {
owner = "comby-tools";
repo = pname;
rev = version;
sha256 = "1ipfrr6n1jyyryhm9zpn8wwgzfac1zgbjdjzrm00qcwc17r8x2hf";
};
buildInputs = [
pkgs.zlib
pkgs.pkg-config-unwrapped
pkgs.ocamlPackages.ppx_deriving
pkgs.ocamlPackages.ppx_deriving_yojson
pkgs.ocamlPackages.ppx_sexp_conv
pkgs.ocamlPackages.ppx_jane
pkgs.ocamlPackages.ppx_expect
pkgs.ocamlPackages.dune-configurator
pkgs.ocamlPackages.lwt
pkgs.ocamlPackages.parany
pkgs.ocamlPackages.patience_diff
pkgs.ocamlPackages.core
pkgs.ocamlPackages.toml
pkgs.ocamlPackages.shell
pkgs.ocamlPackages.cohttp-lwt-unix
pkgs.ocamlPackages.mparser
pkgs.ocamlPackages.opium
pkgs.ocamlPackages.textutils
pkgs.ocamlPackages.jst-config
pkgs.ocamlPackages.shell
];
buildPhase = "dune build";
}
| 15:21:45 |
hexa | The highlighting is awesome, it shows you added pkgs.ocamlPackages.shell twice :D | 15:22:37 |
ajs124 | In reply to @hexa:lossy.network The highlighting is awesome, it shows you added pkgs.ocamlPackages.shell twice :D it also parses that as a url? | 15:38:20 |
Sandro | it should because .shell is a valid tld | 15:39:11 |