| 2 Jul 2022 |
sephi | (I’m just trying to install wagtail with poetry, but wagtail depends on an old beautifulsoup4 version that depends on a use_2to3 setuptools option, which is not available in setuptools>58, but poetry seems to force the use of setuptools 62 so I forked the wagtail repository to relax the dependency to beautifulsoup4, and I can’t just use a git dependency for my repository because it needs compiled files, which are excluded from the git repository) | 08:46:59 |
sephi | Anyway, I ended up removing all the .gitignore files and committed the compiled assets to the repository. I’m not proud of myself, but it should work ^^ | 08:47:33 |
| 4 Jul 2022 |
| rrrrrok joined the room. | 15:34:09 |
rrrrrok | Hi all, I'm trying to install a package that depends on the cryptography package and getting this error:
error: hash mismatch in fixed-output derivation '/nix/store/llmpxpnnnmiqg889bqqdxh21m84vczi4-cryptography-36.0.2-vendor.tar.gz.drv':
specified: sha256-kozYXkqt1Wpqyo9GYCwN08J+zV92ZWFJY/f+rulxmeQ=
got: sha256-6C4N445h4Xf2nCc9rJWpSZaNPilR9GfgbmKvNlSIFqg=
I see here that a number of modifications are applied for this package already, so maybe it's just a matter of them being outdated?
| 15:37:29 |
rrrrrok | I can't quite tell if this is something that I should just try to override somehow or if it needs to be fixed in poetry2nix | 15:48:01 |
| 5 Jul 2022 |
| dminuoso joined the room. | 07:36:14 |
dminuoso | Hi. Using current nixpkgs at nixos-22.05, I have a completely trivial call to mkPoetryApplication { projectDir = ./.; }, but it errors out with https://gist.github.com/dminuoso/7d9699a95e8c1cb0dafdd733d86bb1bd | 07:37:22 |
dminuoso | I am a bit baffled as to why it cant find --ldap_r | 07:37:47 |
dminuoso | After some trace debugging I have asserted that python-ldap receives openldap in its buildInputs, so there's that at least. | 08:07:59 |
| 6 Jul 2022 |
Linux Hackerman | In reply to @dminuoso:matrix.org I am a bit baffled as to why it cant find --ldap_r Hm, maybe try NIX_DEBUG=1 to get lots of output from the GCC wrapper? | 06:54:47 |
| thoth joined the room. | 06:55:29 |
thoth | Hello. I have an issue with the python-magic package (version 0.4.37)
substitute(): ERROR: file 'magic/loader.py' does not exist
It seems that the patch described in poetry2nix doesn’t work : https://github.com/nix-community/poetry2nix/blob/68da2697e1cf1376f8b6dc6121e1b5df08edcab8/overrides/default.nix#L1767-L1770
Do you know what I could do and if I should open an issue ?
| 06:58:17 |
thoth | * Hello. I have an issue with the python-magic package (version 0.4.37)
substitute(): ERROR: file 'magic/loader.py' does not exist
It seems that the patch described in poetry2nix doesn’t work : https://github.com/nix-community/poetry2nix/blob/68da2697e1cf1376f8b6dc6121e1b5df08edcab8/overrides/default.nix#L1767-L1770
It is strange : the magic/loader.py file exists in the python-magic repository 🤔
Do you know what I could do and if I should open an issue ?
| 06:59:57 |
dminuoso | linus: Thanks. After a good nights sleep and a helpful rubber duck I realized that the error was quite spot on.. and exactly the problem. | 12:55:22 |
dminuoso | Having openldap in buildInputs does not magically mean an ldap_r shared object can be found there. That derivation must actually produce that file too... | 12:55:55 |
dminuoso | In nixos-22.05 openldap was upgraded to 2.6, which no longer brings ldap_r.so | 12:56:15 |
Linux Hackerman | oh nice haha | 13:50:50 |
| 7 Jul 2022 |
thoth | In reply to @thoth101010:matrix.org
Hello. I have an issue with the python-magic package (version 0.4.37)
substitute(): ERROR: file 'magic/loader.py' does not exist
It seems that the patch described in poetry2nix doesn’t work : https://github.com/nix-community/poetry2nix/blob/68da2697e1cf1376f8b6dc6121e1b5df08edcab8/overrides/default.nix#L1767-L1770
It is strange : the magic/loader.py file exists in the python-magic repository 🤔
Do you know what I could do and if I should open an issue ?
I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the pip version ?
| 09:18:35 |
thoth | In reply to @thoth101010:matrix.org
Hello. I have an issue with the python-magic package (version 0.4.37)
substitute(): ERROR: file 'magic/loader.py' does not exist
It seems that the patch described in poetry2nix doesn’t work : https://github.com/nix-community/poetry2nix/blob/68da2697e1cf1376f8b6dc6121e1b5df08edcab8/overrides/default.nix#L1767-L1770
It is strange : the magic/loader.py file exists in the python-magic repository 🤔
Do you know what I could do and if I should open an issue ?
* I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I guess that I should write the override myself ?should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the pip version ?
| 09:19:48 |
thoth | * I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I guess that I should write the override myself ?should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the library version ?
| 09:21:02 |
thoth | * I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I guess that I should write the override myself ?should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the library version ?
| 09:32:51 |
thoth | * I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I guess that I should write the override myself ?should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the library version ?
| 09:33:12 |
thoth | * I found out that the file it edits exists in develop but not in the last stable version of python-magic. How can I use poetry2nix with an old version of override ? I guess that I should write the override myself ?should rewrite it myself I think ?
Isn’t it counterintuitive to have a replacement not suitable to the library version ? edit: wrong
| 09:36:49 |
thoth | Is it possible that the issue is that I use preferWheels = true ? How can I specify that I want to use stdist for one package ? (if I don’t use wheels I have issues with hatchling/hatch-vcs 🤕) | 09:54:22 |
thoth | * Is it possible that the issue is that I use preferWheels = true ? How can I specify that I want to use sdist for one package ? (if I don’t use wheels I have issues with hatchling/hatch-vcs 🤕) | 09:54:57 |
thoth | Noooooo. I achieved to use the sdist by using
overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend (self: super: {
python-magic = super.python-magic.overridePythonAttrs (
old: {
postPatch = ''
substituteInPlace magic/loader.py \
--replace "'libmagic.so.1'" "'${pkgs.lib.getLib pkgs.file}/lib/libmagic.so.1'"
'';
pythonImportsCheck = old.pythonImportsCheck or [] ++ ["magic"];
src = super.pythonPackages.fetchPypi {
pname = "python-magic";
version = "0.4.27";
sha256 = "c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b";
};
}
);
});
But it doesn’t work either 😭
And in the log I have
Using wheelUnpackPhase
But it’s not a wheel 🤔 (nix show-derivation shows that the file is a tar.gz and the hash is for the tar.gz)
Does anyone have an idea why it might not work ? Is there a way to "debug" the build and see wich files are there whene the substituteInPlace is lanched ?
| 10:16:15 |
gmacon | In reply to @thoth101010:matrix.org Is it possible that the issue is that I use preferWheels = true ? How can I specify that I want to use sdist for one package ? (if I don’t use wheels I have issues with hatchling/hatch-vcs 🤕) You should be able to override preferWheel = false for a single package if I'm reading this correctly: https://github.com/nix-community/poetry2nix/blob/abc47c71a4920e654e7b2e4261e3e6399bbe2be6/mk-poetry-dep.nix#L24. Alternatively, you could use preferWheels = false and override preferWheel = true for hatchling | 14:14:59 |
thoth | In reply to @gmacon:matrix.org You should be able to override preferWheel = false for a single package if I'm reading this correctly: https://github.com/nix-community/poetry2nix/blob/abc47c71a4920e654e7b2e4261e3e6399bbe2be6/mk-poetry-dep.nix#L24. Alternatively, you could use preferWheels = false and override preferWheel = true for hatchling Thank you for your answer !
I couldn’t use the preferWheel option:
overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend (self: super: {
python-magic = super.python-magic.override {
preferWheel = false;
};
The issue isn’t with hatchling but with a package requiring hatchling. It is fixed in master but a new poetry2nix version hasn’t been release yet. I solved this issue but I’ve had other issues : python-cryptography not building (something with rust build not having source), and a pip package requiring another pip package for build.
For now, I will continue to use poetry without poetry2nix by patching the loader.py file myself in the poetry venv dir. It is dirty but is the easiest solution 😔
| 17:25:24 |
thoth | In reply to @gmacon:matrix.org You should be able to override preferWheel = false for a single package if I'm reading this correctly: https://github.com/nix-community/poetry2nix/blob/abc47c71a4920e654e7b2e4261e3e6399bbe2be6/mk-poetry-dep.nix#L24. Alternatively, you could use preferWheels = false and override preferWheel = true for hatchling * Thank you for your answer !
I couldn’t make the preferWheel option :
overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend (self: super: {
python-magic = super.python-magic.override {
preferWheel = false;
};
The issue isn’t with hatchling but with a package requiring hatchling. It is fixed in master but a new poetry2nix version hasn’t been release yet. I solved this issue but I’ve had other issues : python-cryptography not building (something with rust build not having source), and a pip package requiring another pip package for build.
For now, I will continue to use poetry without poetry2nix by patching the loader.py file myself in the poetry venv dir. It is dirty but is the easiest solution 😔
| 17:25:38 |
thoth | * Thank you for your answer !
I couldn’t make the preferWheel option work :
overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend (self: super: {
python-magic = super.python-magic.override {
preferWheel = false;
};
For the preferWheels = false : the issue isn’t with hatchling but with a package requiring hatchling. It is fixed in master but a new poetry2nix version hasn’t been release yet. I solved this issue but I’ve had other issues : python-cryptography not building (something with rust build not having source), and a pip package requiring another pip package for build.
For now, I will continue to use poetry without poetry2nix by patching the loader.py file myself in the poetry venv dir. It is dirty but is the easiest solution 😔
| 17:26:08 |