Repository navigation
Closed
Labels
0.kind: build failureA package fails to build
Description
Nixpkgs version
- Unstable (25.05)
Steps to reproduce
Run NIXPKGS_ALLOW_UNFREE=1 nix build github:nixos/nixpkgs/nixos-unstable#gitbutler --impure, maybe on an aarch64 MacOS system, and the failure should occur.
Can Hydra reproduce this build failure?
Please select the Hydra Status.
Link to Hydra build job
Hydra keeps timing out when searching the build: https://hydra.nixos.org/search?query=gitbutler
Relevant log output
❯ NIXPKGS_ALLOW_UNFREE=1 nix build github:nixos/nixpkgs/nixos-unstable#gitbutler --impure
error: builder for '/nix/store/0z9zksysbipg2fsap3f5fzqrjpm7zkc5-gitbutler-0.14.13-vendor-staging.drv' failed with exit code 1;
last 18 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/f2hpylxpxsfcm7cynsrzg9pclzw9bl4y-source
> source root is source
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: buildPhase
> Traceback (most recent call last):
> File "/nix/store/1sac2dm9dbd6iwxw3pdbzh739s5pw884-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 15, in <module>
> import requests
> File "/nix/store/2kcy81nj3hb3c7ma0hg0ry8lbbd4cywa-python3-3.12.9-env/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module>
> from .api import delete, get, head, options, patch, post, put, request
> File "/nix/store/2kcy81nj3hb3c7ma0hg0ry8lbbd4cywa-python3-3.12.9-env/lib/python3.12/site-packages/requests/api.py", line 11, in <module>
> from . import sessions
> File "/nix/store/2kcy81nj3hb3c7ma0hg0ry8lbbd4cywa-python3-3.12.9-env/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module>
> from .adapters import HTTPAdapter
> File "/nix/store/2kcy81nj3hb3c7ma0hg0ry8lbbd4cywa-python3-3.12.9-env/lib/python3.12/site-packages/requests/adapters.py", line 81, in <module>
> _preloaded_ssl_context.load_verify_locations(
> PermissionError: [Errno 13] Permission denied
For full logs, run 'nix log /nix/store/0z9zksysbipg2fsap3f5fzqrjpm7zkc5-gitbutler-0.14.13-vendor-staging.drv'.
error: 1 dependencies of derivation '/nix/store/a4ilxlfclclnixa0x47aai9swh1qqhz2-gitbutler-0.14.13-vendor.drv' failed to build
error (ignored): error: cannot unlink '"/private/tmp/nix-build-gitbutler-pnpm-deps.drv-0"': Directory not empty
error: 1 dependencies of derivation '/nix/store/lajy2c1sh5s25h314bwvpf09gjhsidsc-gitbutler-0.14.13.drv' failed to buildAdditional context
No response
System metadata
- system:
"aarch64-darwin" - host os:
Darwin 24.3.0, macOS 15.3.2 - multi-user?:
yes - sandbox:
no - version:
nix-env (Nix) 2.24.9 - nixpkgs:
/nix/store/4m21g6b3bq78vn5skaxjmqwg7fnir87j-source
Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Metadata
Metadata
Assignees
Labels
0.kind: build failureA package fails to build
Activity
getchoo commentedon Mar 29, 2025
Can you try enabling the sandbox in nix.conf? It seems the nix-community Hydra instance built this just fine 14h ago: https://hydra.nix-community.org/build/4432689
futile commentedon Mar 31, 2025
Leads to the same result for me:
Adding it as a home-manager package and running
home-manager switchalso continues to show the same error.I'm not running either command with
sudo, could that lead to a different result between hydra and my system?Here is my full
/etc/nix/nix.conffor reference, since I noticed the error mentions SSL, and I'm using a custom certificate as well./etc/nix/nix.conf:TomaSajt commentedon Mar 31, 2025
You have to disable (or relax) the sandbox. I know, weird.
But the default nix sandbox profile isn't whitelisting a file that's supposed to be whitelisted.
See #394972
futile commentedon Mar 31, 2025
Mhhm, I'm not quite sure what you mean, but I think the sandbox was disabled by default, i.e., in my initial post?
But thanks for opening the issue, that looks very related! I'll check how I can explicitly add the
$NIX_SSL_CERT_FILEfile to the sandbox, ty!TomaSajt commentedon Mar 31, 2025
Oh, I see, you're getting this error without the sandbox being enabled.
Could you send in what your
$NIX_SSL_CERT_FILEis in your normal shell?Is it
/etc/nix/MyCompanyRootCertificateCombined.pem?Does
/etc/nix/MyCompanyRootCertificateCombined.pemactually exist on your system?Also what is
$NIX_SSL_CERT_FILEin your nix build environment?To find out, try applying this patch to your local checkout of nixpkgs
and try building mdbook with
nix-build -A mdbookCan it read it successfully?
Is the path the same as in your config or your shell?
futile commentedon Jun 2, 2025
Uhh, well, looks like that doesn't properly use the custom certificate?
See above, errors out sadly :/
Thanks so much for your help already! 🙏
TomaSajt commentedon Jun 2, 2025
Thank you for the info.
Looking at the logs you sent, you might have accidentally removed the
hashfromsrcinstead ofcargoDeps.You don't have to send the part where it prints the entire certificate, only the part where it say that it was able to read it successfully or it got permission denied.
Btw a "fix" for unreadable certs (#401942) was merged into staging-next, so keep an eye out for that: #412425
(25.05 will probably only get this fix in a later staging-25.05-next cycle...)
But maybe it's not fixed by it, since your problems seem a little bit more nuanced that that...
In any case, once you send the logs, maybe I can figure something out.
futile commentedon Jun 2, 2025
Ahh, the syntax of that changed in the meantime, that was also why the patch didn't apply.
Used this now instead:
So yeah, looks like it is trying to take the certificate from
/etc/nix/...during thebuildPhase, which should indeed not be allowed..To be clear, I didn't configure the certificate itself through Nix (e.g., using
cacert.in my NixOS config), but simply created the symlink at/etc/nix/MyCompanyRootCertificateCombined.pemmanually.I'm on unstable, so should already have that, I think.
My current flake input for
nixpkgs:Sure! Thank you very much! :)
TomaSajt commentedon Jun 2, 2025
staging-next has not been merged into unstable yet, so unstable doesn't have the fix yet.
Also, it's a "fix" because it just falls back to the non-custom certificate if it cannot read it, which, I expect, is not what you really want.
Also, is this happening with
sandbox=trueorsandbox=false?I expected this behaviour with
sandbox=true, but not withsandbox=false.Can you confirm which is value you are using currently?
futile commentedon Jun 2, 2025
Ah, got it, yeah makes sense. Yup, that probably won't work for me, because in my case the custom cert is required to download anything.
Actually, both. See my config that I linked earlier in this thread, which set
sandbox = true.I just changed it to
sandbox = false, then ransudo launchctl kickstart -k system/org.nixos.nix-daemon, but the same error occurs:Does that make sense (somehow)? 😅
TomaSajt commentedon Jun 2, 2025
Can you try making the cert readable by anyone?
I'd assume that because the real file is in your home directory, it's going to have owner-only read perms.
futile commentedon Jun 2, 2025
and
Looks like it should be readable by everybody? Or am I missing some well-known thing about unix permissions again, which is very probable? 😄
TomaSajt commentedon Jun 2, 2025
Maybe every parent dir needs to be readable as well... not sure
So if thats the case, maybe but your cert into some world readable dir and symlink it into your original location. (Esentially inverting your current symlink setup)
futile commentedon Jun 3, 2025
That was it! Well, I didn't completely invert the setup, but simply copied the cert-chain to
/etc/nix/MyCompanyRootCertificateCombined.pem, and now when trying to buildmdbookit correctly prints the whole certificate chain from the file.Now gitbutler built successfully as well :)
Thanks for your continuous help! Should I post my use-case, i.e., symlink to a non-world-readable certificate, in an existing issue or somewhere else?