You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a gentoo girl shrugs I prefer building from source when possible.
Reacted by Ivan Krasin, Skyler Ross and ruby
Reacted by Juan Mier
Reacted by Francis St-Amour, Alexey Kutepov, ._|.\/\/., vaartis, Valeriy Manenkov, Nicolò Balzarotti, Igor Pashev, Bastien Rivière, Christian Bundy, Jonas Heinrich and 15 more
Barring impurities, the substitute you get from the cache should be the exact same thing you'd end up with by building it yourself. I prefer to think of it not as "building software" but as selecting from an immutable universe of artefacts (aka the Store). The fact that this sometimes involves running build commands locally is conceptually irrelevant.
I could see a case for privacy, however. I think the most reliable way to achieve this is to blackhole requests to cache.nixos.org.
build-use-substitutes
If set to true (default), Nix will use binary substitutes if available. This option can
be disabled to force building from source.
probably that's the way. @spacekitteh let us know if that's working for you.
How am I supposed to stop using a cache then? I am pretty sure that the cache I was pulling from is no longer in service but it's set in my nix.conf file
besides passing the same option to not use caches each time.
This is still an issue on nix 2.12. Rather than gentoo-esk reasons I need it for trying to understand how nixpkgs works (order of evaluation) and estimating build times.
nix \
--extra-experimental-features 'nix-command flakes' \
build \
-vvvvv \
--option build-use-substitutes false \
--option substitute false \
--substituters '' \
'.#cowsay'
evaluating derivation 'git+file:///Users/jeffhykin/repos/nixpkgs-skeleton#cowsay'...
resolved HEAD ref 'refs/heads/master'for repo '/Users/jeffhykin/repos/nixpkgs-skeleton'
using revision 4fa7caa4a20fa392451267f711b7104fb083c36e of repo '/Users/jeffhykin/repos/nixpkgs-skeleton'
acquiring write lock on '/nix/var/nix/temproots/1089'
using cache entry '{"name":"source","rev":"4fa7caa4a20fa392451267f711b7104fb083c36e","type":"git"}' ->'{"lastModified":1674427778,"rev":"4fa7caa4a20fa392451267f711b7104fb083c36e","revCount":2}', '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source'
got tree '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source' from 'git+file:///Users/jeffhykin/repos/nixpkgs-skeleton?ref=refs%2fheads%2fmaster&rev=4fa7caa4a20fa392451267f711b7104fb083c36e'
checking access to '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source/flake.nix'
evaluating file '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source/flake.nix'
old lock file: {
"nodes": {
"root": {}
},
"root": "root",
"version": 7
}
computing lock file node ''
new lock file: {
"nodes": {
"root": {}
},
"root": "root",
"version": 7
}
trying flake output attribute 'packages.aarch64-darwin.cowsay'
using cached attrset attribute ''
trying flake output attribute 'legacyPackages.aarch64-darwin.cowsay'
using cached string attribute 'legacyPackages.aarch64-darwin.cowsay.type'
using cached string attribute 'legacyPackages.aarch64-darwin.cowsay.drvPath'
using cached list of strings attribute 'legacyPackages.aarch64-darwin.cowsay.meta.outputsToInstall'
querying info about missing paths...
starting pool of 24 threads
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: created
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: woken up
querying info about missing paths...
starting pool of 24 threads
entered goal loop
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: init
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: loading derivation
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: have derivation
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: done
building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: goal destroyed
nixpkgs-skeleton on master [$?]
Activity
joachifm commentedon Nov 19, 2016
Why?
spacekitteh commentedon Nov 19, 2016
I'm a gentoo girl shrugs I prefer building from source when possible.
joachifm commentedon Nov 19, 2016
Barring impurities, the substitute you get from the cache should be the exact same thing you'd end up with by building it yourself. I prefer to think of it not as "building software" but as selecting from an immutable universe of artefacts (aka the Store). The fact that this sometimes involves running build commands locally is conceptually irrelevant.
I could see a case for privacy, however. I think the most reliable way to achieve this is to blackhole requests to cache.nixos.org.
vcunat commentedon Nov 19, 2016
These setting types are additive, i.e. all instances are collected and concatenated together.
IIRC it can be done by
nix.binaryCaches = lib.mkForce [ ];or something similar.NeQuissimus commentedon Nov 20, 2016
Why not just pass
--option use-binary-caches falsetonixos-rebuildornix-env?spacekitteh commentedon Nov 20, 2016
@vcunat I don't think that works. I just tried it.
@NeQuissimus every time I upgrade? Hell no. I follow master.
vcunat commentedon Nov 20, 2016
@spacekitteh: what does your
/etc/nix/nix.confcontain? When I set the above line, I do get an emptybinary-cachessetting in the config file.vcunat commentedon Nov 20, 2016
BTW, always passing the options doesn't necessarily mean you have to type them. Bash aliases are useful for such things, for example.
spacekitteh commentedon Nov 20, 2016
It contains exactly that line you provided. It also contains, among other things:
nix nix.buildCores = 0;joachifm commentedon Nov 24, 2016
Have you tried adding
use-binary-cachestonix.extraOptions? If you really want to build from source every time, there's alsobuild-use-substitutes.spinus commentedon Apr 8, 2017
As @joachifm mentioned:
from
man nix.confprobably that's the way.
@spacekitteh let us know if that's working for you.
nh2 commentedon Sep 5, 2017
Can we close this? What @spinus summarised, or
--option build-use-substitutes falseon the command line, is the option to disable binary caches.joachifm commentedon Sep 5, 2017
Agreed.
jskrzypek commentedon Oct 24, 2020
As a notice for future visitors, at some point the option mentioned above was deprecated, and now
man nix.confgives this:Which means that
--option build-use-substitutes falsewill likely work, but you can pass--option substitute falseas wellaugyg commentedon Dec 4, 2022
How am I supposed to stop using a cache then? I am pretty sure that the cache I was pulling from is no longer in service but it's set in my nix.conf file
besides passing the same option to not use caches each time.
jeff-hykin commentedon Feb 4, 2023
This is still an issue on nix 2.12. Rather than gentoo-esk reasons I need it for trying to understand how nixpkgs works (order of evaluation) and estimating build times.
nix \ --extra-experimental-features 'nix-command flakes' \ build \ -vvvvv \ --option build-use-substitutes false \ --option substitute false \ --substituters '' \ '.#cowsay' evaluating derivation 'git+file:///Users/jeffhykin/repos/nixpkgs-skeleton#cowsay'... resolved HEAD ref 'refs/heads/master' for repo '/Users/jeffhykin/repos/nixpkgs-skeleton' using revision 4fa7caa4a20fa392451267f711b7104fb083c36e of repo '/Users/jeffhykin/repos/nixpkgs-skeleton' acquiring write lock on '/nix/var/nix/temproots/1089' using cache entry '{"name":"source","rev":"4fa7caa4a20fa392451267f711b7104fb083c36e","type":"git"}' -> '{"lastModified":1674427778,"rev":"4fa7caa4a20fa392451267f711b7104fb083c36e","revCount":2}', '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source' got tree '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source' from 'git+file:///Users/jeffhykin/repos/nixpkgs-skeleton?ref=refs%2fheads%2fmaster&rev=4fa7caa4a20fa392451267f711b7104fb083c36e' checking access to '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source/flake.nix' evaluating file '/nix/store/bykjr6l0p8if3n1b5ysmhg213f2cznxz-source/flake.nix' old lock file: { "nodes": { "root": {} }, "root": "root", "version": 7 } computing lock file node '' new lock file: { "nodes": { "root": {} }, "root": "root", "version": 7 } trying flake output attribute 'packages.aarch64-darwin.cowsay' using cached attrset attribute '' trying flake output attribute 'legacyPackages.aarch64-darwin.cowsay' using cached string attribute 'legacyPackages.aarch64-darwin.cowsay.type' using cached string attribute 'legacyPackages.aarch64-darwin.cowsay.drvPath' using cached list of strings attribute 'legacyPackages.aarch64-darwin.cowsay.meta.outputsToInstall' querying info about missing paths... starting pool of 24 threads building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: created building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: woken up querying info about missing paths... starting pool of 24 threads entered goal loop building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: init building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: loading derivation building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: have derivation building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: done building of '/nix/store/54arbcss46kicrgqxfd0xbllb5dmn6zs-cowsay-3.7.0.drv!man,out' from .drv file: goal destroyed nixpkgs-skeleton on master [$?]