Skip to content

Conversation

@xokdvium
Copy link
Contributor

Motivation

This adds a GHA jobs to help analyze build times
and its regressions. It is based on clangStdenv with -ftime-trace together with ClangBuildAnalyzer to prepare markdown summary for individual components.

The job is only run on the master branch on pushes. Not sure that running this job for all PRs is worthwhile.

This also has the minor benefit of dogfooding CA and impure derivations.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This adds a GHA jobs to help analyze build times
and its regressions. It is based on `clangStdenv` with `-ftime-trace`
together with `ClangBuildAnalyzer` to prepare markdown summary for
individual components.

This also has the minor benefit of dogfooding CA and impure derivations.
@xokdvium xokdvium requested review from Mic92 and roberth July 20, 2025 15:52
@xokdvium xokdvium requested a review from edolstra as a code owner July 20, 2025 15:52
@xokdvium
Copy link
Contributor Author

Example of the summary: https://github.com/xokdvium/nix/actions/runs/16401423399

@xokdvium xokdvium added the contributor-experience Developer experience for Nix contributors label Jul 20, 2025
}
);

componentsToProfile = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should come up with something a bit nicer than hardcoding lists like this over and over, but that'd be a separate task.

buildTimeReport =
pkgs.runCommand "build-time-report"
{
__impure = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

mesonComponentOverrides = finalAttrs: prevAttrs: {
outputs = (prevAttrs.outputs or [ "out" ]) ++ [ "buildprofile" ];
nativeBuildInputs = [ pkgs.clangbuildanalyzer ] ++ prevAttrs.nativeBuildInputs or [ ];
__impure = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edolstra in the magic action, it'd be good to avoid saving impure paths, because they can't be reused anyway.

@xokdvium xokdvium merged commit 7e184bb into NixOS:master Jul 21, 2025
13 checks passed
@xokdvium xokdvium deleted the build-profiling branch July 27, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor-experience Developer experience for Nix contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants