Skip to content

Commit 8e4195f

Browse files
author
Martin Larralde
committed
Fix RustExtension using absolute path causing strange path errors
1 parent c474e3c commit 8e4195f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

setuptools_rust/extension.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,16 @@ def __init__(self, target, path,
8585
self.features = [s.strip() for s in features]
8686

8787
# get absolute path to Cargo manifest file
88-
file = sys._getframe(1).f_globals.get('__file__')
89-
if file:
90-
dirname = os.path.dirname(file)
91-
if dirname:
92-
cwd = os.getcwd()
93-
os.chdir(dirname)
94-
path = os.path.abspath(path)
95-
os.chdir(cwd)
88+
path = os.path.relpath(path)
89+
# file = sys._getframe(1).f_globals.get('__file__')
90+
# if file:
91+
# dirname = os.path.dirname(file)
92+
# print(dirname)
93+
# if dirname:
94+
# cwd = os.getcwd()
95+
# os.chdir(dirname)
96+
# path = os.path.abspath(path)
97+
# os.chdir(cwd)
9698

9799
self.path = path
98100

0 commit comments

Comments
 (0)