| 8 Nov 2023 |
matthewcroughan | diff --git a/flake.nix b/flake.nix
index 6ed975e..9425b45 100644
--- a/flake.nix
+++ b/flake.nix
@@ -28,12 +28,6 @@
chroma-hnswlib = super.chroma-hnswlib.override { preferWheel = true; };
chromadb = super.chromadb.override { preferWheel = true; };
cmake = pkgs.python3Packages.cmake;
- triton = super.triton.overridePythonAttrs
- (
- old: {
- nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.cmake ];
- }
- );
gradio = super.gradio.overridePythonAttrs
(
old: {
| 22:11:33 |
adisbladis | Which you don't actually want to do, least of which because upstream doesn't actually ship sdists: https://github.com/imartinez/privateGPT/blob/main/poetry.lock#L4598-L4617 | 22:11:35 |
adisbladis | Only wheels | 22:11:37 |
adisbladis | We don't have any overrides in poetry2nix adding cmake to triton, so idk what you're doing | 22:12:41 |
adisbladis | Also this is 100% wrong https://github.com/MatthewCroughan/privateGPT/blob/main/flake.nix#L30 | 22:12:47 |
adisbladis | And will cause shit to explode | 22:12:53 |
adisbladis | Never ever reference an outside python package set | 22:13:01 |
matthewcroughan | oh, it made everything else compile, hah | 22:13:05 |
matthewcroughan | python3.11-cmake> obj = import_module(mod_path)
python3.11-cmake> ^^^^^^^^^^^^^^^^^^^^^^^
python3.11-cmake> File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/importlib/__init__.py", line 126, in import_module
python3.11-cmake> return _bootstrap._gcd_import(name[level:], package, level)
python3.11-cmake> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
python3.11-cmake> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
python3.11-cmake> ModuleNotFoundError: No module named 'setuptools'
python3.11-cmake>
python3.11-cmake>
| 22:13:28 |
matthewcroughan | if I remove it, something depends on it, and cmake itself fails like this | 22:13:37 |
matthewcroughan | I add setuptools, it requires cmake binary, etc | 22:13:44 |
matthewcroughan | https://github.com/nix-community/poetry2nix/pull/1132 | 22:13:53 |
matthewcroughan | it's depending on this PR | 22:13:57 |
matthewcroughan | I copied what's in this PR, but was still unable to get anywhere, because I need a newer one, and the challenges I faced seemed too hard | 22:14:29 |
matthewcroughan | so I referenced the outside python package set, and that made everything compile | 22:14:50 |
adisbladis | You need to start by fixing that, because with that there the whole thing is cursed | 22:15:13 |
adisbladis | And for that cmake issue look into dontUseCmakeConfigure | 22:16:56 |
adisbladis | Idk where you're getting cmake from or how the hook enters the build | 22:17:28 |
matthewcroughan | it's in the poetry.lock of privateGPT | 22:18:13 |
matthewcroughan | https://github.com/imartinez/privateGPT/blob/main/poetry.lock#L551-L556 | 22:18:35 |
matthewcroughan | so this is the current thing I'm dealing with, trying to build cmake without using the one from nixpkgs | 22:19:41 |
matthewcroughan | cmake = super.cmake.overridePythonAttrs (
old: let
cmake-src = pkgs.fetchgit {
url = "https://gitlab.kitware.com/cmake/cmake.git";
rev = "v" + super.cmake.version;
sha256 = "sha256-Y5YagT0FhWQCi99T1FNQHEfxEct3qk/esL8msll5g1k=";
};
in{
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.cmake pkgs.ninja pkgs.glibc ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.cmake ];
CMAKE_ARGS = "-DCMakeProject_SOURCE_DIR='${cmake-src}'";
dontUseCmakeConfigure = true;
}
);
| 22:19:44 |
adisbladis | Anyway, that's the nixpkgs cmake hook doing it's thing | 22:19:50 |
adisbladis | And you can opt out of it using dontUseCmakeConfigure | 22:20:01 |
matthewcroughan | This is my override, and it needs setuptools because:
python3.11-cmake> File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/importlib/__init__.py", line 126, in import_module
python3.11-cmake> return _bootstrap._gcd_import(name[level:], package, level)
python3.11-cmake> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
python3.11-cmake> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
python3.11-cmake> File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
python3.11-cmake> ModuleNotFoundError: No module named 'setuptools'
python3.11-cmake>
python3.11-cmake>
| 22:20:13 |
adisbladis | Then add setuptools, and also set dontUseCmakeConfigure for triton | 22:20:30 |
matthewcroughan | But I can't, because I need to fix cmake first like you said | 22:20:47 |
matthewcroughan | so cmake after providing setuptools needs skbuild | 22:20:59 |
matthewcroughan | python3.11-cmake> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-cmake> File "/nix/store/c2g2jfc4bxk447qh1ddljdw17nwmn4kg-python3.11-setuptools-68.2.2/lib/python3.11/site-packages/setuptools/build_meta.py", line 396, in prepare_metadata_for_build_wheel
python3.11-cmake> self.run_setup()
python3.11-cmake> File "/nix/store/c2g2jfc4bxk447qh1ddljdw17nwmn4kg-python3.11-setuptools-68.2.2/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
python3.11-cmake> exec(code, locals())
python3.11-cmake> File "<string>", line 8, in <module>
python3.11-cmake> ModuleNotFoundError: No module named 'skbuild'
| 22:21:00 |
matthewcroughan | so I add it, and then all hell breaks loose :D | 22:21:13 |