Local builds don't update BUILDID resulting in cache corruption (XDR)
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
People
(Reporter: kats, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(1 obsolete file)
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Reporter | ||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
This is going to be a blocker for Bug 1535138 since XDR format will be updated multiple times and it is already busting people's local builds.
Comment 15•6 years ago
|
||
SpiderMonkey cache files rely on BUILDID to invalidate old files.
Unfortunately the BUILDID is intentionally not updated on local
incremental builds which leads to profile corruption. This patch forces
an update in this case when SpiderMonkey changes are pulled without a
clobber build. The MOZ_BUILDID env variable is still respected for
reproducible builds and if SpiderMonkey is not changed, there is no
forced update.
Comment 16•6 years ago
|
||
Comment on attachment 9063587 [details]
Bug 1506263 - Regenerate buildid.h when SpiderMonkey is updated
I'm wondering if something like this would even remotely be considered acceptable. It solves the problem pretty directly but it is quite gross.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 17•6 years ago
|
||
(In reply to Ted Campbell [:tcampbell] from comment #16)
Comment on attachment 9063587 [details]
Bug 1506263 - Regenerate buildid.h when SpiderMonkey is updatedI'm wondering if something like this would even remotely be considered acceptable. It solves the problem pretty directly but it is quite gross.
You've abandoned the revision; can you explain what you saw? Because scanning the patch, this is basically the "right" approach: in some way, you need to wire a dep into buildid.h. That's Hard for a bunch of reasons, not least that buildid.h is magic and handled specially many places in the build. It's also produced very early, probably before anything in SM is actually built, so you'll have a hard time actually making a dep happen in time. But there may be ways to achieve what you need, and a build peer (glandium, in all likelihood) can provide guidance.
In the interim, what did you witness? Presumably, you found that the cross-directory dependency wasn't built in time and didn't work well in practice?
Comment 18•6 years ago
|
||
The first problem was as you expected that I couldn't make a cross-directory dependency actually trigger a build so clobber builds wouldn't work. The second issue I ran into in a few variants I tried was that it would take two |./mach build| to get the world in sync since XUL wasn't always rebuilt.
In the short term, I'll add back XDR_VERSION and a phabricator/herald rule so there is at least any mechanism to save things (outside of touching CLOBBER). Jan has an interesting suggestion of computing the hash of certain key files as a build step (similar to any of our other SpiderMonkey GENERATED_FILES steps). One wrinkle there is I might want to normalize text so things like newline encoding don't result in different binaries.
Comment 19•6 years ago
|
||
(In reply to Ted Campbell [:tcampbell] from comment #18)
The first problem was as you expected that I couldn't make a cross-directory dependency actually trigger a build so clobber builds wouldn't work. The second issue I ran into in a few variants I tried was that it would take two |./mach build| to get the world in sync since XUL wasn't always rebuilt.
That makes sense, thanks for confirming.
In the short term, I'll add back XDR_VERSION and a phabricator/herald rule so there is at least any mechanism to save things (outside of touching CLOBBER). Jan has an interesting suggestion of computing the hash of certain key files as a build step (similar to any of our other SpiderMonkey GENERATED_FILES steps). One wrinkle there is I might want to normalize text so things like newline encoding don't result in different binaries.
This is what I was going to suggest: you can do a lot of things with GENERATED_FILES and get good dependency trees. Avoiding buildid.h entirely will be much better for this long-term.
Glad to see you have ideas about how to solve your problem!
Comment 20•6 years ago
|
||
The GENERATED_FILES approach is having a number limitations (it is awkward to take a dependency on mozconfig, for example) and probably needs first-class build system support to not be full of holes. I've filed Bug 1551639 to see if we can get the build system to provide an alternate build id.
Comment 21•6 years ago
|
||
(In reply to Ted Campbell [:tcampbell] from comment #20)
The GENERATED_FILES approach is having a number limitations (it is awkward to take a dependency on mozconfig, for example) and probably needs first-class build system support to not be full of holes. I've filed Bug 1551639 to see if we can get the build system to provide an alternate build id.
Show your WIP? The build system has deep support for depending on mozconfigs (and all bits of the build system itself); you shouldn't need to do really think about this at all. That is, GENERATED_FILES
and its ilk will accommodate changes to mozconfigs that change defines, substs, etc.
Updated•2 years ago
|
Description
•