-
Notifications
You must be signed in to change notification settings - Fork 464
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
chore(nix): cleanup #1252
chore(nix): cleanup #1252
Conversation
This commit introduced three changes: 1. Opt for a shallow clone whenever we run the `update_flake` workflow since there's no need to retrive past commits. 2. Deleted `result` from `.gitignore` bc I couldn't track down its source (correct me if I'm wrong!) 3. Ensure either XCode or the CLT is installed on macOS before running `otool`. These aren't included by default on a fresh macOS install, and using `xcrun` can sort out those dependency snags. Signed-off-by: Jint-lzxy <[email protected]>
This was added to prevent accidentally committing this because when you run |
Hmm. We can check if nixpkgs is linked with |
If we need |
Signed-off-by: Charles Chiu <[email protected]>
tbh, i just knew we can set
i think this should be fine since those fundamental libs generally have gd backward compatibility?( correct me if i'm wrong lol |
@misumisumi Can u tell me how to create a package using Nix, or what should I learn? |
You can learn from official nixpkg manual. |
@misumisumi @CharlesChiuGit Apologies for the delayed response and the oversight in explaining the issue! Let me provide further detail on how shared libraries are located on macOS (Darwin). Unlike many other Unix-like operating systems, Darwin's dynamic linker, $ ldd a.out
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000fffff76c0000) and $ otool -L a.out
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0) The crucial difference is that on Darwin, dyld[48101]: Library not loaded: /usr/lib/libSystem.B.dylib
Referenced from: <08197395-BB6E-33C2-BB73-C47F2C1C672E> /private/var/folders/jy/91xg_8j9169dydct2k4r7yw80000gn/T/a.out.cdBaJwRHju/a.out
Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libSystem.B.dylib' (no such file), '/usr/lib/libSystem.B.dylib' (no such file, not in dyld cache)
[1] 48101 abort ./a.out Which is why I mentioned earlier in #1252 (comment) that on Darwin, we may only2 either use Footnotes
|
@CharlesChiuGit Yeah u're absolutely right lol. Actually, what I meant to say was that those "new" features that come with some packages could alter the way Neovim operates. For instance, ncurses 6 introduces a bunch of new features (and databases) that ncurses 5 doesn't have. So, if we now instruct some executable to use ncurses 6 (macOS ships with a really ancient version of ncurses 5), the display could look different (like with colors). |
so set nvimdots/nixos/neovim/default.nix Lines 106 to 111 in e3e5797
|
Ye and IMO this should be the most straightforward method. However, the drawback here is that other processes spawned by Neovim (e.g., lazygit) that aren't managed by Nix could also be impacted during library resolution. On the other hand, using |
This discussion is similar to dealing with binary packages in NixOS. |
That's true. |
IMO, if we use this method to solve the problem on macOS, we should be able to use almost the same method on NixOS, so it is better to replace both. |
just a side note, i just found out that upgrading macOS will break nix, since it regenerate maybe jint will experiences similar issues lol |
@CharlesChiuGit I just spotted this in my inbox and wanted to quickly mention that I managed to "circumvent" the issue by setting the system immutable flag on sudo chflags simmutable /etc/zshrc bc I discovered that the file's content hasn't changed since Catalina (the first version to use zsh as the default shell). AFAIU this tweak ensures the sudo chflags nosimmutable /etc/zshrc See |
ok, i finally got it fixed lol |
The section on nixos in the wiki is out of date and needs to be updated |
I'm still new to Nix(OS) so plz correct me if any of the following is conceptually wrong!
So iiuc depending on how much extra work is needed, here are our options:
Honestly, I actually lean towards option 2 bc it's the most stable one and also tries to be as Nix-ish as possible. It can accommodate existing executables and also conserve disk space. What do u guys think?
I suggest postponing this until we reach a consensus on the implementation. IMO it's probable that our implementation will change in the future, and documenting those volatile configs doesn't sit well with anyone at all.
I think if we're dead set on making the entire config immutable, we could have GitHub actions handle the updates. Then, on the end user's local setup, they could simply do a Alternatively, if we're not too strict about restricted write access, we could stash the lockfile in a separate location1 like Footnotes
|
I also think this is the best. IMO, is better creating plugin for bypass when exsting global pkg. |
I recently learned this. |
nix-community/neovim-nightly-overlay#533 i wonder if this affect us. |
I think there were no problems as of last Friday, but I'll check. |
I've got some free time now and can start working on this. But I probably won't finish before #1260 gets merged in tho.
Thanks for this brilliant idea! It didn't even cross my mind lol |
Given that #1293 is now open, shall we merge this PR first and continue our discussion there? |
* chore(nix): cleanup This commit introduced three changes: 1. Opt for a shallow clone whenever we run the `update_flake` workflow since there's no need to retrive past commits. 2. Deleted `result` from `.gitignore` bc I couldn't track down its source (correct me if I'm wrong!) 3. Ensure either XCode or the CLT is installed on macOS before running `otool`. These aren't included by default on a fresh macOS install, and using `xcrun` can sort out those dependency snags. Signed-off-by: Jint-lzxy <[email protected]> * revert(gitignore): add `result/` back Signed-off-by: Charles Chiu <[email protected]> --------- Signed-off-by: Jint-lzxy <[email protected]> Signed-off-by: Charles Chiu <[email protected]> Co-authored-by: Charles Chiu <[email protected]>
This commit introduced three changes:
update_flake
workflow since there's no need to retrive past commits.result
from.gitignore
bc I couldn't track down its source (correct me if I'm wrong!)otool
. These aren't included by default on a fresh macOS install, and usingxcrun
can sort out those dependency snags.btw @CharlesChiuGit @misumisumi do u think it's worth considering enforcing library policies for the pre-built binaries that Mason uses on macOS, similar to our approach on NixOS? This enforcement could involve setting
DYLD_*_LIBRARY_PATH
or utilizinginstall_name_tool
(see manual below). One potential concern I see with this change is that macOS often includes software that hasn't been updated in a long time, so transitioning to a new version could potentially cause disruptions.man install_name_tool
man dyld