Open turion opened 9 months ago
I can observe a memory leak with v0.1.0 (37c9075875c4d1c1466465afd5e2c3ea1cc50325) as well. The last commit that worked was: 3ad2c9512c9efd586cf63adde454e734a8ce049c
Sorry, it seems there is some interaction with a particular nixpkgs version, maybe it's not jupyenv's fault. Let me close until I understand it better.
This problem seems to be solved after removing nixpkgs.follows = "nixpkgs";
in my code.
I'm afraid the problem does indeed persist. After updating with nix flake update
, the problem is back because for some reason I don't understand, it does update the jupyenv/nixpkgs
input.
It seems that jupyenv
doesn't work with nixpkgs revision f5892ddac112a1e9b3612c39af1b72987ee5783a.
A working combination is jupyenv
https://github.com/tweag/jupyenv/commit/97f76f92fa14814e955a4f6847eaa4198525a19e with nixpkgs
revision 18036c0be90f4e308ae3ebcab0e14aae0336fe42.
My minimal reproducer:
{
description = "A very basic flake";
inputs = {
jupyenv = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:tweag/jupyenv";
};
};
outputs = { self, nixpkgs, jupyenv }:
let system = "x86_64-linux";
in {
devShells.x86_64-linux.default = with import nixpkgs { inherit system; }; mkShell {
packages = [
(jupyenv.lib.${system}.mkJupyterlabNew {})
];
};
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}
Running nix develop
in a folder with this file triggers the bug.
The two input locks:
jupyenv: github:tweag/jupyenv/97f76f92fa14814e955a4f6847eaa4198525a19e
nixpkgs: github:NixOS/nixpkgs/f902cb49892d300ff15cb237e48aa1cad79d68c3
# FIXME: pkgs.poetry is segfaulting on nixpkgs-unstable & poetry2nix
https://github.com/nix-community/poetry2nix/issues/1291
https://github.com/nix-community/poetry2nix/issues/1316
see #524
Indeed, adding inputs.jupyenv.inputs.poetry2nix.url = "github:nix-community/poetry2nix/?ref=refs/pull/1329/head";
fixes the issue.
To illustrate the bug, I created https://github.com/turion/jupyenv-bug/. Reproduce like this:
$ git clone git@github.com:turion/jupyenv-bug.git
$ git branch --show-current
main
$ nix develop # This will work fine, feel free to abort
$ git checkout follow
$ git diff main -- flake.nix
diff --git a/flake.nix b/flake.nix
index 123f264..946ad46 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,6 +3,7 @@
inputs = {
jupyenv = {
+ inputs.nixpkgs.follows = "nixpkgs";
url = "github:tweag/jupyenv";
};
};
$ nix develop # This will OOM, be sure to cancel before your machine becomes unresponsive!
$ git checkout resolution
$ git diff main -- flake.nix
diff --git a/flake.nix b/flake.nix
index 123f264..7b13f75 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,6 +3,8 @@
inputs = {
jupyenv = {
+ inputs.nixpkgs.follows = "nixpkgs";
+ inputs.poetry2nix.url = "github:nix-community/poetry2nix/?ref=refs/pull/1329/head";
url = "github:tweag/jupyenv";
};
};
$ nix develop # This will work again
Current Behavior
In https://github.com/tweag/monad-bayes/pull/304/commits/5d08e7c3e790edc331466eeeeaa599528a5e076c I bumped our jupyenv version to revision 97f76f92fa14814e955a4f6847eaa4198525a19e. This causes
nix develop
to go into a memory-leaking infinite loop.Expected Behavior
Just evaluating
nix develop
Steps To Reproduce
nix develop
OS
Version
97f76f92fa14814e955a4f6847eaa4198525a19e
Additional Context
Running
nix develop -vvv
gives this ever repeating loop:Relevant log output