Closed Bug 1077622 Opened 10 years ago Closed 9 years ago

Building without .mozconfig triggers a failed "cp" command: "cp: missing destination file operand after ‘[/path/to/objdir]/.mozconfig’ Try 'cp --help' for more information.

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: dholbert, Assigned: Six)

Details

Attachments

(1 file, 1 obsolete file)

STR:
 0. ./mach clobber, for sanity/cleanliness' sake. (Might be optional)
 1. Move any .mozconfig file out of the way. So, no .mozconfig in your srcdir.
 2. ./mach build
 2. Inspect the first few lines of output.

ACTUAL RESULTS: The 5th and 6th lines of output are:
{
0:01.13 cp: missing destination file operand after ‘/scratch/work/builds/mozilla-central/mozilla-central-11-11-01.13-56/mozilla/obj-x86_64-unknown-linux-gnu/.mozconfig’

0:01.13 Try 'cp --help' for more information.
}

EXPECTED RESULTS: No such error.

It looks like we're blindly assuming there's a .mozconfig file, storing the path to it somewhere (which ends up being empty if it doesn't exist), and then doing something like "cp $MOZCONFIG $OBJDIR/.mozconfig". And if there's no mozconfig in the first place, then this is just "cp $OBJDIR/.mozconfig", which is a bogus command that we should not be trying to execute.
(I'm not sure this actually causes a build failure -- we continue through the configuration stage after this, at least.  I'm just reporting this because this "cp" command is bogus & shouldn't be executed when there's nothing for it to copy.)
Attached patch mach_copy_mozconfig.patch (obsolete) — Splinter Review
Hi,

this patch should fix dholbert's bug.
it just checks that the variable FOUND_MOZCONFIG is set before doing the cp
Assignee: nobody → six.dsn
Status: NEW → ASSIGNED
Attachment #8570616 - Flags: review?(mh+mozilla)
Comment on attachment 8570616 [details] [diff] [review]
mach_copy_mozconfig.patch

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

::: client.mk
@@ +354,5 @@
>  
>  $(OBJDIR)/.mozconfig.json: $(call mkdir_deps,$(OBJDIR)) ;
>  
>  save-mozconfig: $(FOUND_MOZCONFIG)
> +ifneq  (, $(FOUND_MOZCONFIG))

Make that an ifndef.
Attachment #8570616 - Flags: review?(mh+mozilla) → feedback+
Hi,

Okay i changed it for an ifdef instead of a ifndef as i think we don't want to do anything if it isn't defined?
Attachment #8570616 - Attachment is obsolete: true
Attachment #8571457 - Flags: review?(mh+mozilla)
Attachment #8571457 - Flags: review?(mh+mozilla) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6da4ee2f15f5
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.