Skip to content
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

Add task to cache cargo crates and use it for MacOS/Windows builds #9841

Merged
merged 10 commits into from
Sep 11, 2024

Conversation

oskirby
Copy link
Collaborator

@oskirby oskirby commented Sep 6, 2024

Description

The rust crates used by our project are a fairly sizeable chunk of data to download on each job, and for the most part they are unlikely to change. This makes them well suited to be cached as a toolchain task. Furthermore, the existence of such a toolchain means that some of our build jobs could build directly out of git rather than needing to wait on build-source/vpn to download and vendor the crates for us.

Some notes:

  • Android (and presumably iOS) can't build with vendored crates right now as the embedded-uniffi-bindgen runs into crate version errors.
  • Linux builds are still relying on build-source/vpn because they also need some golang vendoring, and we hope to mirror the offline build environment for PPAs.

Reference

i.e Jira or Github issue URL

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

@oskirby
Copy link
Collaborator Author

oskirby commented Sep 6, 2024

Hmm, turns out the Android tasks don't build when the crates are vendored. It seems attempting to run the embedded-uniffi-bindgen tool uses Glean's Cargo.lock instead of the VPN's version and it falls apart due to version mismatches.

iOS will probably have exactly the same problem too.

@oskirby oskirby marked this pull request as ready for review September 11, 2024 15:41
@oskirby oskirby requested a review from a team as a code owner September 11, 2024 15:41
@oskirby oskirby requested review from hneiva and removed request for a team September 11, 2024 15:41
@oskirby oskirby changed the title Add task to cache cargo crates and use it for MacOS builds Add task to cache cargo crates and use it for MacOS/Windows builds Sep 11, 2024
Copy link
Collaborator

@mcleinman mcleinman left a comment

Choose a reason for hiding this comment

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

👍🏻 Thank you!

@oskirby oskirby merged commit d30504b into main Sep 11, 2024
114 checks passed
@oskirby oskirby deleted the cargo-vendor-task branch September 11, 2024 17:30
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