-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Broken flake.nix #27
Comments
The jsonrpc folks tagged a new release, but did not push a new version to crates.io. The other problem with building via flake:s submodules aren't visible during the build (NixOS/nix#4423), so all of the syntax definitions are missing and the build fails. The workaround seems to be to re-clone the repo via |
@DieracDelta solved submodules issue somehow recently. May have used the same technique 🤔 |
So this is not really relevant for naersk, but it does work(at least for fetching dependencies) - naersk has the upside of providing some form of caching, while buildRustPackage does not. I'm trying to get a build working locally. |
update: edited the snippet to include workarounds for the syntax builds; sadly this fails in checkPhase.
Depencies get correctly fetched but nix build is very nitpicky about the correct sha being used( the Cargo.lock has to be identical to the pinned upstream one ). Then the build finishes correctly but fails while running tests:
in helix-tui |
We use crate.io deps now again: d5de918 I think the test failure could be from warnings? We fixed some warnings in |
I think you are correct here. the following builds correctly, It pulls all submodules into the scope of the build:
This flake.nix build is based on the commit 68affa3; It is probably unfeasible to have nix-flake build from the master branch since this can often result in a cargo.lock mismatch. Updating it manually is not difficult though. (change rev, build, replace sha, build) |
I think you could use Other than that, feel free to open a PR with these changes :) |
Latest release sadly does not have d5de918 so the build will always fail. |
I think we should add nix builds to CI to prevent regression. |
we could add helix itself as a flake input to pull submodules:
Doing this, I was able to build the package from the flake like so:
|
Does this also work when using root = ./.; ? (since you'd want to be able to run nix build with local changes ) I will test when I have the time. Edit: |
@itzmjauz I gave it a try, but it doesn't appear to take local changes into account. |
Yeah I'm seeing that too.. It might be building all helix modules ( helix-term helix-syntax etc) from upstream as well.. |
After reviewing naersk docs, root is only used to read Cargo.toml and Cargo.lock so I guess it's no surprise. Perhaps something like a |
Consider using this instead: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#importing-a-cargolock-file
The text was updated successfully, but these errors were encountered: