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

Bazelisk build failed #2762

Open
pjachowi opened this issue Jul 31, 2024 · 3 comments
Open

Bazelisk build failed #2762

pjachowi opened this issue Jul 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@pjachowi
Copy link

Describe your environment

OS: Ubuntu
Python version: Python 3.9.19
Package version: 0.47b0

What happened?

Attempt to build a Python project using opentelemetry.instrumentation.grpc using Bazel fails.
Here is the minimal project reproducing the problem: https://github.com/pjachowi/otel_intrumentation_problem

Steps to Reproduce

  1. Clone the repo https://github.com/pjachowi/otel_intrumentation_problem
  2. bazelisk run //:requirements.update
  3. bazelisk run //:test

Expected Result

Successful run

Actual Result

$ bazelisk run //:test
INFO: Analyzed target //:test (73 packages loaded, 4272 targets configured).
INFO: Found 1 target...
Target //:test up-to-date:
bazel-bin/test
INFO: Elapsed time: 0.401s, Critical Path: 0.04s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/test
Traceback (most recent call last):
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/main/test.py", line 1, in
from opentelemetry.instrumentation import grpc
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation_grpc/site-packages/opentelemetry/instrumentation/grpc/init.py", line 291, in
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation/site-packages/opentelemetry/instrumentation/instrumentor.py", line 27, in
from opentelemetry.instrumentation.dependencies import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation/site-packages/opentelemetry/instrumentation/dependencies.py", line 4, in
from pkg_resources import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/pkg_resources/init.py", line 96, in
from jaraco.text import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/setuptools/_vendor/jaraco/text/init.py", line 231, in
files(name).joinpath('Lorem ipsum.txt').read_text(encoding='utf-8')
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1266, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1252, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1120, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/setuptools/_vendor/jaraco/text/Lorem ipsum.txt'

Additional context

The problem appared with the latest release 0.47b0, however pinning opentelemetry-instrumentation-grpc==0.46b0 reproduces the problem as well.

Would you like to implement a fix?

None

@pjachowi pjachowi added the bug Something isn't working label Jul 31, 2024
@xrmx
Copy link
Contributor

xrmx commented Aug 2, 2024

From the stacktrace this looks unrelated though, looks more like the tool is messing with some unrelated stuff in setuptools.

@zeitlinger
Copy link
Member

I have the same issue - you can use can see how I fixed my example app grafana/docker-otel-lgtm#81

@pjachowi
Copy link
Author

I have the same issue - you can use can see how I fixed my example app grafana/docker-otel-lgtm#81

I managed to fix the problem by adding to requirements.in

setuptools==70.3.0

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
None yet
Development

No branches or pull requests

3 participants