Closed Bug 885951 Opened 7 years ago Closed 7 years ago

Bug 874132 fix assumes jarsigner is in the command path - should respect configure option --with-java-bin-path

Categories

(Firefox for Android :: General, defect)

x86_64
Linux
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 25

People

(Reporter: wgianopoulos, Assigned: nalexander)

References

Details

(Keywords: regression)

Attachments

(1 file)

Since bug 874132 landed my attempts to build Firefox for Android fail with:

Traceback (most recent call last):
  File "/home/wag/mozilla/mozilla2/mobile/android/debug_sign_tool.py", line 182, in <module>
    sys.exit(main())
  File "/home/wag/mozilla/mozilla2/mobile/android/debug_sign_tool.py", line 173, in main
    keystore.sign(apk)
  File "/home/wag/mozilla/mozilla2/mobile/android/debug_sign_tool.py", line 118, in sign
    self._check(args)
  File "/home/wag/mozilla/mozilla2/mobile/android/debug_sign_tool.py", line 56, in _check
    subprocess.check_output(args)
  File "/usr/lib64/python2.7/subprocess.py", line 530, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1201, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Hi Bill,

This is a terrible error code (sorry!) but I think it just means that the script can't find the jarsigner utility.  Can you add jarsigner to your path and try again?
That is most likely the cause. I do not have the JDK in the path, but instead use "ac_add_options --with-java-bin-path".   Clearly this option should be used to construct a full path to jarsigner, if it is specified.
Creating a symlink in ~/bin to jarsigner fixed the issue.  I have updated the summary to describe the real issue.
Summary: Can't build Firefox for Android since landing of bug 874132 → Bug 874132 fix assumes jarsigner is in the command path - should respect configure option --with-java-bin-path
This works for me locally; I'll push to try shortly.  Bill, if you
could remove your symlink and test that would be great.
Attachment #766775 - Flags: review?(gps)
(In reply to Nick Alexander :nalexander from comment #4)
> Created attachment 766775 [details] [diff] [review]
> Find jarsigner and keytool during configure. r=gps
> 
> This works for me locally; I'll push to try shortly.  Bill, if you
> could remove your symlink and test that would be great.

My builds work fine with this patch applied.
Comment on attachment 766775 [details] [diff] [review]
Find jarsigner and keytool during configure. r=gps

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

Earns r+ despite not-fault-of-patch-author sadness.

::: configure.in
@@ +5877,5 @@
>  
>  if test -n "${JAVA_BIN_PATH}" -o \
>    \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
> +  if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAVAH" -o "$JAVAH" = ":" -o -z "$JAR" -o "$JAR" = ":" -o -z "$JARSIGNER" -o "$JARSIGNER" = ":" -o -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then
> +    AC_MSG_ERROR([The programs java, javac, javah, jar, jarsigner, and keytool were not found.  Set \$JAVA_HOME to your java sdk directory or use --with-java-bin-path={java-bin-dir}])

What a horrible error message. "But which program is missing?!" whoever sees this will ask! I thought we had a m4 macro that checked that a binary was present and automatically created an error if not. Who knows.

Followup bug.

::: mobile/android/debug_sign_tool.py
@@ +57,5 @@
> +                subprocess.check_output(args)
> +        except OSError as ex:
> +            if ex.errno != errno.ENOENT:
> +                raise
> +            raise Exception("Could not find executable '%s'" % args[0])

It's sad that Python doesn't emit a more friendly error message that prints the name of the missing executable.
Attachment #766775 - Flags: review?(gps) → review+
Landed with improved error reporting.  I didn't any equivalent of MOZ_PATH_PROG with built in error reporting, so I split the conditional by hand.

https://hg.mozilla.org/integration/mozilla-inbound/rev/c789f06f356e
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Target Milestone: --- → Firefox 25
https://hg.mozilla.org/mozilla-central/rev/c789f06f356e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Build worked for me from current mozilla-central tip.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.