-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Build failure: gitstatus on x86_64-darwin #358116
Comments
Can you build the normal libgit2? We are just providing it with a few overrides to the cmake flags. Other than that I cannot help you much because I don't own a Mac. |
Building To me it really seems that even though I can try to investigate this further, just waiting a bit to see whether @emilazy has an idea and can point me into the right direction. |
I have very little idea why it’d be failing only on |
This patch fixes things for me:
|
The difference is that with this change, the forked libgit2 produces |
@emilazy Thanks anyway for taking a look! And I think yes, using upstream @DaGenix Thanks! I cannot test this right now myself but will do so later. Odd that Given that shared libs were explicitly disabled, I assume there must be some reason for not using them? |
@pitkling Yah, that's the part I have no explanation for. Also, it was building in Hydra until about 3-4 weeks ago, which makes me think that it must have been something else that changed that caused the new behavior. I considered opening up a PR with this change, but, as you say, it was made a static library for a reason and also I suspect this is just a symptom of a more complex behavior. |
The following change in (libgit2.override { staticBuild = true; }).overrideAttrs (oldAttrs: {
cmakeFlags = oldAttrs.cmakeFlags ++ [
"-DBUILD_CLAR=OFF"
"-DREGEX_BACKEND=builtin"
"-DUSE_BUNDLED_ZLIB=ON"
"-DUSE_GSSAPI=OFF"
"-DUSE_HTTPS=OFF"
"-DUSE_HTTP_PARSER=builtin" # overwritten from libgit2
"-DUSE_NTLMCLIENT=OFF"
"-DUSE_SSH=OFF"
"-DZERO_NSEC=ON"
]; Again, no idea why this affects only |
Was it already bisected by chance by anyone? Otherwise I'll start a slow bisect. |
I didn't |
Bisect landed on a061b02 is the first bad commit No idea how/why it affects the presence on static builds for Reverting it against $ git diff
$ diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 20c7c0c145ef..a7b34e3329d1 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -180,7 +180,7 @@ let
darwin.apple_sdk.frameworks.Cocoa
] ++ optionals stdenv.hostPlatform.isDarwin [
# Work around for ld64 crashes on x86_64-darwin. Remove once 11.0 becomes the default.
- apple-sdk_11
+ (apple-sdk_11.override { enableBootstrap = true; })
] ++ optionals stdenv.hostPlatform.isMinGW [
windows.dlfcn
windows.mingw_w64_pthreads |
Hmm, I introduced that in c455166, the same day I reverted it (there was a couple rounds of botched fixes for an issue). Are you confident in that bisect result? It might have been one of the other related changes that broke it. |
Ah, maybe it was the first one. I'll try again. |
Wait, I did test the revert against |
Ah, sorry, I mean that your bisected commit a061b02 is a revert of my commit c455166 from the same day. So if this was working before the It is in any event very strange to me that adding the bootstrap SDK back fixes this. I cannot fathom why. |
I compared the build logs of "good" and "bad" --- /dev/fd/63 2024-11-25 16:04:03.792107343 +0000
+++ /dev/fd/62 2024-11-25 16:04:03.792107343 +0000
@@ -1,12 +1,10 @@
+/<<NIX>>/cmake-3.30.5/nix-support/setup-hook: line 77: grep: command not found
...
stripping (with command strip and flags -S) in /<<NIX>>/libgit2-1.8.4-dev/lib
checking for references to /private/tmp/nix-build-libgit2-1.8.4.drv-0/ in /<<NIX>>/libgit2-1.8.4...
patching script interpreter paths in /<<NIX>>/libgit2-1.8.4
+/<<NIX>>/cmake-3.30.5/nix-support/setup-hook: line 189: grep: command not found
+/<<NIX>>/multiple-outputs.sh: line 201: grep: command not found Looks like The following workaround is enough to fix --- a/pkgs/by-name/gi/gitstatus/romkatv_libgit2.nix
+++ b/pkgs/by-name/gi/gitstatus/romkatv_libgit2.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, libgit2, ... }:
+{ fetchFromGitHub, libgit2, gnugrep, ... }:
libgit2.overrideAttrs (oldAttrs: {
cmakeFlags = oldAttrs.cmakeFlags ++ [
@@ -26,4 +26,6 @@ libgit2.overrideAttrs (oldAttrs: {
doCheck = false;
patches = [ ];
+
+ nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ gnugrep ];
}) |
In NixOS#358116 we found out that `drawin`'s `stdenv` lacks `grep` and breaks `libgit2` fork of `gitstatus`. The change adds `gnugrep` as a workaround until `stdenv` is fixed.
Proposed |
Uh, we had a Darwin Hydra builder recently that was missing |
In NixOS#358116 we found out that `drawin`'s `stdenv` lacks `grep` and breaks `libgit2` fork of `gitstatus`. The change adds `gnugrep` as a workaround until `stdenv` is fixed.
grep is in the stdenv. https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/common-path.nix#L6 so there is some other issue going on causing it to fail to build but report success. if you have access to the environment which is failing can you look at the path? it probably has a |
Ah, poking at the environment is a good point. I tried to rebuild the |
Let's try to unpoison hydra instead by introducing minor rebuild to see if it was this derivation corruption, or something deeper in the build chain: |
I didn't realize diffing the outputs from the hydra and and local-built, besides the libgit2.a differing, the --- result-dev/nix-support/propagated-build-inputs 1969-12-31 16:00:01.000000000 -0800
+++ local-built/result-dev/nix-support/propagated-build-inputs 1969-12-31 16:00:01.000000000 -0800
@@ -1 +1 @@
-/nix/store/5b7ddkjx3bp5yv3rf172dqp6f2957l2g-libiconv-107-dev
\ No newline at end of file
+/nix/store/5b7ddkjx3bp5yv3rf172dqp6f2957l2g-libiconv-107-dev /nix/store/sbrs050xq1vjxcbcji66rfl81njwdmrv-libgit2-1.8.4-lib /nix/store/hzzb6p3nxrkypcxkkha8a3qx4l3fa33j-libgit2-1.8.4
\ No newline at end of file |
both disable failures. the first uses nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh Lines 195 to 203 in b718c27
nixpkgs/pkgs/by-name/cm/cmake/check-pc-files-hook.sh Lines 1 to 16 in b718c27
|
looking at the |
Uninstall powerlevel10k prompt until problem with its dependency "statusd" is fixed (source is likely from libgit2) Remove shell hook for powerlevel10k for the same reason See NixOS/nixpkgs#358116 for details
once staging-next is merged #360437 the issue should be fixed |
It is actually fixed (at least using the |
The current |
Steps To Reproduce
Steps to reproduce the behavior:
Build log
Build Log
Additional context
I stumbled upon this when updating to 24.11 and building
zsh-powerlevel10k
(which depends ongitstatus
). The builds work fine onaarch64_darwin
andx86_64-linux
. I looked a little bit into it and it seems thatNIX_LDFLAGS
is not populated with the path tolibgit2
underx86_64-darwin
, causing the linker error above.I guess this is related to the recent changes in the handling of Apple's SDKs. As far as I know the bintools-wrapper is responsible for populating
NIX_LDFLAGS
. Since there were a few changes to the bintools-wrapper by @emilazy related to the sdk update (see "Known Issues" under The Darwin SDKs have been updated), I'm pinging them here, in case that is related. Hope that is ok.Metadata
"x86_64-darwin"
Darwin 22.6.0, macOS 10.16
yes
no
nix-env (Nix) 2.18.8
""
""
/nix/store/9rlx9vnfg79i0y9nqfa1578jml31d5vr-source
Notify maintainers
@mmlb @Hexa @SuperSandro2000
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: