Skip to content

Incremental meson build on CI #40994

@user202729

Description

@user202729

Problem Description

Currently, on each CI run, Sage need to be rebuilt.

In practice, it isn't all that bad because there is ccache. Which means (if it works correctly) only the pyx → c step need to be redone each time, the c → shared library step is reused.

However, we can still speed it up more. Currently it is sometimes fast (6 minutes), but sometimes slow (20+ minutes). See also #40957

[*] it's puzzling how the cache size is only 60MB, I'd have thought there be much more. In particular if I do du -ch $(find . -name "*.o") in my local build directory, I get 232MB, and du -ch $(find . -name "*.p") gives 909MB.

Proposed Solution

After each build, use tar to store the state of the build folder, then in the next CI run download it.

Before #39641, test-new use a docker image which preserves the filesystem, thus also preserve the timestamp needed for make to do dependency tracking. Afterwards, it is not reimplemented. (Although moving from make to meson also gain performance because make is not as efficient, I'd say we lose one feature to gain another feature, so it nets out.)

Side note,

  • tar should be faster than docker, require less ad hoc code, and doesn't require the possibly-confusing nested layer of filesystem.
  • assume ninja track dependency updates correctly (unlike make), the incremental build shouldn't cause an issue. Although this assumption may be overoptimistic.

(I don't know what's the advantage of docker over tar. Maybe @kwankyu can comment?)

Alternatives Considered

Additional Information

No response

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions