Closed Bug 800546 Opened 12 years ago Closed 12 years ago

Nothing should depend on *.pyc (media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.pyc)

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla19

People

(Reporter: mcepl, Assigned: gps)

Details

Attachments

(1 file)

When I removed all *.pyc files (just to be sure, I have changed on *.py file), build failed (building b2g with make -f client.mk build) with

make[6]: Entering directory `/home/matej/archiv/knihovna/repos/gaia/build/media/webrtc/trunk/testing'
make[6]: *** No rule to make target `/home/matej/archiv/knihovna/repos/gaia/src/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.pyc', needed by `Makefile'.  Stop.
make[6]: Leaving directory `/home/matej/archiv/knihovna/repos/gaia/build/media/webrtc/trunk/testing'

IMHO, nothing should ever depend on *.pyc (they should be disposable and generated whenever required).

Happened with mozilla-central/master in git commit 2cc089023e6a2d5ce359e25ba135d380321eae04 (repo on https://github.com/mozilla/mozilla-central).
Most likely related to bug 685957 (which is a bit different), and bug 729752. 

I would actually advocate that make clean remove all *.pyc files in the tree.
It looks like the GYP-generated Makefile has a dependency on mozmake.pyc:

# Rules for regenerating Makefiles from GYP files.
Makefile: $(topsrcdir)/media/webrtc/trunk/testing/gtest.gyp $(topsrcdir)/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.pyc
    $(PYTHON) $(topsrcdir)/media/webrtc/trunk/build/gyp_chromium --format=mozmake --depth=$(topsrcdir)/media/webrtc/trunk --generator-output=$(DEPTH)/media/webrtc/trunk/tes


This is likely a bug in mozmake.py.
That comes from $objdir/media/webrtc/trunk/testing/common.mk, which contains something like:
Makefile: $(topsrcdir)/media/webrtc/trunk/testing/gtest.gyp $(topsrcdir)/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.pyc

This is generated by media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py, and essentially, is derived from __file__... Thanks python.
So ridiculous.
This should fix things.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #670562 - Flags: review?(ted.mielczarek)
Comment on attachment 670562 [details] [diff] [review]
Replace .py{c,o} with .py, v1

Review of attachment 670562 [details] [diff] [review]:
-----------------------------------------------------------------

::: media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
@@ +441,5 @@
>                  swapslashes(src),
>                  swapslashes(relative_srcdir))
>    scriptname = topsrcdir_path(__file__)
> +  if scriptname[-4:] in ('.pyc', '.pyo'):
> +    scriptname = scriptname[0:len(scriptname)-1]

scriptname[:-1]
Attachment #670562 - Flags: review?(ted.mielczarek) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/1c858930c3be

with scriptname[:-1] (I keep forgetting you can do that)
Target Milestone: --- → mozilla19
https://hg.mozilla.org/mozilla-central/rev/1c858930c3be
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: