Is anyone aware of a way to force a package to rebuild? I’m trying to optimize a build job by fiddling around with the --cores and --max-jobs settings in Nix, and the corresponding -j setting for gcc. In order to do so, I need to be able to re-run the same build multiple times and compare results. I notice that nix build has a --rebuild option, but that doesn’t seem to force an actual re-build.
It isn’t. AFAIK rebuild and check do the same thing in the different CLIs, though I don’t think I’ve used the flake version. I know I’ve successfully used check in nix-build.
currently trying this on nix 2.17.0 and here nix build --rebuild ... seems to ignore the --builders ... flag and also the preconfigured builders via /etc/nixos/machines. trying to delegate a rebuild from a linux to a darwin machine yields the following error:
env NEXTEST_EXTRA_ARGS="request_timeout" nix build --builders "ssh-ng://builder@167.235.13.208 x86_64-darwin - 4 1 nix-command,flakes,ca-derivations,impure-derivations,recursive-nix - -" --rebuild -vL --impure --show-trace --override-input versions ./versions/weekly --override-input holochain . .#packages.x86_64-darwin.build-holochain-tests-unit
(...)
error: a 'x86_64-darwin' with features {} is required to build '/nix/store/4agkixxfhj29rly6j09jg4p00hr84rx1-holochain-tests-nextest-nextest-workspace.drv', but I am a 'x86_64-linux' with features {ca-derivations, recursive-nix}