diff options
| author | Sergey Volkov <taranarmo@gmail.com> | 2024-06-27 08:46:08 +0200 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-07-08 07:44:32 +0000 |
| commit | eedf42eb37a6a18d50ea32b57b558931700fc1ff (patch) | |
| tree | 187a7d391d87e01ea57cd899aaac0d959688337c | |
| parent | Merge pull request #325427 from NixOS/backport-323767-to-release-24.05 (diff) | |
| download | nixpkgs-origin/backport-322826-to-release-24.05.tar.gz | |
pythonPackages.pyspark: fix calling wrapped python scriptorigin/backport-322826-to-release-24.05
See NixOS#64358 for the details.
(cherry picked from commit 9f50cb7e553fb7816d7eb01e67e8952a0c1e8a5a)
| -rw-r--r-- | pkgs/development/python-modules/pyspark/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyspark/default.nix b/pkgs/development/python-modules/pyspark/default.nix index a5e35e698c99..7ffcf52bea8a 100644 --- a/pkgs/development/python-modules/pyspark/default.nix +++ b/pkgs/development/python-modules/pyspark/default.nix @@ -29,6 +29,17 @@ buildPythonPackage rec { --replace py4j== 'py4j>=' ''; + postFixup = '' + # find_python_home.py has been wrapped as a shell script + substituteInPlace $out/bin/find-spark-home \ + --replace 'export SPARK_HOME=$($PYSPARK_DRIVER_PYTHON "$FIND_SPARK_HOME_PYTHON_SCRIPT")' \ + 'export SPARK_HOME=$("$FIND_SPARK_HOME_PYTHON_SCRIPT")' + # patch PYTHONPATH in pyspark so that it properly looks at SPARK_HOME + substituteInPlace $out/bin/pyspark \ + --replace 'export PYTHONPATH="''${SPARK_HOME}/python/:$PYTHONPATH"' \ + 'export PYTHONPATH="''${SPARK_HOME}/..:''${SPARK_HOME}/python/:$PYTHONPATH"' + ''; + propagatedBuildInputs = [ py4j ]; passthru.optional-dependencies = { |
