Closed Bug 1591563 Opened 5 years ago Closed 4 years ago

Get an empty integration layer crate to build

Categories

(Toolkit :: Telemetry, task, P1)

task
Points:
2

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: chutten, Assigned: chutten)

References

Details

Attachments

(2 files, 1 obsolete file)

According to the FOGotype Design Proposal, the Firefox Integration Layer will be a Rust crate living in mozilla-central.

That's lacking a bit in detail:

  • Where in the tree should it live? Under toolkit/components/telemetry?
  • What should we name it?
  • How can we integrate it with the build system? (there are resources in the notes)
  • How will we wrap it in such a way that C++ code can call it? And that it can call C++ code? Or JS code, if that's where the networking will be done?
  • How will we ensure this code is only built when we want it to be (for now: only in Nightly)

(( and this is all before we even actually call any Glean code or supply a mechanism for sending pings and stuff ))

Answer these questions, document anything that we might want to remember later, and build a nutrition-free Integration Layer that builds, and does nothing else.

Blocks: 1591564

Proposal:

  • It should live in toolkit/components/telemetry
  • It should be named fog
  • It will be integrated in the usual way
  • We should move figuring out the wrapping stuff later. This isn't the right bug for that.
  • As for how to ensure this code is only in Nightly and dev builds, I asked :lina about that and she said (I only did a little reformatting):

check out MOZ_NEW_XULSTORE! you'd add a flag to moz.configure first, to gate it to nightly
then reflect that flag into a cargo feature, so you can reference it in Cargo.toml and [cfg(feature)]
then add your crate as an optional dependency here
and another feature here
and finally, annotate the extern crate annotation with [cfg(feature)]

Essentially, if we can write the moz.configure code necessary to detect the conditions we want, this^ is the plumbing for how to get it from moz.configure to where we need it.

Good enough for you, Alessio?

Flags: needinfo?(alessio.placitelli)

(In reply to Chris H-C :chutten from comment #1)

Essentially, if we can write the moz.configure code necessary to detect the conditions we want, this^ is the plumbing for how to get it from moz.configure to where we need it.

Good enough for you, Alessio?

This sounds good enough for sure!

Flags: needinfo?(alessio.placitelli)

There was also one more place I needed to put it: toolkit/library/rust/Cargo.toml Otherwise toolkit/library/rust/shared/ doesn't get told about it.

Assignee: nobody → chutten
Status: NEW → ASSIGNED
Points: --- → 2
Priority: -- → P1

I tested that the crate doesn't build in non-Nightly configurations by changing config/milestone.txt to be for b1 instead of a1 and by putting a syntax error in the crate. Firefox built successfully. Then I put a1 back, and Firefox failed to build. Then I removed the syntax error, and Firefox built.

Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/12900ca1c780
Add an empty do-nothing crate for fogotype work r=janerik
https://hg.mozilla.org/integration/autoland/rev/c533ffe37892
Only build the fogotype crate on Nightly r=janerik,lina

Huh. Once again pointing out how local builds don't match actual builds. I'll look into it.

Flags: needinfo?(chutten)

There was another place I needed to put it: toolkit/library/gtest/rust/Cargo.toml Otherwise when it's building gkrust-gtest it doesn't know if it should include fog or not. New try here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=11bea026a57e697bdf9d9cd0cfce1d2bd09e3080

Also also, I needed to provide a license that was recognized by lint. (I chose MPL2)

Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9bd151c03945
Add an empty do-nothing crate for fogotype work r=janerik
https://hg.mozilla.org/integration/autoland/rev/53d79a9ad34f
Only build the fogotype crate on Nightly r=janerik,lina
[task 2019-11-22T02:46:48.150Z] error: the lock file /builds/worker/workspace/build/src/Cargo.lock needs to be updated but --frozen was passed to prevent this

Not quite sure what this is all about. Maybe I need to run mach vendor rust or something?

Flags: needinfo?(chutten)

I ran cargo update -p gkrust-shared and it bumped the version of rand. I've pushed that to try over here and have it running spidermonkey stuff (which was kinda hard to find. It's not in the chooser and it's not in "Add new jobs". I had to look in "Add new jobs (search)")

Let's see if it's that.

Depends on D53714

Hey :lina, what do you think? Should I put a section in the docs about how to do this feature stuff?

Flags: needinfo?(lina)
Attachment #9110847 - Attachment is obsolete: true
Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/abaaa881428e
Add an empty do-nothing crate for fogotype work r=janerik
https://hg.mozilla.org/integration/autoland/rev/418a4b4c4de7
Only build the fogotype crate on Nightly r=janerik,lina
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Flags: needinfo?(lina)
You need to log in before you can comment on or make changes to this bug.