Comments (6)
I see. Unfortunately I do not have a macOS to try and repro on my own.
From what you've described, I am suspicious of the dependencies for which we are overriding derivation inputs. If you have time and are so inclined, could you try commenting out the overridden dependencies here (around L50); https://github.com/nix-community/neovim-nightly-overlay/blob/master/flake/packages/neovim.nix
Let me know if you need help forking/cloning this repo and/or getting your neovim flake to point at your local copy.
from neovim-nightly-overlay.
So, immediately upon opening neovim your cpu's pegged? Are there any clues in :checkhealth
? What about Activity Monitor, any clues in there or does it just claim "neovim" is the culprit?
from neovim-nightly-overlay.
Not immediately after opening. Only after opening any file, or after opening file preview via telescope. That's why the first thing that came to my mind was treesitter but not sure how to check that.
Activity monitor just shows "nvim - 99.9" in the cpu column and laptop gets hot.
Checkhealth shows nothing suspicious but I'll post both reports later (compiled and binary from neovim repo), maybe it'll show some differences, because one works ok, the other not.
from neovim-nightly-overlay.
Thanks for a good lead!
After trial and error, the cause seems to be: libuv
(after commenting it out in overrides, nvim compiled from this repo behaves normally).
Here's a workaround that fixes the issue in my flake: konradmalik/neovim-flake@3d71a41
But I'm not sure how we should proceed in this repo to fix it. Any suggestions?
What's weird is that both nixpkgs and neovim deps.txt file seem to have the same libuv version (1.48), but they still behave differently on darwin.
from neovim-nightly-overlay.
Interesting! Although not totally surprising. You said the binary release (or build) for the same upstream commit does not exhibit this cpu problem? I guess we need to go dig through neovim's cmake code :D
Anyways, thanks for filing this issue! I can take it from here. Will commit a temporary fix until I have time to investigate what could be the real root cause here.
from neovim-nightly-overlay.
Hmm, so this works properly (current nixpkgs):
libuv = pkgs.libuv.overrideAttrs {
src = pkgs.fetchFromGitHub {
owner = "libuv";
repo = "libuv";
rev = "v1.48.0";
hash = "sha256-U68BmIQNpmIy3prS7LkYl+wvDJQNikoeFiKh50yQFoA=";
};
};
While this does not (neovim's deps.txt):
libuv = pkgs.libuv.overrideAttrs {
src = pkgs.fetchurl {
url = "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz";
sha256 = "8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33";
};
};
I know the above is the same what we concluded earlier, but seems more clear to show this explicitly.
Does it mean that v1.48.0 used in nixpkgs (downloaded from source directly) is not the same as v1.48.0 locked in neovim's repo (downloaded from the released tarball)?
Edit1: nope, downloaded both, diffed, and they're the same except for the .git
folder.
And then, I still cannot understand why a pre-built binary from neovim works fine...
Edit2: the below also works (!); seems like something's fishy in fetchurl
on darwin?
libuv = pkgs.libuv.overrideAttrs {
src = pkgs.fetchzip {
url = "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz";
hash = "sha256-U68BmIQNpmIy3prS7LkYl+wvDJQNikoeFiKh50yQFoA=";
};
};
Edit3: I've built libuv using both fetchzip and fetchurl, then used nix-diff to compare both packages. Attaching nix-diff.txt (it's quite long).
I've never used that tool and not sure how to interpret the results and how good they're, but at first sight looks like a lot of differences that I didn't expect (even 24.11 vs 24.05).
Edit4: included fetchTarball into the equation:
- pkgs.fetchzip - works
- pkgs.fetchFromGithub - works
- builtins.fetchTarball - has CPU problem
- builtins.fetchurl - has CPU problem
For the interested a branch where there's 3 libuvs defined for easy testing: https://github.com/konradmalik/neovim-flake/tree/darwin-fix
If this matters, my nix version: 2.22.1
Edit5:
comparing files produced by two derivations as follows shows no differences, but still libuv built with fetchurl vs fetchzip behaves differently
libuv-fetchurl = pkgs.stdenv.mkDerivation {
name = "libuv-fetchurl";
src = builtins.fetchurl {
url = "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz";
sha256 = "8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33";
};
installPhase = ''
cp -r ./ $out/
'';
};
libuv-fetchzip = pkgs.stdenv.mkDerivation {
name = "libuv-fetchzip";
src = pkgs.fetchzip {
url = "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz";
hash = "sha256-U68BmIQNpmIy3prS7LkYl+wvDJQNikoeFiKh50yQFoA=";
};
installPhase = ''
cp -r ./ $out/
'';
};
from neovim-nightly-overlay.
Related Issues (20)
- Hitting /nix/store/jnp9n2x9cdvl47da3656illrd3p2qvb5-system_rplugin_manifest.patch failure again HOT 2
- nix-env -iA pkgs.neovim-nightly doesn't work? HOT 2
- vim-unwrapped lsp keyboard interrupt error after specific commit HOT 1
- Instructions for Nix without NixOS or home-manager HOT 1
- Patch error again HOT 3
- nlua0 & new lpeg build dependency issue HOT 3
- Trying to de-duplicate `nixpkgs` HOT 1
- Cache for the rest of us? HOT 6
- Build fails HOT 12
- ISSUE: README.md has deprecated configuration argument HOT 4
- only works built separately from a config?
- error: attribute 'src' missing from 'bash-grammar-neovim-3b29b39' HOT 7
- Error: attribute 'overlay' missing HOT 6
- Fails to build on non NixOS non flake HOT 1
- attribute 'overlay' missing HOT 7
- [NOTICE] Upstream breaking changes HOT 1
- Nightly CI not running HOT 14
- Investigate the root cause of #538
- Can't use nightly overlay with NixOS 24.05 HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim-nightly-overlay.