open-telemetry / open-telemetry/opentelemetry-python-contrib
Invalid cross-device link when running tox -e generate
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Describe your environment
Using Python 3.9 on linux, the only interesting part is that my /tmp and the repo checkout are on different filesystems.
Steps to reproduce
Run tox -e generate
What is the expected behavior?
A working script
What is the actual behavior?
Traceback (most recent call last):
File "/home/michael/work/opentelemetry-python-contrib/scripts/generate_instrumentation_bootstrap.py", line 120, in <module>
compare()
File "/home/michael/work/opentelemetry-python-contrib/scripts/generate_instrumentation_bootstrap.py", line 114, in compare
os.replace(gen_path, "bootstrap_gen.py")
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmphlewuek9/new.py' -> 'bootstrap_gen.py
Additional context
I worked around it by adding a line to tox.ini to set $TMP to a directory on the same filesystem. Wouldn't surprise me if others have seen this issue. Not sure if anyone has a preferred way of fixing it - this clearly isn't, probably fixing the os.replace() call with a copy would work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/generate_instrumentation_bootstrap.py, especially compare() around the os.replace call at line 114, then inspect tox.ini and run tox -e generate with /tmp and the repository on different filesystems. Done means the generation script completes and produces a working bootstrap_gen.py without the cross-device link error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100