-
Notifications
You must be signed in to change notification settings - Fork 5
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
What does this package do? #1
Comments
same question ^^ relevant code is nix-ccache in flake.nix and cc-wrapper.sh but i dont see how compare this to # nixpkgs/pkgs/top-level/all-packages.nix
{
# Wrapper that works as gcc or g++
# It can be used by setting in nixpkgs config like this, for example:
# replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
# But if you build in chroot, you should have that path in chroot
# If instantiated directly, it will use $HOME/.ccache as the cache directory,
# i.e. /homeless-shelter/.ccache using the Nix daemon.
# You should specify a different directory using an override in
# packageOverrides to set extraConfig.
#
# Example using Nix daemon (i.e. multiuser Nix install or on NixOS):
# packageOverrides = pkgs: {
# ccacheWrapper = pkgs.ccacheWrapper.override {
# extraConfig = ''
# export CCACHE_COMPRESS=1
# export CCACHE_DIR=/var/cache/ccache
# export CCACHE_UMASK=007
# '';
# };
# You can use a different directory, but whichever directory you choose
# should be owned by user root, group nixbld with permissions 0770.
ccacheWrapper = makeOverridable ({ extraConfig, cc }:
cc.override {
cc = ccache.links {
inherit extraConfig;
unwrappedCC = cc.cc;
};
}) {
extraConfig = "";
inherit (stdenv) cc;
};
ccacheStdenv = lowPrio (makeOverridable ({ stdenv, ... } @ extraArgs:
overrideCC stdenv (buildPackages.ccacheWrapper.override ({
inherit (stdenv) cc;
} // lib.optionalAttrs (builtins.hasAttr "extraConfig" extraArgs) {
extraConfig = extraArgs.extraConfig;
}))) {
inherit stdenv;
}); related: my failed experiment with static build graphsee also my experiment, to implement ccache/distcc in nix https://discourse.nixos.org/t/distributed-nix-build-split-large-package-into-many-derivations/15979
no need for recursive nix, all derivations are generated in nix (not in bash) |
It doesn't use ccache, it's just named after it because it provides similar functionality (caching and distributed builds). It should probably be renamed. |
aah, of course to make this work, i had to add full config example# /etc/nixos/configuration.nix
{
nix.extraOptions = ''
experimental-features = nix-command flakes recursive-nix
system-features = nixos-test benchmark big-parallel kvm recursive-nix
keep-outputs = true
keep-derivations = true
'';
nix.package = pkgs.nixUnstable; rename ... nixrecc, the recursive nix compiler? nix-objcache? |
Ohhh, this is very interesting: |
Hi!
This package has very little documentation, so I am unsure whether it's fit for my purpose...
I am looking for a way to use ccache inside Nix builds, to save CI time when rebuilding big packages of which only small bits change. I guess to do this really, one would need disable the sandbox somehow, since the
ccache
cache needs to be persisted across builds. Or maybe there is another way that a Nix mastermind like @edolstra has in mind :)Is this doing this? What is this package achieving instead?
The text was updated successfully, but these errors were encountered: