Skip to content

build: add make android heuristics [WPB-19444] #1382

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 13 commits into from
Aug 20, 2025

Conversation

coriolinus
Copy link
Contributor

What's new in this PR


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link

github-actions bot commented Aug 19, 2025

🐰 Bencher Report

Branchprgn/build/19444-make-android-heuristics
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
Commit add f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
17,255.00 µs
Commit add f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
734.58 µs
Commit add f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
4,187.90 µs
Commit add f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
7,646.60 µs
Commit add f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
11,414.00 µs
Commit add f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
14,387.00 µs
Commit add f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
980,100.00 µs
Commit add f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
713.75 µs
Commit add f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
79,574.00 µs
Commit add f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
217,350.00 µs
Commit add f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
424,280.00 µs
Commit add f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
672,970.00 µs
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
115,820.00 µs
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
22,760.00 µs
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
41,118.00 µs
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
57,127.00 µs
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
76,465.00 µs
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
92,306.00 µs
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
🚷 view threshold
17,097.00 µs
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
🚷 view threshold
113,780.00 µs
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
🚷 view threshold
34,228.00 µs
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
🚷 view threshold
55,449.00 µs
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
🚷 view threshold
74,681.00 µs
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
🚷 view threshold
94,007.00 µs
Commit remove f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
10,391.00 µs
Commit remove f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
581.61 µs
Commit remove f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
2,222.80 µs
Commit remove f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
4,015.00 µs
Commit remove f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
6,040.70 µs
Commit remove f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
8,159.70 µs
Commit remove f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
13,771.00 µs
Commit remove f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
133,900.00 µs
Commit remove f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
110,190.00 µs
Commit remove f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
86,253.00 µs
Commit remove f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
62,113.00 µs
Commit remove f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
37,823.00 µs
Commit update f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
134,510.00 µs
Commit update f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
744.49 µs
Commit update f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
28,034.00 µs
Commit update f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
54,800.00 µs
Commit update f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
82,489.00 µs
Commit update f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
108,410.00 µs
🐰 View full continuous benchmarking report in Bencher

@coriolinus coriolinus force-pushed the prgn/build/19444-make-android-heuristics branch from 62e6cc7 to a53cb98 Compare August 19, 2025 15:15
We can name the actual library files built by those commands, so use
those instead of stamp files.
This isn't perfect--if we adjust `~/.cargo/config.toml`, for example,
then we really should rebuild Rust stuff, and Make won't know about
it--but in the vast majority of cases, this is going to call cargo
only when it actually needs to.
The [docs] are pretty unspecific about what specific circumstances
actually require rebuilding the `uniffi-bindgen` binary, and in testing
I haven't been able to isolate any specific cases other than it not
existing yet. So this adjusts things to always use the existing
binary, if it exists.

Should make caching easier on CI as well, at least in principle.

[docs]: https://mozilla.github.io/uniffi-rs/0.29/tutorial/foreign_language_bindings.html
We don't need a step letting us explicitly build `core-crypto-ffi`;
we'll just invoke `cargo` directly if we want that. Depending on
the `release-build` step was messing with our build process, as well:
it was marked as phony, meaning that everything downstream was marked
as dirty even if cargo had decided that it was all fine.

Getting rid of it means that make knows what file to actually look at,
and can rebuild or not based on that.

Also we have the `$(UNIFFI_BINDGEN)` variable, so use it.
Depending on the `.PHONY`'d "pretty" names means that everything
downstream gets rerun every time: precisely what we do not want.
- do not touch stamps (they are pointless now)
- use vars not step names so phony doesn't pollute downstream
- add a mode check so we will not get false negatives with gradle
- android target builds all depend on rust sources
- android target builds use the env check as an "order-only" prerequisite

  order-only prereqs run without marking the target as dirty, meaning
  that it's ok if they are phony; their running does not pollute downstream.
Having an `android` target which built the target binaries but then did not
run gradle on them was kind of pointless.

`android-test` was not actually running any tests.

Take these two facts together, and it made more sense to consolidate.
@coriolinus coriolinus force-pushed the prgn/build/19444-make-android-heuristics branch 2 times, most recently from b97dd45 to 35c799f Compare August 19, 2025 15:18
@coriolinus coriolinus force-pushed the prgn/build/19444-make-android-heuristics branch 2 times, most recently from cf3225b to 2ce31a2 Compare August 20, 2025 07:23
@coriolinus coriolinus changed the title build: add make android-test heuristics [WPB-19444] build: add make android heuristics [WPB-19444] Aug 20, 2025
@coriolinus coriolinus force-pushed the prgn/build/19444-make-android-heuristics branch from 2ce31a2 to ffa813e Compare August 20, 2025 07:38
@coriolinus coriolinus force-pushed the prgn/build/19444-make-android-heuristics branch from ffa813e to 313813a Compare August 20, 2025 07:41
@coriolinus coriolinus marked this pull request as ready for review August 20, 2025 08:03
@coriolinus coriolinus requested a review from a team as a code owner August 20, 2025 08:03
Copy link
Contributor

@SimonThormeyer SimonThormeyer left a comment

Choose a reason for hiding this comment

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

Great job!

@coriolinus coriolinus merged commit 6b5b2f3 into main Aug 20, 2025
34 checks passed
@coriolinus coriolinus deleted the prgn/build/19444-make-android-heuristics branch August 20, 2025 08:57
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