crane icon indicating copy to clipboard operation
crane copied to clipboard

Consecutive `nix build`s result in different builds and nix store outputs

Open samuela opened this issue 1 year ago • 1 comments

root@b62e2017d34d:/workspaces/bitbop/cherami# nix build .#cherami-build --json
[{"drvPath":"/nix/store/pgdmyk1hp4522mhizncd35nc7paaphpm-cherami-build.drv","outputs":{"out":"/nix/store/kxxrqw6ga3rnz0wvcr6k972rcx9y0yp3-cherami-build"},"startTime":1713302261,"stopTime":1713302470}]
root@b62e2017d34d:/workspaces/bitbop/cherami# nix build .#cherami-build --json
[{"drvPath":"/nix/store/ca13xkr0cyg0yvq32rmr0mlk6lhvfl12-cherami-build.drv","outputs":{"out":"/nix/store/wng10qh7bkpyh36phq7h84pjgbdwpv08-cherami-build"},"startTime":1713303254,"stopTime":1713303460}]

I didn't change any source files in the meantime. Why is it building twice and resulting in 2 different nix store paths?

samuela avatar Apr 16 '24 21:04 samuela

Hi @samuela thanks for the report! Could you please provide a flake that reproduces the issue?

Otherwise please take a look at the following docs:

  • https://github.com/ipetkov/crane/blob/55f4939ac59ff8f89c6a4029730a2d49ea09105f/docs/faq/constant-rebuilds.md
  • https://github.com/ipetkov/crane/blob/55f4939ac59ff8f89c6a4029730a2d49ea09105f/docs/source-filtering.md

ipetkov avatar Apr 21 '24 17:04 ipetkov