Skip to content
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

rules_fuzzing incompatible with rules_python > 0.26 #239

Closed
tpudlik opened this issue Nov 16, 2023 · 1 comment · Fixed by #240
Closed

rules_fuzzing incompatible with rules_python > 0.26 #239

tpudlik opened this issue Nov 16, 2023 · 1 comment · Fixed by #240

Comments

@tpudlik
Copy link
Contributor

tpudlik commented Nov 16, 2023

Expected Behavior

rules_fuzzing is compatible with recent versions of rules_python.

Actual Behavior

rules_fuzzing_init calls pip_parse, but the signature of that function changed in rules_python 0.13 (specifically in bazelbuild/rules_python#807). Instead of a single requirements attribute, there's now three per-OS attributes (requirements_linux, requirements_windows, requirements_darwin).

This means a project that uses rules_fuzzing needs to replace a call to rules_fuzzing_init with a reimplementation that looks like,

pip_parse(
    name = "fuzzing_py_deps",
    extra_pip_args = ["--require-hashes"],
    python_interpreter_target = interpreter,
    requirements_darwin = "@rules_fuzzing//fuzzing:requirements.txt",
    requirements_linux = "@rules_fuzzing//fuzzing:requirements.txt",
    requirements_windows = "@rules_fuzzing//fuzzing:requirements.txt",
)

The fix is simple enough (change the rules_fuzzing_init to look like this), but will make rules_fuzzing incompatible with versions of rules_python older than 0.13. That version is a little over a year old, it came out on September 25, 2022.

I'll send a PR.

Specifications

  • Version: Still broken on the master branch.
  • Platform: Broken on any platform.
@tpudlik
Copy link
Contributor Author

tpudlik commented Nov 16, 2023

I ended up a little confused about what's going on here, because rules_fuzzing apparently already uses rules_python 0.20, in which pip_parse should expect per-OS requirements.

It turns out that until bazelbuild/rules_python#1514, pip_parse had a wrapper that accepted requirements as an argument, and passed them to pip_repository as requirements_lock. So the incompatibility will only be with the next version of rules_python. I'll update the issue title accordingly.

@tpudlik tpudlik changed the title rules_fuzzing incompatible with rules_python >= 0.13 rules_fuzzing incompatible with rules_python > 0.26 Nov 16, 2023
tpudlik added a commit to tpudlik/rules_fuzzing that referenced this issue Nov 16, 2023
The `requirements` argument is deprecated and will be removed in the
next rules_python release.

Fixes bazelbuild#239
stefanbucur pushed a commit that referenced this issue Nov 16, 2023
The `requirements` argument is deprecated and will be removed in the
next rules_python release.

Fixes #239
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant