Closed Bug 1432475 Opened 6 years ago Closed 6 years ago

Generate rust analysis data in searchfox taskcluster job

Categories

(Webtools :: Searchfox, enhancement)

enhancement
Not set
normal

Tracking

(firefox60 fixed)

RESOLVED FIXED
Tracking Status
firefox60 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file, 1 obsolete file)

In order to switch searchfox from building its own analysis data to using the analysis data from the taskcluster job (bug 1425597) we need to make sure that the taskcluster job is actually building everything we need. Recently searchfox added rust analysis support, and so we need to add that to the taskcluster job as well.

Note that this requires switching the taskcluster job from rust-stable to rust-nightly since only rust nightly supports the -Zsave-analysis flag which we need. This does mean that it's more liable to break, but it will be no worse than what searchfox is doing now.

Here's a try push where I attempted this yesterday: https://treeherder.mozilla.org/#/jobs?repo=try&revision=fbb4da4c06c64e98ea2b8fe4b169157eca95982f - it failed but because of a nightly-only build error that is being addressed. I'll try again once that's fixed.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=85eacf7bf46f24a6bd0fe44fb0bf50d614d54c80 - still failing, different error this time. I suspect this is rust nightly compiler bustage since the code that's failing to build hasn't changed recently and builds fine with rust stable.
It wasn't really nightly compiler bustage. The code that was errorring out was the slog crate, which got pulled in as part of the geckodriver crate's dependency tree. That only happens because on taskcluster we're running the build with MOZ_AUTOMATION=1, which doesn't happen in searchfox's own build. But indexing geckodriver is a good thing, so I tried updating slog to the newest compatible version, and that seemed to fix the problem: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bc76d881d8ddfe2855b0976eeb5169b319a746c5

I'll put up patches for this later.
The above try push missed adding the new zipfile to the uploaded artifacts. Here's one with that fixed: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ac5fde22e60ebaf7f65b96c246c2362c10455294
Comment on attachment 8945115 [details]
Bug 1432475 - Bump slog to a version that compiles with Rust nightly.

https://reviewboard.mozilla.org/r/215344/#review220922

If I would’ve thought bumping slog also would mean bumping the other
slog-* dependencies.  In any case, if this builds fine on TC then
this is good.
Attachment #8945115 - Flags: review?(ato) → review+
Yeah it seems to build fine. The actual code changes between the two versions were minor, so that's probably why it's still compatible with the other slog-* crates.
Comment on attachment 8945116 [details]
Bug 1432475 - Enable rust analysis on mozsearch jobs and save the output to a build artifact.

https://reviewboard.mozilla.org/r/215346/#review220964

I'll defer to :glandium here -- I see nothing that concerns me!
Attachment #8945116 - Flags: review?(dustin)
Comment on attachment 8945116 [details]
Bug 1432475 - Enable rust analysis on mozsearch jobs and save the output to a build artifact.

https://reviewboard.mozilla.org/r/215346/#review222258

::: taskcluster/ci/toolchain/linux.yml:342
(Diff revision 1)
> +    description: "rust repack"
> +    treeherder:
> +        kind: build
> +        platform: toolchains/opt
> +        symbol: TL(rust-nightly)
> +        tier: 1

Is the searchfox job tier 1?

::: taskcluster/ci/toolchain/linux.yml:352
(Diff revision 1)
> +            UPLOAD_DIR: artifacts
> +    run:
> +        using: toolchain-script
> +        script: repack_rust.py
> +        arguments: [
> +            '--channel', 'nightly',

This is rather undesirable, because the version you get depends on when this job runs. You should use a dated nightly. Or no nightly at all, if -Zsave-analysis can still work if you set RUSTC_BOOTSTRAP=1.
Attachment #8945116 - Flags: review?(mh+mozilla)
(In reply to Mike Hommey [:glandium] from comment #9)
> 
> Is the searchfox job tier 1?

Good catch, I downgraded this to tier 2

> > +            '--channel', 'nightly',
> 
> This is rather undesirable, because the version you get depends on when this
> job runs. You should use a dated nightly. Or no nightly at all, if
> -Zsave-analysis can still work if you set RUSTC_BOOTSTRAP=1.

Ok, I've changed it to use a dated nightly. I don't know what RUSTC_BOOTSTRAP does and searching for it didn't provide any info that seemed relevant to this problem.

Try push with the updated patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6e2c4814f6a2530547cc68f021930323d43fd8f6
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #12)
> (In reply to Mike Hommey [:glandium] from comment #9)
> > 
> > Is the searchfox job tier 1?
> 
> Good catch, I downgraded this to tier 2
> 
> > > +            '--channel', 'nightly',
> > 
> > This is rather undesirable, because the version you get depends on when this
> > job runs. You should use a dated nightly. Or no nightly at all, if
> > -Zsave-analysis can still work if you set RUSTC_BOOTSTRAP=1.
> 
> Ok, I've changed it to use a dated nightly. I don't know what
> RUSTC_BOOTSTRAP does and searching for it didn't provide any info that
> seemed relevant to this problem.

It enables nightly features for when rustc bootstraps itself. We abuse it for simd. We could do the same here if it works.
Attachment #8945115 - Attachment is obsolete: true
It does work, thanks for the tip! Patch updated accordingly, and since we don't need nightly rust I dropped the first patch too.
Comment on attachment 8945116 [details]
Bug 1432475 - Enable rust analysis on mozsearch jobs and save the output to a build artifact.

https://reviewboard.mozilla.org/r/215346/#review222578
Attachment #8945116 - Flags: review?(mh+mozilla) → review+
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6e90c77e89c5
Enable rust analysis on mozsearch jobs and save the output to a build artifact. r=glandium
https://hg.mozilla.org/mozilla-central/rev/6e90c77e89c5
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: