Closed Bug 1551368 Opened 5 years ago Closed 5 years ago

Evaluate not removing rust incremental compilation cache during |mach clobber|

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: erahm, Assigned: erahm)

Details

Attachments

(3 files, 1 obsolete file)

We'd like to see if it's reasonable to leave the rust incremental compilation cache around after a mach clobber invocation. The idea is that will allow for faster rebuilds when a mach clobber is necessary for C++ code. It's possible there are reasons this won't work, so for now we just want to evaluate the effect on build times and if it's possible at all.

The main drawbacks that I know of are:

  1. When we update rust versions we might leave a cache dir around. I don't think this is an actual issue w/in the Firefox build environment.
  2. If you're locally hacking a rust checkout and messing with the format of the cache files you could get into a bad state. I don't think we need to worry about this.
Attachment #9065119 - Attachment is obsolete: true

Pull out the logic for filtering subdirectories and deleting them into
reusable functions.

Pass in the substs dictionary to Clobberer so that we can use it to query cargo paths.

Skips over the incremental cache when performing a clobber. The incremental compilation cache is located at:
$(objdir)/$(rust_target)/$(rust_build_kind)/incremental

When cross compiling there can be two caches, one for the host and one for the target so we handle both.

Initial numbers on this for a pretty contrived use case, essentially:

./mach build && ./mach clobber # fill up ccache and IC cache
multitime -q -n 6 -r './mach clobber' ./mach build # Run 6 times and average results

Shows a 494s -> 386s speedup (~20%).

Pushed by erahm@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/028c8f1b6b5b
Part 1: Factor out subdirectory logic. r=firefox-build-system-reviewers,chmanchester

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=028c8f1b6b5b1975255307245a69321adbdac9a8&searchStr=linting%2Copt%2Csource-test-mozlint-py-flake8%2C%28f8%29&selectedJob=250235451

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=250235451&repo=autoland&lineNumber=278

Backout link: https://hg.mozilla.org/integration/autoland/rev/a47c1ea455753afd6dfb1e685c213be931f3bb2b

[task 2019-06-05T21:19:24.821Z] copying build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so -> psutil
[task 2019-06-05T21:19:24.821Z]
[task 2019-06-05T21:19:24.821Z] Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
[task 2019-06-05T21:22:37.952Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/python/mozbuild/mozbuild/controller/clobber.py:148:9 | too many blank lines (2) (E303)
[task 2019-06-05T21:22:37.952Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/python/mozbuild/mozbuild/controller/clobber.py:149:5 | expected 1 blank line, found 0 (E301)
[taskcluster 2019-06-05 21:22:38.253Z] === Task Finished ===
[taskcluster 2019-06-05 21:22:40.433Z] Unsuccessful task run with exit code: 1 completed in 501.647 seconds

Flags: needinfo?(erahm)

I guess lando did a bad rebase, I'll fix locally.

Flags: needinfo?(erahm)

I tried to lando this but it doesn't seem to have actually landed. I'll leave it to the experts to get this landed.

Keywords: checkin-needed

Please ask for a review before we can land this.

Removing checkin-needed for now.

Flags: needinfo?(erahm)
Keywords: checkin-needed

(In reply to Dorel Luca [:dluca] from comment #10)

Please ask for a review before we can land this.

Removing checkin-needed for now.

It has been reviewed, it just need to be rebased.

Flags: needinfo?(erahm)
Keywords: checkin-needed

Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5a8df036968e
Part 1: Factor out subdirectory logic. r=chmanchester
https://hg.mozilla.org/integration/autoland/rev/f35cdcfa0a28
Part 2: Make the Clobberer aware of substs. r=chmanchester
https://hg.mozilla.org/integration/autoland/rev/33fbb6ff15cd
Part 3: Don't remove the rust incremental cache when clobbering. r=chmanchester

Keywords: checkin-needed
Assignee: nobody → erahm
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: