Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Pre-Commit fails sporadically with failed to compile nixpkgs-fmt #312

Open
hofbi opened this issue Sep 6, 2023 · 0 comments
Open

Pre-Commit fails sporadically with failed to compile nixpkgs-fmt #312

hofbi opened this issue Sep 6, 2023 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@hofbi
Copy link

hofbi commented Sep 6, 2023

Describe the bug

I am using nixpkgs-fmt via pre-commit and it fails from time to time in the CI with

[INFO] Installing environment for https://github.com/nix-community/nixpkgs-fmt.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/runner/.cargo/bin/cargo', 'install', '--bins', '--root', '/home/runner/.cache/pre-commit/repoawuydlo9/rustenv-system', '--path', '.')
return code: 101
stdout: (none)
stderr:
      Installing nixpkgs-fmt v1.3.0 (/home/runner/.cache/pre-commit/repoawuydlo9)
        Updating crates.io index
    warning: spurious network error (3 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds)
    warning: spurious network error (2 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds)
    warning: spurious network error (1 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds)
    error: failed to compile `nixpkgs-fmt v1.3.0 (/home/runner/.cache/pre-commit/repoawuydlo9)`, intermediate artifacts can be found at `/home/runner/.cache/pre-commit/repoawuydlo9/target`
    
    Caused by:
      failed to get `syn` as a dependency of package `serde_derive v1.0.186`
          ... which satisfies dependency `serde_derive = "=1.0.186"` of package `serde v1.0.186`
          ... which satisfies dependency `serde = "^1.0.136"` of package `smol_str v0.1.24`
          ... which satisfies dependency `smol_str = "^0.1.17"` of package `nixpkgs-fmt v1.3.0 (/home/runner/.cache/pre-commit/repoawuydlo9)`
    
    Caused by:
      failed to query replaced source registry `crates-io`
    
    Caused by:
      download of 3/s/syn failed
    
    Caused by:
      failed to download from `https://index.crates.io/3/s/syn`
    
    Caused by:
      [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds)
Check the log at /home/runner/.cache/pre-commit/pre-commit.log

To Reproduce

My pre-commit config contains

  - repo: https://github.com/nix-community/nixpkgs-fmt
    rev: 6d2dee8954cc4e790dede82ddff2aeac4a32da46
    hooks:
      - id: nixpkgs-fmt

Since it is a flaky issue it is not reproducible, but it happens as part of the pre-commit github action

Expected behavior

Do not fail wih the error mentioned above

System information

  • comes from pre-commit

Additional context

I found rust-lang/cargo#12525, which was resolved today. Maybe this is related.

@hofbi hofbi added bug Something isn't working needs triage labels Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant