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

AssertionError: Cannot find .runfiles directory #1426

Closed
sgowroji opened this issue Sep 21, 2023 · 4 comments · Fixed by #1429
Closed

AssertionError: Cannot find .runfiles directory #1426

sgowroji opened this issue Sep 21, 2023 · 4 comments · Fixed by #1429

Comments

@sgowroji
Copy link
Member

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3319#018ab077-c764-4cc2-8b32-9fb08619ef90

rules_python: rules_python (example bzlmod build file running gazelle and pip integration test on :ubuntu: 20.04 LTS (OpenJDK 11, gcc 9.4.0))
Logs:

 File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/3b10eb146ec4242f66f1b569edf0069e/execroot/_main/bazel-out/k8-opt-exec-ST-e846b08c7501/bin/external/rules_python_gazelle_plugin~override/python/std_modules", line 172, in FindModuleSpace
    raise AssertionError('Cannot find .runfiles directory for %s' % sys.argv[0])
AssertionError: Cannot find .runfiles directory for /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/3b10eb146ec4242f66f1b569edf0069e/execroot/_main/bazel-out/k8-opt-exec-ST-e846b08c7501/bin/external/rules_python_gazelle_plugin~override/python/std_modules
gazelle: failed to wait for std_modules: exit status 1

Culprit Found: 2f9c7d60ea676f9f8e929b20a3ff74e786995c91

CC Greenteam @comius

@comius
Copy link
Contributor

comius commented Sep 21, 2023

cc @rickeylev

@rickeylev
Copy link
Collaborator

cc @f0rmiga -- Something about Gazelle unable to find the Python runfiles? But I thought Gazelle was written in Go, not Python?

@f0rmiga
Copy link
Collaborator

f0rmiga commented Sep 21, 2023

Seems related to #1415.

@aignas
Copy link
Collaborator

aignas commented Sep 21, 2023

@rickeylev, gazelle plugin is written in go and it spawns a Python process which the go code is communicating to via stdin/stdout and it is included in the gazelle plugin via https://github.com/aignas/rules_python/blob/main/gazelle/python/BUILD.bazel#L21

github-merge-queue bot pushed a commit that referenced this issue Sep 26, 2023
Pass the environment generated by the `runfiles` helper so that the
Python launcher can find the runfiles correctly as implemented in
bazelbuild/bazel#14740.

Fixes #1426
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.

5 participants