Open polykernel opened 2 years ago
According to SeleniumHQ/selenium#10083 (comment), the recommended way to build from source is invoking
bazel build //py:selenium-wheel
on the source repository. I am not familiar with bazel and the python packaging framework in Nixpkgs but would it be possible to utilize bazel in the selenium build process?
bazel is always a huge pain point and makes everything in nix a bit harder than necessary. So I would really try to avoid using it. We probably end up doing the build steps manually.
Couldn't figure out what bazel is doing behind its multiple layers of abstraction. Only option I see is to fetch the wheel which is also ugly.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/how-to-fix-selenium-python-package-locally/23660/1
I have the same issue, any progress on a fix?
EDIT: quick workaround currently being that i use python packages from 22.05, though this is an unacceptable state
they are also broken now
I haven't tried this yet myself, but the NixOS Discourse mentioned earlier has a workaround: https://discourse.nixos.org/t/how-to-fix-selenium-python-package-locally/23660/4
Describe the bug
The selenium python bindings includes additional build artifacts(i.e javascript file) in its build process which are depended on for certain functionality. However, these files are not included when building with setuptools as they are built by bazel and copied into the source. This result in errors at runtime when certain functions are called which requires loading the javascript files. For instance,
get_attribute
andis_displayed
.This seems to be caused by the version bump 3.141.0 -> 4.2.0 in https://github.com/NixOS/nixpkgs/commit/8466ac2820966da53ff0d8aafbb01380cab195e4 as prior versions are built using the sdist tarball on PyPi which include the necessary build artifacts. Version 4.0.0 do not have corresponding sdist tarball available as reported in https://github.com/SeleniumHQ/selenium/issues/9917 and subsequent version also do not seem to have them.
Relevant files: https://github.com/SeleniumHQ/selenium/blob/7b1c6461f618fefcb8fec4a972bc7ec1abb47c34/py/BUILD.bazel#L84-L107
Steps To Reproduce
Rough reproducible example:
Error log
``` Traceback (most recent call last): File "/home/user/test.py", line 11, inExpected behavior
The javascript build artifacts are present in the python environment and the
get_attribute
function call completes successfully.Additional context
According to https://github.com/SeleniumHQ/selenium/issues/10083#issuecomment-982068916, the recommended way to build from source is invoking
bazel build //py:selenium-wheel
on the source repository. I am not familiar with bazel and the python packaging framework in Nixpkgs but would it be possible to utilize bazel in the selenium build process?Notify maintainers
@jraygauthier @SuperSandro2000
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.