-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: provide nixd
package that works with stable nix
#229
Comments
It would also be nice if the |
Does nixd actually conflict with stable versions?
Cannot nixd users use the stable version of nix at the same time? e.g. {
environmentPackages = with pkgs; [
nix
nixd
];
} I have asked some question at the Nix Language matrix room. Looks like the databases in nix is backward-compatible. This is non-trivialThe C++ libraries provided by NixOS/nix are not ABI-compatible, which means you need to maintain forks of these versions, not in a single repository. Due to this reason, there is no trivial way to provide a series of nixd versions linking with the nix library. |
I expressed my original concern poorly, this is the key point:If
Line 57 in b835f4e
This was key word in my original post:
Examples where this can be problematic for a
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
(Of course this is for you to decide, but my preference would be what I mentioned in my previous comment:
the
nix
of the contemporary stable nixos branch
I recently encountered some segfaults and other errors with nix 2.15.1
and switching to 2.13.3
solved them all)
which means you need to maintain forks of these versions, not in a single repository
I've never done any serious C++ development, and have never worked with meson
, but I don't understand this need for forks. I think you could easily refer to different versions by pinning each version and mapping it to a separate output, no? E.g. with flakes:
{
inputs = {
nix-2-15-1 = "github:nixos/nix?ref=2.15.1";
nix-2-16-0 = "github:nixos/nix?ref=2.16.0";
};
outputs = /* here you apply any patches and then pass the appropriate store paths to your multiple meson builds */
}
Tangent:
The C++ libraries provided by NixOS/nix are not ABI-compatible,
Since it is not ABI compatible, I would guess that the library maintainers don't attempt to keep their APIs stable either; is this guess correct? If so, then nixd
will have to deal with potential breakages on every nix
upgrade, correct?
Maybe this is why we don't see language servers for Rust taking the approach that clangd
, ccls
and nixd
have taken of linking directly against language libraries: Rust is under heavy development and is a large language. Comparatively, Nix is a much smaller language and I expect that C/C++ are ABI compatible and/or have a much lower rate of change than Rust.
Footnotes
-
Why? Because I'm using flakes, which is an experimental feature, and, from
https://github.com/NixOS/nix/blob/85d0eb63165e7d7f441fe3dd94bb548a40502e52/doc/manual/src/contributing/experimental-features.md?plain=1#L5,
"Experimental features are considered unstable, which means that they can be changed or removed at any time."
Theassert
helps me prevent causing breakage related to this when running e.g.nix build --recreate-lock-file
↩
Examples where this can be problematicI agree that this is a good point. I'm concerning about it may require a lot of work to resolve the difference, see comments below. About the implementation details
Actually, no. I pinned nix version to 2.16, and an explicit PR is required for bumping nix version. For example: #86
No. See the changed files in #86, we need to change the source code between nix versions.
Yes.
Yes. As mentioned above, #86 is a good example for "deal with potential breakages".
No, the llvm C++ API/ABI is also unstable. But the clang authors explicitly designed clang for reusability. This is not true for Nix/Rust. |
Thank you for all the explanations.
What will be the strategy for deciding when to bump the nix version will be moving forward? (it may be worthwhile to document this) Also, feel free to close this issue, e.g. as not planned. |
There is currently no clear "strategy" for now. It might be updated according to the official release cycle, or maintain branches for different versions. This is much similar to Minecraft mods1 :).
Ask questions anytime! Footnotes
|
This is pretty simple to deal with and many projects do so. Simply keep both versions of the source code and gate them behind If you choose to do this you'll have to maintain both branches of source code when adding new features that touch on the code in question, but that's significantly less complicated than maintaining both branches except in a fork. |
Please provide a
nixd
version that links againstnixVersions.stable
libraries so that users can keep using stablenix
while usingnixd
and still enjoying accurate language service.Since
nixd
's functionality is closely tied tonix
, providing an attribute set structured similarly tonixVersions
is probably a good idea, i.e., the attributepkgs.nixd
should link againstpkgs.nix
andpkgs
should have a new attribute(this paragraph is for the context of
nixpkgs
; the equivalent fornixd
'sflake.nix
is trivially similar).Given that providing these implies testing them (even if manually), if doing this for current
nixVersions.stable
(i.e.nix_2_15
) would be too much work, delaying it untilnixVersions.stable == nix_2_16
is an option.If more context is needed:
There are vaild reasons to prefer
stable
, here's an example problem that affectedunstable
users but notstable
users nix-community/home-manager#3734 (comment) .Note that all of the nixpkgs hyperlinks in this post are pinned to a single very-recent commit of branch
nixos-unstable
.nixVersions.stable
is especially important becausenix == nixVersions.stable
; see https://github.com/NixOS/nixpkgs/blob/684c17c429c42515bafb3ad775d2a710947f3d67/pkgs/top-level/all-packages.nix#L39892nixd
is usingnixVersions.unstable
, i.e.,nix_2_16
; see https://github.com/NixOS/nixpkgs/blob/684c17c429c42515bafb3ad775d2a710947f3d67/pkgs/tools/package-management/nix/default.nix#L208This is true for both:
nixd
'sflake.nix
; seenixd/flake.nix
Line 15 in b835f4e
The text was updated successfully, but these errors were encountered: