Skip to content

ci: replace cargo-make with a custom cargo-xtask #1461

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 4 commits into from
Nov 2, 2024
Merged

ci: replace cargo-make with a custom cargo-xtask #1461

merged 4 commits into from
Nov 2, 2024

Conversation

joshka
Copy link
Member

@joshka joshka commented Nov 1, 2024

This removes the need for cargo-make and replaces it with a custom xtask
binary. See https://github.com/matklad/cargo-xtask for info.

Rearranges the CI workflow to use the new xtask and simplify which
workflows that run.

@joshka joshka requested a review from a team as a code owner November 1, 2024 02:41
@joshka
Copy link
Member Author

joshka commented Nov 1, 2024

image

This removes the need for cargo-make and replaces it with a custom xtask
binary. See <https://github.com/matklad/cargo-xtask> for info.

Rearranges the CI workflow to use the new xtask and simplify which
workflows that run.
@joshka
Copy link
Member Author

joshka commented Nov 1, 2024

There's a good CI time reduction from this due to lowering the number of jobs from 39 to 31. The latest CI run succeeded in 5:30. Previous runs were 8-15 mins.

Copy link
Contributor

github-actions bot commented Nov 1, 2024

🐰 Bencher Report

Branch1461/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
barchart/render/2048📈 view plot
⚠️ NO THRESHOLD
203,280.00
barchart/render/256📈 view plot
⚠️ NO THRESHOLD
139,310.00
barchart/render/64📈 view plot
⚠️ NO THRESHOLD
88,506.00
barchart/render_grouped/2048📈 view plot
⚠️ NO THRESHOLD
346,580.00
barchart/render_grouped/256📈 view plot
⚠️ NO THRESHOLD
146,080.00
barchart/render_grouped/64📈 view plot
⚠️ NO THRESHOLD
134,350.00
barchart/render_horizontal/2048📈 view plot
⚠️ NO THRESHOLD
164,610.00
barchart/render_horizontal/256📈 view plot
⚠️ NO THRESHOLD
82,897.00
barchart/render_horizontal/64📈 view plot
⚠️ NO THRESHOLD
76,346.00
block/render_all_feature/100x50📈 view plot
⚠️ NO THRESHOLD
11,167.00
block/render_all_feature/200x50📈 view plot
⚠️ NO THRESHOLD
19,330.00
block/render_all_feature/256x256📈 view plot
⚠️ NO THRESHOLD
92,560.00
block/render_empty/100x50📈 view plot
⚠️ NO THRESHOLD
6,101.50
block/render_empty/200x50📈 view plot
⚠️ NO THRESHOLD
11,865.00
block/render_empty/256x256📈 view plot
⚠️ NO THRESHOLD
78,633.00
buffer/empty/16📈 view plot
⚠️ NO THRESHOLD
781.57
buffer/empty/255📈 view plot
⚠️ NO THRESHOLD
217,740.00
buffer/empty/64📈 view plot
⚠️ NO THRESHOLD
13,146.00
buffer/filled/16📈 view plot
⚠️ NO THRESHOLD
777.16
buffer/filled/255📈 view plot
⚠️ NO THRESHOLD
225,070.00
buffer/filled/64📈 view plot
⚠️ NO THRESHOLD
13,323.00
buffer/with_lines/16📈 view plot
⚠️ NO THRESHOLD
15,442.00
buffer/with_lines/255📈 view plot
⚠️ NO THRESHOLD
14,881.00
buffer/with_lines/64📈 view plot
⚠️ NO THRESHOLD
13,647.00
line_render/Center/0📈 view plot
⚠️ NO THRESHOLD
4.02
line_render/Center/10📈 view plot
⚠️ NO THRESHOLD
632.80
line_render/Center/3📈 view plot
⚠️ NO THRESHOLD
299.56
line_render/Center/4📈 view plot
⚠️ NO THRESHOLD
343.71
line_render/Center/42📈 view plot
⚠️ NO THRESHOLD
844.37
line_render/Center/6📈 view plot
⚠️ NO THRESHOLD
401.39
line_render/Center/7📈 view plot
⚠️ NO THRESHOLD
457.13
line_render/Left/0📈 view plot
⚠️ NO THRESHOLD
4.02
line_render/Left/10📈 view plot
⚠️ NO THRESHOLD
594.19
line_render/Left/3📈 view plot
⚠️ NO THRESHOLD
229.59
line_render/Left/4📈 view plot
⚠️ NO THRESHOLD
244.30
line_render/Left/42📈 view plot
⚠️ NO THRESHOLD
843.03
line_render/Left/6📈 view plot
⚠️ NO THRESHOLD
389.43
line_render/Left/7📈 view plot
⚠️ NO THRESHOLD
403.24
line_render/Right/0📈 view plot
⚠️ NO THRESHOLD
4.02
line_render/Right/10📈 view plot
⚠️ NO THRESHOLD
570.27
line_render/Right/3📈 view plot
⚠️ NO THRESHOLD
278.14
line_render/Right/4📈 view plot
⚠️ NO THRESHOLD
333.06
line_render/Right/42📈 view plot
⚠️ NO THRESHOLD
845.09
line_render/Right/6📈 view plot
⚠️ NO THRESHOLD
442.58
line_render/Right/7📈 view plot
⚠️ NO THRESHOLD
499.37
list/render/16384📈 view plot
⚠️ NO THRESHOLD
1,213,200.00
list/render/2048📈 view plot
⚠️ NO THRESHOLD
324,420.00
list/render/64📈 view plot
⚠️ NO THRESHOLD
190,790.00
list/render_scroll_half/16384📈 view plot
⚠️ NO THRESHOLD
1,231,900.00
list/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
330,420.00
list/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
132,110.00
paragraph/new/2048📈 view plot
⚠️ NO THRESHOLD
259,180.00
paragraph/new/64📈 view plot
⚠️ NO THRESHOLD
6,833.60
paragraph/new/65535📈 view plot
⚠️ NO THRESHOLD
8,118,900.00
paragraph/render/2048📈 view plot
⚠️ NO THRESHOLD
611,630.00
paragraph/render/64📈 view plot
⚠️ NO THRESHOLD
573,260.00
paragraph/render/65535📈 view plot
⚠️ NO THRESHOLD
1,697,800.00
paragraph/render_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
588,550.00
paragraph/render_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
607,550.00
paragraph/render_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,679,700.00
paragraph/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
588,860.00
paragraph/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
609,550.00
paragraph/render_scroll_half/65535📈 view plot
⚠️ NO THRESHOLD
1,679,100.00
paragraph/render_wrap/2048📈 view plot
⚠️ NO THRESHOLD
281,460.00
paragraph/render_wrap/64📈 view plot
⚠️ NO THRESHOLD
240,960.00
paragraph/render_wrap/65535📈 view plot
⚠️ NO THRESHOLD
1,467,300.00
paragraph/render_wrap_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
281,790.00
paragraph/render_wrap_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
240,210.00
paragraph/render_wrap_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,474,100.00
rect/rect_columns_collect/16📈 view plot
⚠️ NO THRESHOLD
39.03
rect/rect_columns_collect/255📈 view plot
⚠️ NO THRESHOLD
294.19
rect/rect_columns_collect/64📈 view plot
⚠️ NO THRESHOLD
90.59
rect/rect_columns_iter/16📈 view plot
⚠️ NO THRESHOLD
10.71
rect/rect_columns_iter/255📈 view plot
⚠️ NO THRESHOLD
84.11
rect/rect_columns_iter/64📈 view plot
⚠️ NO THRESHOLD
26.19
rect/rect_positions_collect/16x16📈 view plot
⚠️ NO THRESHOLD
293.07
rect/rect_positions_collect/255x255📈 view plot
⚠️ NO THRESHOLD
60,538.00
rect/rect_positions_collect/64x64📈 view plot
⚠️ NO THRESHOLD
3,895.20
rect/rect_positions_iter/16x16📈 view plot
⚠️ NO THRESHOLD
248.92
rect/rect_positions_iter/255x255📈 view plot
⚠️ NO THRESHOLD
60,333.00
rect/rect_positions_iter/64x64📈 view plot
⚠️ NO THRESHOLD
3,813.80
rect/rect_rows_collect/16📈 view plot
⚠️ NO THRESHOLD
38.06
rect/rect_rows_collect/255📈 view plot
⚠️ NO THRESHOLD
264.20
rect/rect_rows_collect/64📈 view plot
⚠️ NO THRESHOLD
83.89
rect/rect_rows_iter/16📈 view plot
⚠️ NO THRESHOLD
7.78
rect/rect_rows_iter/255📈 view plot
⚠️ NO THRESHOLD
80.51
rect/rect_rows_iter/64📈 view plot
⚠️ NO THRESHOLD
21.53
sparkline/render/2048📈 view plot
⚠️ NO THRESHOLD
125,170.00
sparkline/render/256📈 view plot
⚠️ NO THRESHOLD
123,260.00
sparkline/render/64📈 view plot
⚠️ NO THRESHOLD
39,248.00
table/render/16384x2📈 view plot
⚠️ NO THRESHOLD
2,843,300.00
table/render/16384x4📈 view plot
⚠️ NO THRESHOLD
5,418,600.00
table/render/16384x8📈 view plot
⚠️ NO THRESHOLD
15,894,000.00
table/render/2048x2📈 view plot
⚠️ NO THRESHOLD
638,980.00
table/render/2048x4📈 view plot
⚠️ NO THRESHOLD
1,083,300.00
table/render/2048x8📈 view plot
⚠️ NO THRESHOLD
1,781,800.00
table/render/64x2📈 view plot
⚠️ NO THRESHOLD
326,400.00
table/render/64x4📈 view plot
⚠️ NO THRESHOLD
500,810.00
table/render/64x8📈 view plot
⚠️ NO THRESHOLD
572,670.00
table/render_scroll_half/16384x2📈 view plot
⚠️ NO THRESHOLD
2,854,000.00
table/render_scroll_half/16384x4📈 view plot
⚠️ NO THRESHOLD
5,556,300.00
table/render_scroll_half/16384x8📈 view plot
⚠️ NO THRESHOLD
17,347,000.00
table/render_scroll_half/2048x2📈 view plot
⚠️ NO THRESHOLD
626,570.00
table/render_scroll_half/2048x4📈 view plot
⚠️ NO THRESHOLD
1,079,800.00
table/render_scroll_half/2048x8📈 view plot
⚠️ NO THRESHOLD
1,776,900.00
table/render_scroll_half/64x2📈 view plot
⚠️ NO THRESHOLD
218,030.00
table/render_scroll_half/64x4📈 view plot
⚠️ NO THRESHOLD
329,340.00
table/render_scroll_half/64x8📈 view plot
⚠️ NO THRESHOLD
376,380.00
🐰 View full continuous benchmarking report in Bencher

@orhun
Copy link
Member

orhun commented Nov 1, 2024

Does doing this have any workspace-related advantages other than speeding up the CI? I haven't worked with xtask before so I'm trying to understand the benefits. I'd be happy if you can provide more information (maybe in the commit summary) why this is better than cargo-make.

@joshka
Copy link
Member Author

joshka commented Nov 1, 2024

Does doing this have any workspace-related advantages other than speeding up the CI? I haven't worked with xtask before so I'm trying to understand the benefits. I'd be happy if you can provide more information (maybe in the commit summary) why this is better than cargo-make.

Regularly when I run cargo make, it tells me there's an update available. That was the bit that annoyed me enough to do this.
I've been thinking about this for some time, and the rationale is mentioned in the link:

  • It doesn't require any other binaries besides cargo and rustc, it fully bootstraps from them
  • Unlike bash, it can more easily be cross platform, as it doesn't use the shell.

By using an xtask approach, all the CI steps that previously needed cargo-make already have the necessary tools they need to run installed (and these are likely cached between runs too).

My secondary rationale is a general distaste for implementing imperative logic (here instructions on what and how to build) in declarative languages (here toml) or in shell scripts. The code for detecting the default workspace members to run the cargo-docs-rs packages would have been difficult to get right, and would have tended to just be hardcoded instead of letting the existing workspace metadata define what is built. I just like looking at rust for this. It looks pretty simple and obvious.

I also wanted something that would be easy to extend into watching for changes and checking that things are ready for PR in the background (to save having to make small clippy / typos / formatting issue updates), and which could our existing shell scripts (for releases and vhs generation)

Lastly I wanted to experiment with the approach, as it seems like a neat idea generally.

I don't think much of this really belongs in the changelog, which IMO should really contain info about user focused things and less internal things like this.

@orhun
Copy link
Member

orhun commented Nov 2, 2024

Fair enough.

@orhun orhun merged commit 2ef3583 into main Nov 2, 2024
31 of 32 checks passed
@orhun orhun deleted the jm/xtask branch November 2, 2024 07:03
This was referenced Feb 11, 2025
This was referenced Mar 3, 2025
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.

2 participants