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

Slow evaluation time on second-time builds #523

Open
bergkvist opened this issue Nov 15, 2022 · 0 comments
Open

Slow evaluation time on second-time builds #523

bergkvist opened this issue Nov 15, 2022 · 0 comments

Comments

@bergkvist
Copy link

Using flakes is not an option for me.

I'm deploying to NixOS-machines, and want my build-pipelines to be faster when nothing has changed. It seems like mach-nix might be doing some extra (unnecessary?) work on second-time runs.

For example:

# shell.nix
let
  machNix = import (builtins.fetchTarball {
    name = "mach-nix";
    url = "https://github.com/DavHau/mach-nix/archive/refs/tags/3.5.0.tar.gz";
    sha256 = "185qf6d5xg8qk1hb1y0b5gggr71vdz8v9d5ga4zg7dmcb1aypxcg";
  }) {
    pypiDataRev = "1109d77c34289ec0996bb9f8d1c6f3ea13e33fd8";
    pypiDataSha256 = "sha256:0mv07ab987xdqdg45c2wrngkvkyx3sr625xpxiim9c84sypa7q9b";
  };
in
machNix.mkPython {
  python = "python39Full";
  requirements = ''
    flask
    msal
    httpx-oauth
  '';
}

Evaluating this the second time takes 5-6 seconds, and prints out several trace-messages:

$ time nix-shell --run "exit"
trace: 
applying fix 'remove-patches' (patches) for httpx:0.23.0

trace: removing dependency python3.9-packaging-21.3 from cryptography
trace: 
applying fix 'no-rust-build' (nativeBuildInputs) for cryptography:3.3.2

trace: removing dependency python3.9-setuptools-rust-0.12.1 from cryptography
nix-shell --run "exit"  2.58s user 0.45s system 55% cpu 5.416 total

Is there a way to prevent this patchwork/fixing from being repeated? Or to otherwise make the build fast when nothing has changed since the last evaluation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant