mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
python3Packages.glean-sdk: apply patch for process environments
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
, python3Packages
|
||||
, rustPlatform
|
||||
, setuptools-rust
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
@@ -14,6 +15,12 @@ python3Packages.buildPythonPackage rec {
|
||||
sha256 = "sha256-X2p6KQnEB6ZHdCHGFVEoEMiI+0R2vfGqel+jFKTcx74=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix the environment for spawned process
|
||||
# https://github.com/mozilla/glean/pull/1542
|
||||
./pr-1542.patch
|
||||
];
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoTarball {
|
||||
inherit src;
|
||||
name = "${pname}-${version}";
|
||||
|
||||
20
pkgs/development/python-modules/glean-sdk/pr-1542.patch
Normal file
20
pkgs/development/python-modules/glean-sdk/pr-1542.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
diff --git a/glean-core/python/glean/_process_dispatcher.py b/glean-core/python/glean/_process_dispatcher.py
|
||||
index 33a8b12796..a39b54a917 100644
|
||||
--- a/glean-core/python/glean/_process_dispatcher.py
|
||||
+++ b/glean-core/python/glean/_process_dispatcher.py
|
||||
@@ -120,8 +120,14 @@ def dispatch(cls, func, args) -> Union[_SyncWorkWrapper, subprocess.Popen]:
|
||||
Path(".coveragerc").absolute()
|
||||
)
|
||||
|
||||
+ # Explicitly pass the contents of `sys.path` as `PYTHONPATH` to the
|
||||
+ # subprocess so that there aren't any module search path
|
||||
+ # differences.
|
||||
+ python_path = ":".join(sys.path)[1:]
|
||||
+
|
||||
p = subprocess.Popen(
|
||||
- [sys.executable, _process_dispatcher_helper.__file__, payload]
|
||||
+ [sys.executable, _process_dispatcher_helper.__file__, payload],
|
||||
+ env={"PYTHONPATH": python_path},
|
||||
)
|
||||
|
||||
cls._last_process = p
|
||||
Reference in New Issue
Block a user