Open Bug 1005486 Opened 10 years ago Updated 2 years ago

Build dependency doesn't get computed correctly when files are renamed from .c to .cpp

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: ehsan.akhgari, Unassigned)

References

Details

Attachments

(1 file)

See this try push:

<https://tbpl.mozilla.org/?tree=Try&rev=bd5c2252e2c8>

In that push, I rename xpcom/typelib/xpt/tests/PrimitiveTest.c to PrimitiveTest.cpp, and change the moz.build file accordingly: <https://hg.mozilla.org/try/rev/d3a091862f3c#l188.13>

But it seems to break Valgrind builds on try.  Looking at the logs (for example:  <https://tbpl.mozilla.org/php/getParsedLog.php?id=38993956&full=1&branch=try>) it seems like this is some kind of a clobbering issue, I don't see any actual build any of the xpt files that should be built (note how this patch touches a whole bunch of .idl files) during the export phase, and then we start falling into the compile phase, again not building anything until we get to xpcom/typelib/xpt/tests and bail out because:

make[3]: *** No rule to make target `/builds/slave/try-l64-valgrind-0000000000000/src/xpcom/typelib/xpt/tests/PrimitiveTest.c', needed by `PrimitiveTest.o'.  Stop.

Not sure what's going wrong here, but I really don't think this is something related to my patch.  I've also verified that a local valgrind build using the same in-tree mozconfig sans the toolchain paths in http://mxr.mozilla.org/mozilla-central/source/build/unix/mozconfig.linux and http://mxr.mozilla.org/mozilla-central/source/build/mozconfig.cache works.

glandium, any ideas what's going on here?
Flags: needinfo?(mh+mozilla)
Personally, I don't know why we even keep running them on try, since an unclobbered try build is like a random number generator.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
And here is a green run after a bunch of retriggers: <https://tbpl.mozilla.org/php/getParsedLog.php?id=38996045&tree=Try&full=1>
Flags: needinfo?(mh+mozilla)
Note that means your patch would probably fail on some platforms when pushed on inbound.
(In reply to comment #3)
> Note that means your patch would probably fail on some platforms when pushed on
> inbound.

What should I do about that?  Land with CLOBBER?
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #4)
> What should I do about that?  Land with CLOBBER?

That, or find the actual problem and fix it ;)
> That, or find the actual problem and fix it ;)

this is probably a stale mddepend file right? there's probably an existing .deps/foo.c that doesn't get renamed when foo.c is renamed to foo.cpp, and the Makefile's mtime doesn't change because the only difference is to backend.mk.  Maybe config.status should go nuck everything in .deps/ that isn't a file it knows about? or is there something better than that?
It seems like Trevor knows what's going on here, repurposing the bug.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Summary: Try server valgrind builds seem to be affected by clobbering issues → Build dependency doesn't get computed correctly when files are renamed from .c to .cpp
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #7)
> It seems like Trevor knows what's going on here, repurposing the bug.

its only a theory ;)

it should be testeable by building without the patch, applying the patch rming objdir/xpcom/typelib/whatever/.deps/something.c and rebuilding, if that works then I'm probably right, if not its something else.
It's plausible, since the dep file is actually .deps/foo.o.pp, not .deps/foo.c
... although, dep files are supposed to have file removal protectors. That is, something like this:

foo.o: foo.c
foo.c:

which shouldn't lead to the original error.
This doesn't actually block anything, I ended up landing bug 1005321 by touching CLOBBER.
No longer blocks: 994964
Blocks: 994964
No longer blocks: 994964
(In reply to Mike Hommey [:glandium] from comment #10)
> ... although, dep files are supposed to have file removal protectors. That
> is, something like this:
> 
> foo.o: foo.c
> foo.c:

So, I just updated a tree and ran into this, and decided to debug it.  I'll attach PrimitiveTest.o.pp in a minute, but I'm not seeing any such remove protection mechanism, and the only rule involving PrimivitiveTest is PrimitiveTest.o: PrimitiveTest.c \ blah
Attached file PrimitiveTest.o.pp (deleted) —
huh, there are removal guards for headers, but not for the source. Doh.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: