Bug 1091109: Don't sign webapprt-stub on OSX because webapps fail to launch due to quarantine bit on CLOSED TREE. r=smichaud,myk a=lmandel,RyanVM
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Thu, 06 Nov 2014 11:41:49 -0500
changeset 225979 557655b23004
parent 225978 4e453b566e83
child 225980 f30e1c0c0694
push id4091
push userspohl@mozilla.com
push date2014-11-06 16:41 +0000
treeherdermozilla-beta@557655b23004 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud, myk, lmandel, RyanVM
bugs1091109
milestone34.0
Bug 1091109: Don't sign webapprt-stub on OSX because webapps fail to launch due to quarantine bit on CLOSED TREE. r=smichaud,myk a=lmandel,RyanVM
browser/app/macbuild/Contents/MacOS-files.in
browser/installer/package-manifest.in
testing/mochitest/mach_commands.py
testing/testsuite-targets.mk
toolkit/webapps/MacNativeApp.js
toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
webapprt/mac/webapprt.mm
--- a/browser/app/macbuild/Contents/MacOS-files.in
+++ b/browser/app/macbuild/Contents/MacOS-files.in
@@ -1,10 +1,9 @@
 /*.app/***
 /*.dylib
 /certutil
 /firefox-bin
 /gtest/***
 /pk12util
 /ssltunnel
-/webapprt-stub
 /xpcshell
 /XUL
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -841,21 +841,17 @@ bin/libfreebl_32int64_3.so
 #endif
 #endif
 
 #ifdef MOZ_WEBAPP_RUNTIME
 [WebappRuntime]
 #ifdef XP_WIN
 @BINPATH@/webapp-uninstaller@BIN_SUFFIX@
 #endif
-#ifdef XP_MACOSX
-@APPNAME@/Contents/MacOS/webapprt-stub@BIN_SUFFIX@
-#else
 @BINPATH@/webapprt-stub@BIN_SUFFIX@
-#endif
 @BINPATH@/webapprt/webapprt.ini
 @BINPATH@/webapprt/chrome.manifest
 @BINPATH@/webapprt/chrome/webapprt@JAREXT@
 @BINPATH@/webapprt/chrome/webapprt.manifest
 @BINPATH@/webapprt/chrome/@AB_CD@@JAREXT@
 @BINPATH@/webapprt/chrome/@AB_CD@.manifest
 @BINPATH@/webapprt/components/CommandLineHandler.js
 @BINPATH@/webapprt/components/ContentPermission.js
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -85,17 +85,17 @@ class MochitestRunner(MozbuildObject):
     to hook up result parsing, etc.
     """
 
     def get_webapp_runtime_path(self):
         import mozinfo
         appname = 'webapprt-stub' + mozinfo.info.get('bin_suffix', '')
         if sys.platform.startswith('darwin'):
             appname = os.path.join(self.distdir, self.substs['MOZ_MACBUNDLE_NAME'],
-            'Contents', 'MacOS', appname)
+            'Contents', 'Resources', appname)
         else:
             appname = os.path.join(self.distdir, 'bin', appname)
         return appname
 
     def __init__(self, *args, **kwargs):
         MozbuildObject.__init__(self, *args, **kwargs)
 
         # TODO Bug 794506 remove once mach integrates with virtualenv.
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -164,17 +164,17 @@ ifeq (powerpc,$(TARGET_CPU))
 	$(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled.ppc.test.plugin=false $(IPCPLUGINS_PATH_ARG)
 endif
 else
 	$(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled=false --test-path=dom/plugins/test
 endif
 	$(CHECK_TEST_ERROR)
 
 ifeq ($(OS_ARCH),Darwin)
-webapprt_stub_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/webapprt-stub$(BIN_SUFFIX)
+webapprt_stub_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/webapprt-stub$(BIN_SUFFIX)
 endif
 ifeq ($(OS_ARCH),WINNT)
 webapprt_stub_path = $(TARGET_DIST)/bin/webapprt-stub$(BIN_SUFFIX)
 endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 webapprt_stub_path = $(TARGET_DIST)/bin/webapprt-stub$(BIN_SUFFIX)
 endif
 
--- a/toolkit/webapps/MacNativeApp.js
+++ b/toolkit/webapps/MacNativeApp.js
@@ -217,17 +217,18 @@ NativeApp.prototype = {
                           { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
 
     yield OS.File.makeDir(OS.Path.join(aDir, this.resourcesDir),
                           { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
   }),
 
   _copyPrebuiltFiles: function(aDir) {
     let destDir = getFile(aDir, this.macOSDir);
-    let stub = getFile(this.runtimeFolder, "webapprt-stub");
+    let stub = getFile(OS.Path.join(OS.Path.dirname(this.runtimeFolder),
+                                    "Resources"), "webapprt-stub");
     stub.copyTo(destDir, "webapprt");
   },
 
   _createConfigFiles: function(aDir) {
     // ${ProfileDir}/webapp.json
     yield writeToFile(OS.Path.join(aDir, this.configJson),
                       JSON.stringify(this.webappJson));
 
--- a/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
+++ b/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
@@ -89,17 +89,17 @@ let runTest = Task.async(function*() {
   yield nativeApp.install(app, manifest);
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
   let fakeInstallDir;
   if (MAC) {
-    fakeInstallDir = getFile(testAppInfo.installPath, "Contents", "MacOS");
+    fakeInstallDir = getFile(testAppInfo.installPath, "Contents", "Resources");
   } else {
     fakeInstallDir = getFile(OS.Constants.Path.profileDir, "fakeInstallDir");
     fakeInstallDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
   }
 
   let fakeAppIniFile = fakeInstallDir.clone();
   fakeAppIniFile.append("application.ini");
 
--- a/webapprt/mac/webapprt.mm
+++ b/webapprt/mac/webapprt.mm
@@ -161,22 +161,30 @@ main(int argc, char **argv)
       NSLog(@"### This Application has an old webrt. Updating it.");
       NSLog(@"### My webapprt path: %@", myWebRTPath);
 
       NSFileManager* fileClerk = [[NSFileManager alloc] init];
       NSError *errorDesc = nil;
 
       //we know the firefox path, so copy the new webapprt here
       NSString *newWebRTPath =
-        [NSString stringWithFormat: @"%@%s%s", firefoxPath, APP_MACOS_PATH,
+        [NSString stringWithFormat: @"%@%s%s", firefoxPath, APP_RESOURCES_PATH,
                                                WEBAPPRT_EXECUTABLE];
-      NSLog(@"### Firefox webapprt path: %@", newWebRTPath);
+      NSLog(@"### Trying Firefox webapprt path: %@", newWebRTPath);
       if (![fileClerk fileExistsAtPath:newWebRTPath]) {
-        NSString* msg = [NSString stringWithFormat: @"This version of Firefox (%@) cannot run web applications, because it is not recent enough or damaged", firefoxVersion];
-        @throw MakeException(@"Missing Web Runtime Files", msg);
+        newWebRTPath =
+          [NSString stringWithFormat: @"%@%s%s", firefoxPath, APP_MACOS_PATH,
+                                                 WEBAPPRT_EXECUTABLE];
+        NSLog(@"### Trying Firefox webapprt path: %@", newWebRTPath);
+        if (![fileClerk fileExistsAtPath:newWebRTPath]) {
+          NSString* msg =
+            [NSString stringWithFormat:
+              @"This version of Firefox (%@) cannot run web applications, because it is not recent enough or damaged", firefoxVersion];
+          @throw MakeException(@"Missing Web Runtime Files", msg);
+        }
       }
 
       [fileClerk removeItemAtPath: myWebRTPath error: &errorDesc];
       if (errorDesc != nil) {
         NSLog(@"failed to unlink old binary file at path: %@ with error: %@", myWebRTPath, errorDesc);
         @throw MakeException(@"Unable To Update", @"Failed preparation for Web Runtime update");
       }