Browse Source

fix python 3.9 Windows

Frank-Rainer Grahl 10 months ago
parent
commit
51ca021f39

+ 123 - 0
mozilla-release/patches/1333140-2no1-59a1.patch

@@ -0,0 +1,123 @@
+# HG changeset patch
+# User Tim Taubert <ttaubert@mozilla.com>
+# Date 1512047188 -3600
+# Node ID fc91ce7557173426c0f705133411300c57bc4307
+# Parent  c081853a30c7b333e1cfde7e3be9faa93dce5b0b
+Bug 1333140 - Remove WEBCRYPTO_METHOD_SECURE histogram r=keeler
+
+diff --git a/dom/base/SubtleCrypto.cpp b/dom/base/SubtleCrypto.cpp
+--- a/dom/base/SubtleCrypto.cpp
++++ b/dom/base/SubtleCrypto.cpp
+@@ -4,62 +4,47 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ #include "mozilla/dom/SubtleCrypto.h"
+ 
+ #include "mozilla/dom/Promise.h"
+ #include "mozilla/dom/SubtleCryptoBinding.h"
+ #include "mozilla/dom/WebCryptoTask.h"
+-#include "mozilla/Telemetry.h"
+ 
+ namespace mozilla {
+ namespace dom {
+ 
+ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SubtleCrypto, mParent)
+ NS_IMPL_CYCLE_COLLECTING_ADDREF(SubtleCrypto)
+ NS_IMPL_CYCLE_COLLECTING_RELEASE(SubtleCrypto)
+ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SubtleCrypto)
+   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+   NS_INTERFACE_MAP_ENTRY(nsISupports)
+ NS_INTERFACE_MAP_END
+ 
+ 
+ 
+ SubtleCrypto::SubtleCrypto(nsIGlobalObject* aParent)
+   : mParent(aParent)
+-  , mRecordedTelemetry(false)
+ {
+ }
+ 
+ JSObject*
+ SubtleCrypto::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+ {
+   return SubtleCryptoBinding::Wrap(aCx, this, aGivenProto);
+ }
+ 
+-void
+-SubtleCrypto::RecordTelemetryOnce() {
+-  if (mRecordedTelemetry) {
+-    return;
+-  }
+-
+-  mRecordedTelemetry = true;
+-  JSObject* global = mParent->GetGlobalJSObject();
+-  bool isSecure = JS_GetIsSecureContext(js::GetObjectCompartment(global));
+-  Telemetry::Accumulate(Telemetry::WEBCRYPTO_METHOD_SECURE, isSecure);
+-}
+-
+ #define SUBTLECRYPTO_METHOD_BODY(Operation, aRv, ...)                   \
+   MOZ_ASSERT(mParent);                                                  \
+   RefPtr<Promise> p = Promise::Create(mParent, aRv);                    \
+   if (aRv.Failed()) {                                                   \
+     return nullptr;                                                     \
+   }                                                                     \
+-  RecordTelemetryOnce();                                                \
+   RefPtr<WebCryptoTask> task =                                          \
+     WebCryptoTask::Create ## Operation ## Task(__VA_ARGS__);            \
+   if (!task) {                                                          \
+     aRv.Throw(NS_ERROR_OUT_OF_MEMORY);                                  \
+     return nullptr;                                                     \
+   }                                                                     \
+   task->DispatchWithPromise(p);                                         \
+   return p.forget();
+diff --git a/dom/base/SubtleCrypto.h b/dom/base/SubtleCrypto.h
+--- a/dom/base/SubtleCrypto.h
++++ b/dom/base/SubtleCrypto.h
+@@ -114,18 +114,15 @@ public:
+                                       CryptoKey& unwrappingKey,
+                                       const ObjectOrString& unwrapAlgorithm,
+                                       const ObjectOrString& unwrappedKeyAlgorithm,
+                                       bool extractable,
+                                       const Sequence<nsString>& keyUsages,
+                                       ErrorResult& aRv);
+ 
+ private:
+-  void RecordTelemetryOnce();
+-
+   nsCOMPtr<nsIGlobalObject> mParent;
+-  bool mRecordedTelemetry;
+ };
+ 
+ } // namespace dom
+ } // namespace mozilla
+ 
+ #endif // mozilla_dom_SubtleCrypto_h
+diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
+--- a/toolkit/components/telemetry/Histograms.json
++++ b/toolkit/components/telemetry/Histograms.json
+@@ -7729,24 +7729,16 @@
+   },
+   "WEBCRYPTO_METHOD": {
+     "record_in_processes": ["main", "content"],
+     "expires_in_version": "never",
+     "kind": "enumerated",
+     "n_values": 20,
+     "description": "Methods invoked under window.crypto.subtle (0=encrypt, 1=decrypt, 2=sign, 3=verify, 4=digest, 5=generateKey, 6=deriveKey, 7=deriveBits, 8=importKey, 9=exportKey, 10=wrapKey, 11=unwrapKey)"
+   },
+-  "WEBCRYPTO_METHOD_SECURE": {
+-    "alert_emails": ["seceng-telemetry@mozilla.com"],
+-    "record_in_processes": ["main", "content"],
+-    "expires_in_version": "60",
+-    "kind": "boolean",
+-    "bug_numbers": [1333140],
+-    "description": "Whether a method invoked under window.crypto.subtle is in a secure context"
+-  },
+   "WEBCRYPTO_ALG": {
+     "record_in_processes": ["main", "content"],
+     "expires_in_version": "never",
+     "kind": "enumerated",
+     "n_values": 30,
+     "description": "Algorithms used with WebCrypto (see table in WebCryptoTask.cpp)"
+   },
+   "MASTER_PASSWORD_ENABLED": {

+ 45 - 0
mozilla-release/patches/1670130-83a1.patch

@@ -0,0 +1,45 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1602273092 0
+# Node ID ec24a434f5eaa10c6230a4bff6caa334f9103eae
+# Parent  bf336b289ea04a51bdc7d32e0c6b5b1756d5f424
+Bug 1670130 - Fix contract of `_execute_child()` in `ProcessHandlerMixin` under Python 3.9 on Windows r=firefox-build-system-reviewers,mhentges
+
+This updates the signature to match the actual signature which in 3.9 gained 4 additional arguments: `gid`, `gids`, `uid`, and `umask` (see [the source](https://github.com/python/cpython/blob/3.9/Lib/subprocess.py#L1330)).
+
+Differential Revision: https://phabricator.services.mozilla.com/D93121
+
+diff --git a/testing/mozbase/mozprocess/mozprocess/processhandler.py b/testing/mozbase/mozprocess/mozprocess/processhandler.py
+--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
++++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
+@@ -260,17 +260,29 @@ class ProcessHandlerMixin(object):
+             self._cleanup()
+             return self.returncode
+ 
+         """ Private Members of Process class """
+ 
+         if isWin:
+             # Redefine the execute child so that we can track process groups
+             def _execute_child(self, *args_tuple):
+-                if six.PY3:
++                # workaround for bug 1670130
++                if sys.hexversion >= 0x03090000:  # after 3.9.0
++                    (args, executable, preexec_fn, close_fds,
++                     pass_fds, cwd, env,
++                     startupinfo, creationflags, shell,
++                     p2cread, p2cwrite,
++                     c2pread, c2pwrite,
++                     errread, errwrite,
++                     restore_signals,
++                     gid, gids, uid,
++                     umask,
++                     start_new_session) = args_tuple
++                elif six.PY3:
+                     (args, executable, preexec_fn, close_fds,
+                      pass_fds, cwd, env,
+                      startupinfo, creationflags, shell,
+                      p2cread, p2cwrite,
+                      c2pread, c2pwrite,
+                      errread, errwrite,
+                      restore_signals, start_new_session) = args_tuple
+                 # workaround for bug 950894

+ 37 - 0
mozilla-release/patches/1716613-92a1.patch

@@ -0,0 +1,37 @@
+# HG changeset patch
+# User Mitchell Hentges <mhentges@mozilla.com>
+# Date 1627065947 0
+# Node ID 49ccf31999f61b522900aa8ae0d6518fc75d9545
+# Parent  a440103017806b6e0f3b22755e8bc8a0f0889bad
+Bug 1716613: Fix "'Process' has no attribute '_job'" r=ahal
+
+`self._job` is conditionally set. However, when it's not set, then
+`if self._job is None` raises an exception.
+
+Rather than having to check for `hasattr(self, "_job")`, defaulting
+`self._job` to `None` seems more elegant and resolves the issue.
+
+Differential Revision: https://phabricator.services.mozilla.com/D120754
+
+diff --git a/testing/mozbase/mozprocess/mozprocess/processhandler.py b/testing/mozbase/mozprocess/mozprocess/processhandler.py
+--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
++++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
+@@ -101,16 +101,18 @@ class ProcessHandlerMixin(object):
+                      universal_newlines=False,
+                      startupinfo=None,
+                      creationflags=0,
+                      ignore_children=False,
+                      encoding='utf-8'):
+ 
+             # Parameter for whether or not we should attempt to track child processes
+             self._ignore_children = ignore_children
++            self._job = None
++            self._io_port = None
+ 
+             if not self._ignore_children and not isWin:
+                 # Set the process group id for linux systems
+                 # Sets process group id to the pid of the parent process
+                 # NOTE: This prevents you from using preexec_fn and managing
+                 #       child processes, TODO: Ideally, find a way around this
+                 def setpgidfn():
+                     os.setpgid(0, 0)

+ 3 - 0
mozilla-release/patches/series

@@ -5676,6 +5676,7 @@ TOP-NOBUG-backout1440761-25318.patch
 TOP-NOBUG-test-fixes-25318.patch
 TOP-1846703-binutilsfix-11504.patch
 TOP-1859635-NSS3901-11506.patch
+1333140-2no1-59a1.patch
 1477010-63a1.patch
 1426827-63a1.patch
 1554306-69a1.patch
@@ -5690,8 +5691,10 @@ TOP-1859635-NSS3901-11506.patch
 1639815-8-78a1.patch
 1654470-81a1.patch
 1667896-83a1.patch
+1670130-83a1.patch
 1480005-3-86a1.patch
 1714632-92a1.patch
+1716613-92a1.patch
 1747754-PARTIAL-97a1.patch
 1761303-108a1.patch
 TOP-NOBUG-PLASTER-fix-strip-25319.patch