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

[Bug]: The output of py_binary is not deterministic #238

Closed
zhihao-gong opened this issue Jan 2, 2024 · 1 comment · Fixed by #233
Closed

[Bug]: The output of py_binary is not deterministic #238

zhihao-gong opened this issue Jan 2, 2024 · 1 comment · Fixed by #233
Assignees
Labels
bug Something isn't working

Comments

@zhihao-gong
Copy link

zhihao-gong commented Jan 2, 2024

What happened?

The venv.temp.sh script calls python -m venv which generates the venv template (source code).

The outputs have absolute path embedded in activate.sh, activate.fish etc, which would cause nondeterministic outputs.

Version

Development (host) and target OS/architectures:

Output of bazel --version:
bazel 6.3.2

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
0.5.0

Language(s) and/or frameworks involved:
n/a

How to reproduce

Using the master branch of rules_py

gzh@desk-0181:~/rules_py$ bazel build //examples/django:django
INFO: Invocation ID: 37ecb87f-e0a2-49ba-bfa9-2d0611dcf806
INFO: Analyzed target //examples/django:django (46 packages loaded, 2518 targets configured).
INFO: Found 1 target...
Target //examples/django:django up-to-date:
  bazel-bin/examples/django/django
INFO: Elapsed time: 4.720s, Critical Path: 2.53s
INFO: 8 processes: 1 remote cache hit, 7 internal.
INFO: Build completed successfully, 8 total actions
tusen@desk-0181:~/rules_py$ cat bazel-out/k8-fastbuild/bin/examples/django/django.venv.source/bin/activate | grep VIRTUAL_ENV
    unset VIRTUAL_ENV
VIRTUAL_ENV="/home/tusen/.cache/bazel/_bazel_tusen/e441b6fe7baafb2a17e187ee01b3e54e/sandbox/linux-sandbox/204/execroot/aspect_rules_py/bazel-out/k8-fastbuild/bin/examples/django/django.venv.source"

Any other information?

No response

@zhihao-gong zhihao-gong added the bug Something isn't working label Jan 2, 2024
@github-actions github-actions bot added the untriaged Requires traige label Jan 2, 2024
@mattem
Copy link
Collaborator

mattem commented Jan 2, 2024

Will be resolved by #233

@mattem mattem removed the untriaged Requires traige label Jan 2, 2024
@mattem mattem self-assigned this Jan 2, 2024
mattem pushed a commit that referenced this issue Feb 15, 2024
Switches creating the venv to a dedicated tool, removing the requirement
for pip.

Venv is now created just before the binary or test runs, rather than as
an action output. The overhead is minimal, venv creation and activation
takes at most 7ms as observed during testing.

Closes #233
Closes #238
Closes #176
Closes #218
Closes #248
Closes #152
Closes #110
@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants