aspect-build/rules_py

[Bug]: The output of `py_binary` is not deterministic

zhihao-gong opened this issue · 1 comments

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

Will be resolved by #233