Depends on D114379 Differential Revision: https://phabricator.services.mozilla.com/D114380
2 KiB
Developing with a local Glean build
FOG uses a release version of Glean, as published on crates.io.
For local development and try runs you can replace this Glean implementation with a local or remote version.
-
To tell
machwhere to find your Glean, patch the top-levelCargo.toml. E.g. like this:glean = { git = "https://github.com/myfork/glean", branch = "my-feature-branch" } glean-core = { git = "https://github.com/myfork/glean", branch = "my-feature-branch" }Both crates are required to ensure they are in sync.
You can specify the exact code to use by
branch,tagorrev(Git commit). See the cargo documentation for details.You can also use a path dependency:
glean = { path = "../glean/glean-core/rlb" } glean_core = { path = "../glean/glean-core" } -
If the crate version in the patched repository is not semver-compatible with the version required by the
fogandfog_controlcrates, you need to change the version in the following files to match the ones in yourgleanrepo:toolkit/components/glean/Cargo.toml toolkit/components/glean/api/Cargo.toml -
Update the Cargo lockfile:
cargo update -p glean -
Vendor the changed crates:
./mach vendor rustNote: If you're using a path dependency,
mach vendor rustdoesn't actually change files. Instead it pulls the files directly from the location on disk you specify. -
Finally build Firefox:
./mach build
A remote reference works for try runs as well, but a path dependency will not.
Please ensure to not land a non-release version of Glean.