| 17 Jan 2022 |
adisbladis | mou: I'm also attempting an alternative fix in https://github.com/nix-community/poetry2nix/pull/511 | 10:10:35 |
mou | Cool. Will wait till merge and then remove my explicit dependency on setuptools | 10:11:46 |
adisbladis | In reply to @mou_bugtracker:matrix.org Cool. Will wait till merge and then remove my explicit dependency on setuptools I've already merged the first fix. | 10:12:00 |
adisbladis | Since it fixes the immediate issue | 10:12:14 |
adisbladis | Then we'll see about the more principled fix | 10:12:24 |
mou | Just updated poetry2nix and encountered error i'm pretty sure does not seen before
pyproject.toml
name = "poetry2nix-ref-rev"
version = "0.1.0"
description = ""
authors = ["Andrey Larionov <anlarionov@gmail.com>"]
[tool.poetry.dependencies]
python = "^3.9"
uengine = { git = "https://github.com/mou/uengine.git", rev = "9331977689e49a59cded336247f8cd54ae989b94" }
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
flake.nix
description = "poetry2nix minimal project to reproduce rev-ref bug";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.poetry2nix.url = "github:nix-community/poetry2nix";
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
{
# Nixpkgs overlay providing the application
overlay = nixpkgs.lib.composeManyExtensions [
poetry2nix.overlay
(final: prev: {
# The application
refrev = prev.poetry2nix.mkPoetryApplication {
projectDir = ./.;
};
})
];
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in
rec {
apps = {
refrev = pkgs.refrev;
};
defaultApp = pkgs.refrev;
packages = {
refrev = pkgs.refrev;
};
defaultPackage = pkgs.refrev;
}));
}
nix build --show-trace
error: program 'git' failed with exit code 128
… while fetching the input 'git+https://github.com/mou/uengine.git?ref=9331977689e49a59cded336247f8cd54ae989b94&rev=9331977689e49a59cded336247f8cd54ae989b94'
… while evaluating the attribute 'src.name'
at /nix/store/90rq6828hgygs5h3shm4zgn810h9xa8b-source/mk-poetry-dep.nix:169:7:
168| # Here we can then choose a file based on that info.
169| src =
| ^
170| if isGit then
… while evaluating 'hasSuffix'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/lib/strings.nix:234:5:
233| # Input string
234| content:
| ^
235| let
… from call site
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/pkgs/development/interpreters/python/mk-python-derivation.nix:127:25:
126| pythonRemoveBinBytecodeHook
127| ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
| ^
128| unzip
… while evaluating 'optionals'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/lib/lists.nix:270:5:
269| # List to return if condition is true
270| elems: if cond then elems else [];
| ^
271|
… from call site
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/pkgs/development/interpreters/python/mk-python-derivation.nix:127:10:
126| pythonRemoveBinBytecodeHook
127| ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
| ^
128| unzip
… while evaluating 'chooseDevOutputs'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/lib/attrsets.nix:498:22:
497| /* Pick the outputs of packages to place in buildInputs */
498| chooseDevOutputs = drvs: builtins.map getDev drvs;
| ^
499|
… from call site
… while evaluating the attribute 'nativeBuildInputs' of the derivation 'python3.9-uengine-3.6.14'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/pkgs/stdenv/generic/make-derivation.nix:205:7:
204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
205| name =
| ^
206| let
… while evaluating the attribute 'out.outPath'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/lib/customisation.nix:157:13:
156| drvPath = assert condition; drv.${outputName}.drvPath;
157| outPath = assert condition; drv.${outputName}.outPath;
| ^
158| };
… while evaluating the attribute 'propagatedBuildInputs' of the derivation 'python3.9-poetry2nix-ref-rev-0.1.0'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/pkgs/stdenv/generic/make-derivation.nix:205:7:
204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
205| name =
| ^
206| let
… while evaluating the attribute 'drvPath'
at /nix/store/m41jr4nfb4vxf39nwqvc9sx68xi04gar-source/lib/customisation.nix:163:7:
162| in commonAttrs // {
163| drvPath = assert condition; drv.drvPath;
| ^
164| outPath = assert condition; drv.outPath;
I'm not sure but looks like revision is also placed in position of reference when fetching from git. Pretty sure at least couple of week ago i did not saw this error for similar dependencies.
| 10:47:04 |
mou | missed line preceeding log above
fetching Git repository 'https://github.com/mou/uengine.git'fatal: couldn't find remote ref refs/heads/9331977689e49a59cded336247f8cd54ae989b94 | 10:47:56 |
adisbladis | I think you may have run in to https://github.com/nix-community/poetry2nix/pull/424 | 10:54:25 |
mou | hmm. i'm looking into mk-poetry-dep.nix
171 (
172 builtins.fetchGit {
173 inherit (source) url;
174 rev = source.resolved_reference or source.reference;
175 ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
176 }
177 )
looks like if source has no branch specification, then ref will get binding to sourceSpec.rev. Which is cause constructing url git+https://github.com/mou/uengine.git?ref=9331977689e49a59cded336247f8cd54ae989b94&rev=9331977689e49a59cded336247f8cd54ae989b94
I'm total newbie and migth not understand completly what this code does.
| 11:07:02 |
mou | after i updated dependency specification to contain branch element
uengine = { git = "https://github.com/mou/uengine.git", branch="nix-flakes-integration", rev = "9331977689e49a59cded336247f8cd54ae989b94" }
nix build proceed | 11:13:04 |
mou | i'm still not sure is it bug or not, but it's really looks like binding revision to reference is not intended | 11:14:25 |
mou | Also naming attributes resolved_reference and reference is a bit confusing, because it's contradicts with VCS term reference | 11:18:26 |
mou | Just read carefully documentation for fetchGit. Looks like i'm wrong trying to fetch non main revision and not specifying branch. But if this is required, using revision in place of head reference at least make error confusing. | 11:28:54 |
mou | Also in issue referenced in issue you linked, mentioned new flag allRefs which allows to omit ref attribute, to search revision across all heads. | 11:35:55 |
mou | * Also in issue referenced in issue you linked, mentioned new attribute for fetchGit allRefs which allows to omit ref attribute, to search revision across all heads. | 11:36:14 |
mou | So i disagree with the reasoning for closing linked proposed PR. Switching to allRefs to not pass rev as ref is correct and conforms to nix upstream stdlib. | 11:43:12 |
| 18 Jan 2022 |
| das-g joined the room. | 14:02:53 |
das-g | Heya | 14:12:41 |
das-g | I tried using the template as described in the README. | 14:13:31 |
das-g | nix flake init --template github:nix-community/poetry2nix
| 14:13:54 |
das-g | when I try any of the new nix commands (nix shell, nix develop, nix build) after that, I get
error: flake 'path:/home/das-g/tmp/imgapp' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'
| 14:15:05 |
das-g | Shouldnt flake-utils.lib.eachDefaultSystem here in the template take care of that? Am I doing something wrong? | 14:16:42 |
das-g | * I tried using the poetry2nix flake template as described in the README. | 14:17:07 |
das-g | * When I try any of the new nix commands (nix shell, nix develop, nix build) after that, I get
error: flake 'path:/home/das-g/tmp/imgapp' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'
| 14:17:21 |
das-g | * When I try any of the new nix commands (nix shell, nix develop, nix build) after that, I get
error: flake 'path:/home/das-g/tmp/imgapp' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'
for nix develop and
error: flake 'path:/home/das-g/tmp/imgapp' does not provide attribute 'packages.x86_64-linux.defaultPackage.x86_64-linux', 'legacyPackages.x86_64-linux.defaultPackage.x86_64-linux' or 'defaultPackage.x86_64-linux'
for nix build and nix shell.
| 14:22:18 |
das-g | oh, wait, it sets defaultApp in there, but not defaultPackage. | 14:27:17 |
| tcelferact joined the room. | 17:57:12 |
tcelferact | Hi folks, I'm struggling to define an override that will get msgpack to build on an M1 mac. It looks like poetry2nix builds a wheel that it can't then run:
Created wheel for msgpack: filename=msgpack-1.0.2-cp37-cp37m-macosx_11_0_arm64.whl size=67561 sha256=141d4aff3d7453e3411c0ffb7daeaf68bececd4aff7054d41a616a07a9ba7036
Stored in directory: /private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/pip-ephem-wheel-cache-i7nzg6nu/wheels/04/ab/f5/eee33f4ffc30671d9708fc39bd5968a5c1c35e3867f17ff387
Successfully built msgpack
Removed build tracker: '/private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/pip-req-tracker-ghv1i0v0'
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/msgpack-1.0.2/dist /private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/msgpack-1.0.2
ERROR: msgpack-1.0.2-cp37-cp37m-macosx_11_0_arm64.whl is not a supported wheel on this platform.
builder for '/nix/store/f2zf6z5k2120z7f8h7qcjvi34bz4iy4w-python3.7-msgpack-1.0.2.drv' failed with exit code 1
I'm way off understanding how to fix this, although I have tried an addPoetry style override which didn't work:
msgpack = super.msgpack.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.poetry-core ];
}
);
Can anyone offer advice? Thanks!
| 18:00:07 |
| 19 Jan 2022 |
adisbladis | In reply to @tcelferact:matrix.org
Hi folks, I'm struggling to define an override that will get msgpack to build on an M1 mac. It looks like poetry2nix builds a wheel that it can't then run:
Created wheel for msgpack: filename=msgpack-1.0.2-cp37-cp37m-macosx_11_0_arm64.whl size=67561 sha256=141d4aff3d7453e3411c0ffb7daeaf68bececd4aff7054d41a616a07a9ba7036
Stored in directory: /private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/pip-ephem-wheel-cache-i7nzg6nu/wheels/04/ab/f5/eee33f4ffc30671d9708fc39bd5968a5c1c35e3867f17ff387
Successfully built msgpack
Removed build tracker: '/private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/pip-req-tracker-ghv1i0v0'
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/msgpack-1.0.2/dist /private/tmp/nix-build-python3.7-msgpack-1.0.2.drv-0/msgpack-1.0.2
ERROR: msgpack-1.0.2-cp37-cp37m-macosx_11_0_arm64.whl is not a supported wheel on this platform.
builder for '/nix/store/f2zf6z5k2120z7f8h7qcjvi34bz4iy4w-python3.7-msgpack-1.0.2.drv' failed with exit code 1
I'm way off understanding how to fix this, although I have tried an addPoetry style override which didn't work:
msgpack = super.msgpack.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.poetry-core ];
}
);
Can anyone offer advice? Thanks!
That override has nothing to do with the underlying problem, which I'm guessing might have something to do with your setuptools version | 03:27:39 |
| K900 joined the room. | 06:59:07 |