Closed PaulGrandperrin closed 2 years ago
Thank you for this MR.
I'm not against it, but I'm afraid user will always hit the libc incompatibility that you perfectly described in the documentation.
Could you try to change this part of the document so it is obvious to the user that they need to use the same nixpkgs clone as the one used by their program and if they did not, they will have undefined behavior (it can be crashs, error message as described, or corrupted outputs).
If you have enough motivation to reword the documentation this way, please do it now. Otherwise, tell me, we'll merge the MR and work on the documentation improvement later.
Ok I'll do that but just to understand things correctly, is the requirement:
nixGL
's nixpkgs
be strictly the same of the one from the programnixGL
's nixpkgs
the same or older than the one from the programMy limited tests made it look like 2. was true. However, I don't know if it's always true.
It would be nice if there was a convention of an alias in the flake registry pointing to the current system nixpkgs...
Ok I'll do that but just to understand things correctly, is the requirement:
- that
nixGL
'snixpkgs
be strictly the same of the one from the program- that
nixGL
'snixpkgs
the same or older than the one from the programMy limited tests made it look like 2. was true. However, I don't know if it's always true.
I guarantee nothing with 2, however it works most of the time as you observed.
We observe problems with libc
, so in theory, because this lib is backward compatible, as long as nixpkgs
is the same or older, it should be fine. However we may have issue with any other lib which appears in the dependencies of the opengl driver.
I just had a need for this PR and it worked perfectly, thanks!
Shouldn't the nixpkgs override example be the first one to avoid issue, and If mixing different nixpkgs is likely to fail, why not removing the problematic example?
Also perhaps it might be good to note that other flakes should "forward" their nixpkgs using: nixGL.inputs.nixpkgs.follows = "nixpkgs";
in their input declaration.
I just had a need for this PR and it worked perfectly, thanks!
Cool!
Shouldn't the nixpkgs override example be the first one to avoid issue, and If mixing different nixpkgs is likely to fail, why not removing the problematic example?
I was making three assumptions:
nixGL
would be using the default channel of the non-Nixos version of Nix: nixpkgs-unstable
nixGL
's dependencies were older, it would still work the vast majority of the time (maybe always)The documentation about how to deal with the potential error is just below, so I was thinking it was ok.
Also perhaps it might be good to note that other flakes should "forward" their nixpkgs using:
nixGL.inputs.nixpkgs.follows = "nixpkgs";
in their input declaration.
Yes!
I updated the doc:
nixpkgs
version is explicitly statednixpkgs
from the registry, which defaults to nixpkgs-unstable
, which should be the same as most nixGL
's usersLGTM!
Thank you very much for this work.
ahah, I just pushed a small change!
I deleted the flake.lock so that the client will always pick up the latest version.
@guibou that's something that I wanted to test but I think this is not a good idea. It doesn't work like I wanted.
The issue is that users will get this error:
nix run --impure github:guibou/nixGL -- glxgears
error: cannot write modified lock file of flake 'github:guibou/nixGL' (use '--no-write-lock-file' to ignore)
(use '--show-trace' to show detailed location information)
It is already possible to launch
nixGL
directly from the command line, but it is far from easy. This is how I did it:Because only an overlay is provided, we need to manually instantiate it with a
nixpkgs
flake, and then patch the package to havenix run
find the correct binary to launch.With this PR, things becomes much easier and I updated the documentation accordingly.