Open Bug 1591172 Opened 5 years ago Updated 2 years ago

Intermittent "No rule to make target" error for mfbt/lz4.c

Categories

(Firefox Build System :: General, defect, P2)

defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: bugzilla, Unassigned)

References

(Regression)

Details

(Keywords: in-triage, regression)

1:40.55 make[4]: *** No rule to make target '${HOME}/src/mc1/mfbt/lz4.c', needed by 'lz4.o'.  Stop.
1:40.55 ${HOME}/src/mc1/config/recurse.mk:74: recipe for target 'mfbt/target-objects' failed
1:40.55 make[3]: *** [mfbt/target-objects] Error 2

I get this off and on when building inside a linux VM. Are we missing a dependency somewhere?

Hmm... but lz4.c is actually located at mfbt/lz4/lz4.c, but the error shows that make is trying to build mfbt/lz4.c

Regressed by: 1550108
Keywords: in-triage
Priority: -- → P2

I'm not able to reproduce this in Linux. :aklotz, what revision are you seeing this in? Is it only lz4.c that has the error or do you see it for other sources as well? Are you doing a top-level './mach build', or something else?

I'm not really sure how this would happen since lz4.c is in the tree and listed explicitly in the moz.build file as lz4/lz4.c. The only weird thing I can think of at the moment is for directories that have USE_LIBS = ['mfbt'], the generated backend.mk contains mfbt/lz4.o, which maybe gets used in a default make rule that tries to look for lz4.c. However, if I explicitly remove lz4.o and try to build one of those USE_LIBS directories, my error message looks like this:

70:16.96 make[4]: *** No rule to make target '../lz4.o', needed by 'TestAlgorithm'. Stop.
70:16.96 /home/mshal/mozilla-central-tmp/config/recurse.mk:74: recipe for target 'mfbt/tests/target' failed

Which doesn't seem to match what you're seeing.

Flags: needinfo?(aklotz)

(In reply to Michael Shal [:mshal] from comment #2)

I'm not able to reproduce this in Linux. :aklotz, what revision are you seeing this in? Is it only lz4.c that has the error or do you see it for other sources as well? Are you doing a top-level './mach build', or something else?

Yes, this is the only error that I see. Top-level ./mach build.

I have not done one in a few days though.

Flags: needinfo?(aklotz)

Hmm, I'm unable to repro this at the moment.
I'm going to close this, but please re-open if it happens again.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME

Note this is a bug that happens regularly, with different files. The cause is file renames. In this case, mfbt/lz4.c was moved to mfbt/lz4/lz4.c or vice-versa, but both before and after, they were compiled as mfbt/lz4.o, as defined in mfbt/moz.build. So the dependency file generated on the previous build says mfbt/lz4.o depends on mfbt/lz4.c, then the tree is updated, and mfbt/lz4.c doesn't exist anymore, so the build fails because of the contents of objdir/mfbt/.deps

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Has Regression Range: --- → yes
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.