Back to Codeberg

Nix flake build fails to download cargo dependency #478

forgejo-contrib-forgejo-cli-issues-478.md

latest17.1 KB
Original Source

forgejo-contrib/forgejo-cli

Watch20

Star402

Fork

You've already forked forgejo-cli

51

CodeIssues 44Pull requests 8Releases 11Packages 2WikiActivity

Nix flake build fails to download cargo dependency #478

New issue

Closed

opened 2026-05-28 15:13:44 +02:00 by dw0x · 3 comments

dw0x commented 2026-05-28 15:13:44 +02:00

Copy link

Expected Behavior

when flake is included in shell.nix, build succeeds

other rust flakes are built ok, it must be specific to granit-parser
also building forgejo-cli without nix works fine too.

this was introduced by this: 6b53530af4

the ff9e70c528 builds fine

help?

Actual Behavior

text
❯ nix-shell --run "nix-build"
warning: Nix search path entry '/nix/var/nix/profiles/per-user/doo/channels/nixpkgs' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/doo/channels' does not exist, ignoring
evaluation warning: 'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'
[1/0/7 built] building crate-granit-parser-0.0.3.tar.gz: Warning: left.direnv: ([/usr/bin/direnv export bash]) is taking a while to execute. Use CTRL-C to give up.
error: Cannot build '/nix/store/5kzxfqpsmbwpb8a1h29yxgrksk9g4zgy-crate-granit-parser-0.0.3.tar.gz.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/vvz39dlzyqcdr3azkw8ji5gc5qxa9jf6-crate-granit-parser-0.0.3.tar.gz
       Last 18 log lines:
       > structuredAttrs is enabled
       >
       > trying https://crates.io/api/v1/crates/granit-parser/0.0.3/download
       > % Total % Received % Xferd Average Speed Time Time Time Current
       > Dload Upload Total Spent Left Speed
       > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
       > curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
       > Warning: Problem (retrying all errors). Will retry in 1 second. 3 retries left.
       > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 2 seconds. 2 retries
       > Warning: left.
       > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 4 seconds. 1 retry left.
       > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
       > curl: (22) The requested URL returned error: 403
       > error: cannot download crate-granit-parser-0.0.3.tar.gz from any mirror
       For full logs, run:
         nix-store -l /nix/store/5kzxfqpsmbwpb8a1h29yxgrksk9g4zgy-crate-granit-parser-0.0.3.tar.gz.drv
error: Cannot build '/nix/store/64aiklsa2839pjrz7daar3p84apaazia-granit-parser-0.0.3.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/gqk6q6zmqws3gr7rb0y5dbga2h4hpc52-granit-parser-0.0.3
error: Build failed due to failed dependency
error: Cannot build '/nix/store/4bav8mcmcdvqbsiq0vja8rz9i8pyxcv0-cargo-vendor-dir.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/4hj95khszg5psc3lknyw1f53z8d2qmra-cargo-vendor-dir
error: Build failed due to failed dependency
error: Cannot build '/nix/store/2cvpmq3h7n6dw303xm69m5v8d4nnjfzk-forgejo-cli-0.5.0.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/3wqh6z8vglyl4iayvk097zzc05xpgpcg-forgejo-cli-0.5.0
error: Build failed due to failed dependency
error: Cannot build '/nix/store/qmnwgkmmbxfa2h5z71hka4gl4xa26ny2-nix-shell-env.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/4h8pyg8i0zvwbmz8w1aiiawa6512isx6-nix-shell-env
error: Build failed due to failed dependency

Steps to Reproduce

use this shell nix

text
❯ cat shell.nix
{
  pkgs ? import <nixpkgs> {},
}:

let

  fj = (builtins.getFlake "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=6b53530af4822ce90e16dffa119179a6ab3ee2b0")
      .packages.${pkgs.system}.default;

in pkgs.mkShellNoCC {

  buildInputs = [
    fj
  ];

}

when using ```
fj = (builtins.getFlake "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=ff9e70c52824f7171ac11673fe2d07e9a8d1fd52")

text
flake builds fine

### `fj` Version

_No response_

### Forgejo Version

_No response_

### Code of Conduct

- [x] I agree to act in accordance with the CoC & AI Agreement.
- [x] This issue was not generated by an LLM, even in part.

Expected Behavior when flake is included in shell.nix, build succeeds other rust flakes are built ok, it must be specific to granit-parser also building forgejo-cli without nix works fine too. this was introduced by this: https://codeberg.org/forgejo-contrib/forgejo-cli/commit/6b53530af4822ce90e16dffa119179a6ab3ee2b0 the ff9e70c52824f7171ac11673fe2d07e9a8d1fd52 builds fine help? ### Actual Behavior ❯ nix-shell --run "nix-build" warning: Nix search path entry '/nix/var/nix/profiles/per-user/doo/channels/nixpkgs' does not exist, ignoring warning: Nix search path entry '/nix/var/nix/profiles/per-user/doo/channels' does not exist, ignoring evaluation warning: 'system' has been renamed to/replaced by 'stdenv.hostPlatform.system' [1/0/7 built] building crate-granit-parser-0.0.3.tar.gz: Warning: left.direnv: ([/usr/bin/direnv export bash]) is taking a while to execute. Use CTRL-C to give up. error: Cannot build '/nix/store/5kzxfqpsmbwpb8a1h29yxgrksk9g4zgy-crate-granit-parser-0.0.3.tar.gz.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/vvz39dlzyqcdr3azkw8ji5gc5qxa9jf6-crate-granit-parser-0.0.3.tar.gz Last 18 log lines: \> structuredAttrs is enabled \> \> trying https://crates.io/api/v1/crates/granit-parser/0.0.3/download \> % Total % Received % Xferd Average Speed Time Time Time Current \> Dload Upload Total Spent Left Speed \> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 \> curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) \> Warning: Problem (retrying all errors). Will retry in 1 second. 3 retries left. \> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 \> curl: (22) The requested URL returned error: 403 \> Warning: Problem (retrying all errors). Will retry in 2 seconds. 2 retries \> Warning: left. \> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 \> curl: (22) The requested URL returned error: 403 \> Warning: Problem (retrying all errors). Will retry in 4 seconds. 1 retry left. \> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 \> curl: (22) The requested URL returned error: 403 \> error: cannot download crate-granit-parser-0.0.3.tar.gz from any mirror For full logs, run: nix-store -l /nix/store/5kzxfqpsmbwpb8a1h29yxgrksk9g4zgy-crate-granit-parser-0.0.3.tar.gz.drv error: Cannot build '/nix/store/64aiklsa2839pjrz7daar3p84apaazia-granit-parser-0.0.3.drv'. Reason: 1 dependency failed. Output paths: /nix/store/gqk6q6zmqws3gr7rb0y5dbga2h4hpc52-granit-parser-0.0.3 error: Build failed due to failed dependency error: Cannot build '/nix/store/4bav8mcmcdvqbsiq0vja8rz9i8pyxcv0-cargo-vendor-dir.drv'. Reason: 1 dependency failed. Output paths: /nix/store/4hj95khszg5psc3lknyw1f53z8d2qmra-cargo-vendor-dir error: Build failed due to failed dependency error: Cannot build '/nix/store/2cvpmq3h7n6dw303xm69m5v8d4nnjfzk-forgejo-cli-0.5.0.drv'. Reason: 1 dependency failed. Output paths: /nix/store/3wqh6z8vglyl4iayvk097zzc05xpgpcg-forgejo-cli-0.5.0 error: Build failed due to failed dependency error: Cannot build '/nix/store/qmnwgkmmbxfa2h5z71hka4gl4xa26ny2-nix-shell-env.drv'. Reason: 1 dependency failed. Output paths: /nix/store/4h8pyg8i0zvwbmz8w1aiiawa6512isx6-nix-shell-env error: Build failed due to failed dependency ### Steps to Reproduce use this shell nix ❯ cat shell.nix { pkgs ? import \<nixpkgs\> {}, }: let fj = (builtins.getFlake "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=6b53530af4822ce90e16dffa119179a6ab3ee2b0") .packages.${pkgs.system}.default; in pkgs.mkShellNoCC { buildInputs = [fj]; } when using fj = (builtins.getFlake "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=ff9e70c52824f7171ac11673fe2d07e9a8d1fd52") flake builds fine ### fj Version _No response_ ### Forgejo Version _No response_ ### Code of Conduct - [x] I agree to act in accordance with the CoC & AI Agreement. - [x] This issue was not generated by an LLM, even in part.

dw0x added the Kind/Bug label 2026-05-28 15:13:44 +02:00

LordMZTE commented 2026-05-29 12:46:28 +02:00

Collaborator

Copy link

This looks to be an issue with your internet connection. The URL that fails to download here (https://crates.io/api/v1/crates/granit-parser/0.0.3/download) works perfectly fine for me. Perhaps your IP is blocked by crates? Also, it seems strange to be invoking nix-build inside nix-shell, that shouldn't be necessary (but of course, I don't know the specifics because you've not provided your package.nix that would be built by nix-build).

Have you tried building the flake directly without your shell?:

bash
$ nix build --extra-experimental-features "nix-command flakes" "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=ff9e70c52824f7171ac11673fe2d07e9a8d1fd52"

This looks to be an issue with your internet connection. The URL that fails to download here (https://crates.io/api/v1/crates/granit-parser/0.0.3/download) works perfectly fine for me. Perhaps your IP is blocked by crates? Also, it seems strange to be invoking nix-build inside nix-shell, that shouldn't be necessary (but of course, I don't know the specifics because you've not provided your package.nix that would be built by nix-build). Have you tried building the flake directly without your shell?: bash $ nix build --extra-experimental-features "nix-command flakes" "git+https://codeberg.org/forgejo-contrib/forgejo-cli?rev=ff9e70c52824f7171ac11673fe2d07e9a8d1fd52"

LordMZTE changed title from ** flake build strangely fails ** to Nix flake build fails to download cargo dependency 2026-05-29 13:08:57 +02:00

Cyborus commented 2026-05-29 15:58:20 +02:00

Member

Copy link

Weirdly, nix build . was failing for me yesterday but works today. It was previously getting 403 from crates.io, which I would also get if I tried to download it with curl, but not with Firefox. Now only curl gets the 403.

Weirdly, nix build . was failing for me yesterday but works today. It was previously getting 403 from crates.io, which I would also get if I tried to download it with curl, but not with Firefox. Now only curl gets the 403.

dw0x commented 2026-05-29 16:38:26 +02:00

Author

Copy link

it started working for me now. my guess is it was certificate change and it finally propagated at least to me.

it started working for me now. my guess is it was certificate change and it finally propagated at least to me.

👍 1

Cyborus closed this issue 2026-05-29 18:22:32 +02:00

Sign in to join this conversation.

No Branch/Tag specified

BranchesTags

main

renovate/lock-file-maintenance

renovate/serde-saphyr-0.x

docs/contributing

no-port-in-refspec

login/v16.next.forgejo.org

crates-io-publish

0.5.x

compile-time-fluent

0.4.x

localization-alias-demo

api_url_field

v0.5.0

v0.4.1

v0.4.0

v0.3.0

v0.2.0

v0.1.1

v0.1.0

v0.0.4

v0.0.3

v0.0.2

v0.0.1

Labels

Clear labels[ Kind/Breaking Breaking change that won't be backward compatible

](#)[ Kind/Bug Something is not working

](#)[ Kind/Design Discussion about UI/UX design

](#)[ Kind/Documentation Documentation changes

](#)[ Kind/Enhancement Improve existing functionality

](#)[ Kind/Feature New functionality

](#)[ Kind/Security This is security issue

](#)[ Kind/Testing Issue or pull request related to testing

](#)[ Kind/Upstream This is an issue with upstream software (Forgejo) that is probably not our fault

](#)

[ Priority

Critical The priority is critical

](#)[ Priority

High The priority is high

](#)[ Priority

Low The priority is low

](#)[ Priority

Medium The priority is medium

](#)

[ Reviewed

Confirmed Issue has been confirmed

](#)[ Reviewed

Duplicate This issue or pull request already exists

](#)[ Reviewed

Invalid Invalid issue

](#)[ Reviewed

Won't Fix This issue won't be fixed

](#)

[ Status

Abandoned Somebody has started to work on this but abandoned work

](#)[ Status

Blocked Something is blocking this issue or pull request

](#)[ Status

Need More Info Feedback is required to reproduce issue or to continue work

](#)

[ Suspicious

](#)

No labels Kind/Breaking Kind/Bug Kind/Design Kind/Documentation Kind/Enhancement Kind/Feature Kind/Security Kind/Testing Kind/Upstream [ Priority

Critical ](/forgejo-contrib/forgejo-cli/issues?labels=173012) [ Priority

High ](/forgejo-contrib/forgejo-cli/issues?labels=173013) [ Priority

Low ](/forgejo-contrib/forgejo-cli/issues?labels=173015) [ Priority

Medium ](/forgejo-contrib/forgejo-cli/issues?labels=173014) [ Reviewed

Confirmed ](/forgejo-contrib/forgejo-cli/issues?labels=173007) [ Reviewed

Duplicate ](/forgejo-contrib/forgejo-cli/issues?labels=173005) [ Reviewed

Invalid ](/forgejo-contrib/forgejo-cli/issues?labels=173006) [ Reviewed

Won't Fix ](/forgejo-contrib/forgejo-cli/issues?labels=173008) [ Status

Abandoned ](/forgejo-contrib/forgejo-cli/issues?labels=173011) [ Status

Blocked ](/forgejo-contrib/forgejo-cli/issues?labels=173010) [ Status

Need More Info ](/forgejo-contrib/forgejo-cli/issues?labels=173009) Suspicious

Milestone

Clear milestone

No items

No milestone

Projects

Clear projects

No items

No project

Assignees

Clear assignees

No assignees

3 participants

Notifications Subscribe

Due date

The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference

forgejo-contrib/forgejo-cli#478

WritePreview

Loading…

Add table

| Rows | | | Columns | |

CancelOK

Add a link

Url Description Hint: With a URL in your clipboard, you can paste directly into the editor to create a link.

CancelOK

CancelSave

Reference in a new issue

Repository

forgejo-contrib/forgejo-cli

Title

Body

Create issue

No description provided.

Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?

No Yes