Last Comment Bug 863409 - mach build a comm-central app (SM, TB) throws exception at the end
: mach build a comm-central app (SM, TB) throws exception at the end
Status: RESOLVED WORKSFORME
[mach]
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal with 1 vote (vote)
: ---
Assigned To: Max Li [:maxli]
:
Mentors:
: 876083 880981 892473 920506 973336 (view as bug list)
Depends on: 648681
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-18 13:01 PDT by Jens Hatlak (:InvisibleSmiley)
Modified: 2015-12-13 00:53 PST (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (1011 bytes, patch)
2013-07-13 15:49 PDT, Max Li [:maxli]
gps: review-
Pidgeot18: feedback-
Details | Diff | Splinter Review

Description Jens Hatlak (:InvisibleSmiley) 2013-04-18 13:01:09 PDT
The exception I get (see below) is similar to the one mentioned on bug 854057, but this bug here is about a special case, namely building a comm-central app (SM, TB).

The output I got was:

---------------------------
We know it took a while, but your build finally finished successfully!
Error running mach:

    ['build']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: Binary expected at e:/mozilla-src/seamonkey-central\dist\bin\seamonkey.exe does not exist.

  File "e:\mozilla-src\comm-central\mozilla\python/mozbuild/mozbuild/mach_commands.py", line 137, in build
    app_path = self.get_binary_path('app')
  File "e:\mozilla-src\comm-central\mozilla\python/mozbuild\mozbuild\base.py", line 161, in get_binary_path
    raise Exception('Binary expected at %s does not exist.' % path)
---------------------------

The problem is that when building a comm-central app (SM, TB), the "dist" directory is below the "mozilla" directory, not directly below the OBJDIR.

I understand that the whole "get the app binary path" exercise here is solely to display a helpful comment. Now if fixing it is considered too much effort, I'd like to at least not get an exception that at first glance suggests that something during the build process failed.
Comment 1 Gregory Szorc [:gps] 2013-04-18 13:06:02 PDT
mach and comm-central aren't exactly well-integrated. Although, I suspect the issue here is the "find the binary logic" doesn't properly resolve the equivalent of $(DIST).
Comment 2 Jens Müller (:tessarakt) 2013-05-30 13:10:29 PDT
*** Bug 876083 has been marked as a duplicate of this bug. ***
Comment 3 Jens Hatlak (:InvisibleSmiley) 2013-06-24 09:06:56 PDT
Since nothing's moving here I developed a workaround. The error message is a direct result of the fact that dist/ is located below mozilla/ when building a c-c app. Hence, just create a symlink. Unfortunately, MSYS "ln -s" on Windows doesn't create a symlink but creates a copy. "cmd" to the rescue:

mkdir -p $OBJDIR && cd $OBJDIR && cmd /c 'mklink /j dist mozilla\dist'

If you invoke the above directly before running mach, you're good (provided you're on Windows 7 with an NTFS filesystem). Initially the junction will point nowhere, but once mozilla/dist/ is created, it will automatically point to the target.

NB: I don't know whether the MSYS tools will be able to remove the junction. My "make distclean" command is the following:

WIN_OBJDIR=$(cygpath -w "$OBJDIR")
cmd /c "rmdir /s /q $WIN_OBJDIR"
Comment 4 Blake Winton (:bwinton) (:☕️) 2013-06-28 07:50:17 PDT
Josh, were you looking into integrating mach and comm-central, or am I mis-remembering things?
Comment 5 Joshua Cranmer [:jcranmer] 2013-06-28 09:33:28 PDT
(In reply to Blake Winton (:bwinton) from comment #4)
> Josh, were you looking into integrating mach and comm-central, or am I
> mis-remembering things?

I've mostly been working on the moz.build stuff, not mach.
Comment 6 Max Li [:maxli] 2013-07-08 11:52:08 PDT
*** Bug 880981 has been marked as a duplicate of this bug. ***
Comment 7 Joshua Cranmer [:jcranmer] 2013-07-11 08:27:13 PDT
*** Bug 892473 has been marked as a duplicate of this bug. ***
Comment 8 Max Li [:maxli] 2013-07-13 15:49:53 PDT
Created attachment 775249 [details] [diff] [review]
Patch
Comment 9 Joshua Cranmer [:jcranmer] 2013-07-13 17:59:54 PDT
Comment on attachment 775249 [details] [diff] [review]
Patch

I dislike this patch because it's hardcoding by app name, which is going to break this again when bug 648979 hits (which I'm hoping to finish off by the end of the month). I might suggest checking to see if dist exists and using mozilla/dist if it doesn't, but I'm not sure that is feasible.
Comment 10 Gregory Szorc [:gps] 2013-07-17 12:19:50 PDT
Comment on attachment 775249 [details] [diff] [review]
Patch

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

I believe that the comm-central build system defines a variable (is it MOZILLA_DIR?) that denotes where the main m-c build system output resides. A solution should use this instead of a one-off defining out-of-tree applications.

My guess is jcranmer knows what I'm talking about...
Comment 11 Joshua Cranmer [:jcranmer] 2013-07-18 21:08:18 PDT
(In reply to Gregory Szorc [:gps] from comment #10)
> Comment on attachment 775249 [details] [diff] [review]
> Patch
> 
> Review of attachment 775249 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I believe that the comm-central build system defines a variable (is it
> MOZILLA_DIR?) that denotes where the main m-c build system output resides. A
> solution should use this instead of a one-off defining out-of-tree
> applications.
> 
> My guess is jcranmer knows what I'm talking about...

MOZILLA_SRCDIR is the name of the variable I think you're looking for, but that's only defined in config/config.mk or something like that. The only sign in mozbuild that it's comm-central that's going on is the presence of COMM_BUILD.
Comment 12 Joshua Cranmer [:jcranmer] 2013-09-25 06:21:50 PDT
*** Bug 920506 has been marked as a duplicate of this bug. ***
Comment 13 David Rees 2013-09-28 10:53:21 PDT
FYI, I am seeing the same error on OSX 10.8.5. Creating a symbolic link $OBJDIR/dist to $OBJDIR/mozilla/dist as suggested in comment 3 worked.
Comment 14 David Rees 2013-09-28 11:01:27 PDT
FYI, I updated https://developer.mozilla.org/en-US/docs/Simple_Thunderbird_build to let new folks know they can ignore this error.
Comment 15 Joshua Cranmer [:jcranmer] 2014-02-16 18:49:42 PST
*** Bug 973336 has been marked as a duplicate of this bug. ***
Comment 16 Stefan Sitter 2014-09-21 07:34:59 PDT
Problems seems fixed. After running |mach build| there is no error message displayed to me and running |mach run| launches ./obj-i686-pc-mingw32/dist/bin/thunderbird.exe.
Comment 17 Stefan Sitter 2015-11-30 08:06:02 PST
Reporter, do you still observe the error? For me it works as stated last year in comment 16.
Comment 18 Jens Hatlak (:InvisibleSmiley) 2015-12-01 14:06:43 PST
(In reply to Stefan Sitter from comment #17)
> Reporter, do you still observe the error?

I haven't built for quite some time. Retried now, ran into bug 1229073, but with the first patch from there it worked. :-) Closing as WFM.
Comment 19 Mark Straver 2015-12-01 14:15:36 PST
So, where exactly was this fixed then?

Note You need to log in before you can comment on or make changes to this bug.