Skip to content
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

Unable to create treefmt eval cache shouldn't be fatal #327

Closed
flokli opened this issue Jul 1, 2024 · 2 comments · Fixed by #330
Closed

Unable to create treefmt eval cache shouldn't be fatal #327

flokli opened this issue Jul 1, 2024 · 2 comments · Fixed by #330
Labels
bug Something isn't working

Comments

@flokli
Copy link
Member

flokli commented Jul 1, 2024

Describe the bug

I'm running treefmt inside a Nix build.

Since the bump to 2.x, this started to fail, as treefmt fails on not being able to create some cache files.

This should be a recoverable error, potentially trying to use tmpdir instead, or just not creating the cache at all.

To Reproduce

Steps to reproduce the behavior:

  1. Run treefmt inside a Nix derivation
  2. treefmt: error: could not resolve local path for the cache: could not create any of the following paths: /homeless-shelter/.cache/treefmt/eval-cache
  3. nonzero exit code

Expected behavior

Files get formatted.

System information

Additional context

@flokli flokli added the bug Something isn't working label Jul 1, 2024
@flokli flokli changed the title Unable to create treefmt eval acache shouldn't be fatal Unable to create treefmt eval cache shouldn't be fatal Jul 1, 2024
@flokli
Copy link
Member Author

flokli commented Jul 1, 2024

Running with --no-cache also doesn't help, it still fails trying to resolve the path to the cache.

@flokli
Copy link
Member Author

flokli commented Jul 1, 2024

I still think the proper fix for this would be to throw a warning if the cache couldn't be configured, but then proceed without cache.

tvlbot pushed a commit to tvlfyi/tvix that referenced this issue Jul 1, 2024
See NixOS/nixpkgs#323753 for details.

Changes:

* git: temporarily comment out dottime patch (it doesn't apply, but it's not critical)
* third-party/cgit: use an older git version where dottime patch still applies
* 3p/crate2nix: remove crate2nix patches included in latest release
* tvix: remove unneeded defaultCrateOverrides (upstreamed to nixpkgs)
* tvix: regenerate Cargo.nix
* tvix/nix-compat: remove unnused AtermWriteable::aterm_bytes pub(crate) function
* tvix/nix-compat: remove redundant trait bounds
* tvix/glue: use clone_into() to set drv.{builder,system}
* tools/crate2nix: apply workaround for numtide/treefmt#327
* toold/depotfmt: expose treefmt config as passthru
* tools/crate2nix: undo some more hacks in the crate2nix-check drv

Change-Id: Ifbcedeb3e8f81b2f6ec1dbf10189bfa6dfd9c75c
Co-Authored-By: Florian Klink <[email protected]>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11907
Reviewed-by: tazjin <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: flokli <[email protected]>
tvlbot pushed a commit to tvlfyi/kit that referenced this issue Jul 1, 2024
See NixOS/nixpkgs#323753 for details.

Changes:

* git: temporarily comment out dottime patch (it doesn't apply, but it's not critical)
* third-party/cgit: use an older git version where dottime patch still applies
* 3p/crate2nix: remove crate2nix patches included in latest release
* tvix: remove unneeded defaultCrateOverrides (upstreamed to nixpkgs)
* tvix: regenerate Cargo.nix
* tvix/nix-compat: remove unnused AtermWriteable::aterm_bytes pub(crate) function
* tvix/nix-compat: remove redundant trait bounds
* tvix/glue: use clone_into() to set drv.{builder,system}
* tools/crate2nix: apply workaround for numtide/treefmt#327
* toold/depotfmt: expose treefmt config as passthru
* tools/crate2nix: undo some more hacks in the crate2nix-check drv

Change-Id: Ifbcedeb3e8f81b2f6ec1dbf10189bfa6dfd9c75c
Co-Authored-By: Florian Klink <[email protected]>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11907
Reviewed-by: tazjin <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: flokli <[email protected]>
@mergify mergify bot closed this as completed in #330 Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant