Importing a remote package using flake-compat is now broken #60
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/flake-compat#60
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am not entirely sure if this is an issue with
hydra
's use offlake-compat
or aflake-compat
issue, but it seems to me like the following way of importing a nix package that usesflake-compat
should remain valid. At least I expect I am not the only one to import nix packages this way so I expect this to break other peoples builds as well.I have a dependency on
NixOS/hydra
(usingniv
) which under the hood usesflake-compat
:c1a5ff3959/default.nix (L4-L6)
In order to simplify the reproduction of the issue, we can get
niv
out of the way and simply usefetchTarball
.This used to work:
But it now breaks:
I believe the commit that introduces the issue is
bc5e257a8d
I have forked
NixOS/hydra
and modified thefetchTarball
offlake-compat
to a specific commit to showcase when it used to work and what it looks like now/on that first broken commit:Works:
Broken:
As a temporary fix for my dependency on
hydra
, I can inline theirdefault.nix
(I'm guessing this avoids the./.
in there which could be ambiguous):(this works with
niv
to fetch the source as well)Weird. The cause appears to be that
seems to lose the dependency (string content) on
sourceInfo.outPath
(e.g./nix/store/xwvjm5dxj60h6js47la34jv6xshr4rh1-source
above), so the generated derivation source not have itssrc
attribute in theinputSrcs
. Hence why the build does succeed if you pass--no-sandbox
. This looks like a Nix bug because it shouldn't lose track of a dependency.Changing that line to
makes it work, although that results in double copying (e.g.
/nix/store/rs0gf70y4h7c8ffmv3cfrhmsvzqd02wf-xvyczslhxf5zm12df5s8csijkbdrs7i0-source
). Even better issince that avoids the double copy.
Great! 😄 Thanks for the quick fix and explanation.
I did not even think that it could be a
nix
/sandbox
thing 😅I think this fix broke other things, since my CI is failing after picking-up this change: https://github.com/lovesegfault/nix-config/pull/3014
@lovesegfault I've tweaked my fix a bit, does it work now?
@edolstra Yup! CI passed and auto-merged. Thanks for the swift fix!