New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages.pyspark: call wrapped python script correctly #64740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option may be to just patch the (eventually) wrapped python script to hand back the exact home of spark, instead of worry about the env var logic. One of the benefits of nix :).
example commit, if im talking gibberish 06960ac
# includes SPARK_HOME | ||
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")''\n export PYTHONPATH="$(dirname $SPARK_HOME):$PYTHONPATH"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid exporting PYTHONPATH
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FRidh Is it OK to modify an existing PYTHONPATH
export in $out/bin/pyspark
(latest commit) rather than adding a new one in find-spark-home
? I can't think of a better way to change the search path.
56fb6f1
to
e494273
Compare
Thank you for your contributions.
|
I marked this as stale due to inactivity. → More info |
Motivation for this change
See #64358.
pyspark
tries to figure outSPARK_HOME
by calling a Python script, but it has already been wrapped. This change invokes the wrapped script correctly, as well as sets a correct search path for thepyspark
package.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)