Closed Bug 751076 Opened 12 years ago Closed 11 years ago

pymake returns nothing for $< and $^ in some cases

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: glandium, Assigned: mshal)

References

Details

Attachments

(1 file, 1 obsolete file)

Example of a failing Makefile:

FOO = foo.o
BAR = bar.o

$(FOO): %.o: %.c
$(BAR): %.o: %.cpp

$(FOO): a.h

$(FOO) $(BAR):
	echo $<
	echo $^
Also adding a check/unit test to verify functionality when pymake is changed would be helpful going forward.

Run (g)?make and pymake on the test makefile, report values generated by all automatic variables then strcmp the two sets for equality.
Conveniently pymake has a rather thorough testsuite that runs tests in both gmake and pymake:
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/file/9fb06df46292/tests
Assigning to glandium only because he filed the bug.

The pymake tests pass - ship it!

Try at https://tbpl.mozilla.org/?tree=Try&rev=23e4fdc98ae1
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #744246 - Flags: review?(mh+mozilla)
(In reply to Gregory Szorc [:gps] from comment #5)
> And this broke the build:
> https://tbpl.mozilla.org/php/getParsedLog.
> php?id=22469633&tree=Try&full=1#error0

Dependencies are probably not handled correctly.
Attachment #744246 - Flags: review?(mh+mozilla)
I can't access the previous tbpl results so I don't know for certain, but the original patch was failing locally for me because $< was being set incorrectly. In gmake, if we have:

baz: baz.in2

baz: baz.in1
     Use $<

Then it treats baz.in1 as the first prereq for $< purposes, even though baz.in2 is technically "first". If the rule with $< has prereqs, it uses the first prereq in the rule itself. However if it has no prereqs, then it will use the first prereq available in any prior rules.

I've updated the patch to match gmake here, and included this in the test case. This builds locally in pymake, and Windows try results are here:

https://tbpl.mozilla.org/?tree=Try&rev=33487368330a

Not sure if the oranges are related or not though.
Assignee: gps → mshal
Attachment #744246 - Attachment is obsolete: true
Blocks: 888016
Attachment #772888 - Flags: review?(benjamin)
Attachment #772888 - Flags: review?(benjamin) → review+
The Try push looks good. Just a JS JIT test failure.

mshal: Thank you very much for fixing this. This bug is likely responsible for a bunch of required clobbers. It also caused much grief as I was implementing non-recursive XPIDL generation. This will make writing nonrecursive make files much easier.

Please don't forget to double land pymake patches into https://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/
inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/1ad29e4c3564

Also pushed into the pymake repo.
https://hg.mozilla.org/mozilla-central/rev/1ad29e4c3564
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Blocks: 899868
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: