Skip to content

CI: Migrate test-new to meson #39641

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

Merged
merged 9 commits into from
Apr 2, 2025
Merged

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Mar 7, 2025

Migrates the test-new workflow to use Meson. The Meson build system rebuilds faster and leverages standard tools like ccache for caching Cython file compilation. The github workflow is also considerably easier to read and maintain now.

To ensure reliability, pushing the Docker image in the build workflow has been disabled, as it was continuously clogging the GitHub cache (limited to 10GB, while each cached image consumes several gigabytes). This change also resolves intermittent workflow failures caused by unsuccessful image pushes.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@tobiasdiez tobiasdiez mentioned this pull request Mar 7, 2025
5 tasks
test-long:
runs-on: ubuntu-latest
needs: [test-new]
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't remove this defeat the whole point of test-new? (that you do a fast-fail when there's a trivial error to notify the pull request author to fix it, so you don't burn CPU on testing the rest of the files)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main point of test-new is that it provides quick feedback for devs. But I'm planning to also move these "long" tests to meson in a follow-up and then it's indeed a good idea to make run only after all other normal tests were passing.

@user202729
Copy link
Contributor

leverages standard tools like ccache for caching Cython file compilation

By the way, the only benefit of ccache I can see is when you git checkout a far away branch, does something, then git checkout back — the reason why meson would have taken longer without ccache is that the file modification time are bumped.

If you're already using docker then ccache should be useless. Also there's a risk of some hidden cache stale issue (there'd better be a rebuild from scratch every release at least)

@tobiasdiez
Copy link
Contributor Author

leverages standard tools like ccache for caching Cython file compilation

By the way, the only benefit of ccache I can see is when you git checkout a far away branch, does something, then git checkout back — the reason why meson would have taken longer without ccache is that the file modification time are bumped.
If you're already using docker then ccache should be useless. Also there's a risk of some hidden cache stale issue (there'd better be a rebuild from scratch every release at least)

The meson workflow is not using docker and thus ccache is used to cache the compilation (more precisely: cython is still run on all cython files, but the compilation of the resulting c/c++ is cached).

Copy link

github-actions bot commented Mar 7, 2025

Documentation preview for this PR (built with commit 87caf60; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Contributor

@user202729 user202729 left a comment

Choose a reason for hiding this comment

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

Sure why not, at least it's not slower than the current test-new.

The missing feature is "only run test-long (& full test with meson) if test-new succeeds" but… the only disadvantage is wasted electricity, I suppose.

@tobiasdiez
Copy link
Contributor Author

Thanks @user202729 for the review. I'm setting this now to "positive review", hope you are okay with this.

@user202729
Copy link
Contributor

Wait a minute…

codecov/project — 54.14% (-35.74%) compared to f280b7d

Any idea why it's like this?

@tobiasdiez
Copy link
Contributor Author

Shouldn't be caused by this PR; in fact, the checks for the commit for the last merge commit were okay.

It is because the test-long runs fail due to out-of-space errors. This later issue comes most likely from me merging the latest develop branch into this branch before the base image was build in ci-linux. The whole setup is sadly rather unstable.

@user202729
Copy link
Contributor

So… it's random? I guess if you retrigger CI it should be fine then?

(why does the amount of disk usage fluctuate anyway? Sound like a bug somewhere…)

vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 1, 2025
sagemathgh-39641: CI: Migrate test-new to meson
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Migrates the `test-new` workflow to use Meson. The Meson build system
rebuilds faster and leverages standard tools like `ccache` for caching
Cython file compilation. The github workflow is also considerably easier
to read and maintain now.

To ensure reliability, pushing the Docker image in the build workflow
has been disabled, as it was continuously clogging the GitHub cache
(limited to 10GB, while each cached image consumes several gigabytes).
This change also resolves intermittent workflow failures caused by
unsuccessful image pushes.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39641
Reported by: Tobias Diez
Reviewer(s): Tobias Diez, user202729
@vbraun vbraun merged commit fa4c0cf into sagemath:develop Apr 2, 2025
21 of 25 checks passed
@tobiasdiez tobiasdiez deleted the migrate-ci-meson branch April 2, 2025 23:45
@user202729 user202729 mentioned this pull request Apr 4, 2025
5 tasks
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 7, 2025
sagemathgh-39867: Run long test in test-new
    
sagemath#39641 introduced an issue that
long new tests are not ran in test-new.

This is an issue because then the author is only notified by the failure
when test-long finishes. (e.g. happened to me in
sagemath#39733 .)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39867
Reported by: user202729
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 10, 2025
sagemathgh-39867: Run long test in test-new
    
sagemath#39641 introduced an issue that
long new tests are not ran in test-new.

This is an issue because then the author is only notified by the failure
when test-long finishes. (e.g. happened to me in
sagemath#39733 .)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39867
Reported by: user202729
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 13, 2025
sagemathgh-39867: Run long test in test-new
    
sagemath#39641 introduced an issue that
long new tests are not ran in test-new.

This is an issue because then the author is only notified by the failure
when test-long finishes. (e.g. happened to me in
sagemath#39733 .)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39867
Reported by: user202729
Reviewer(s): Tobias Diez
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 18, 2025
sagemathgh-39867: Run long test in test-new
    
sagemath#39641 introduced an issue that
long new tests are not ran in test-new.

This is an issue because then the author is only notified by the failure
when test-long finishes. (e.g. happened to me in
sagemath#39733 .)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39867
Reported by: user202729
Reviewer(s): Tobias Diez
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

Successfully merging this pull request may close these issues.

3 participants