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

install_extension crashes due to attempt to mkdir an empty path (v1.8.0) #379

Closed
Rongronggg9 opened this issue Oct 30, 2023 · 0 comments · Fixed by #380
Closed

install_extension crashes due to attempt to mkdir an empty path (v1.8.0) #379

Rongronggg9 opened this issue Oct 30, 2023 · 0 comments · Fixed by #380

Comments

@Rongronggg9
Copy link
Contributor

When I did python3 setup.py build_ext for breezy, I got the below error:

Running `rustc --crate-name brz --edition=2021 breezy/main.rs --tons-of-flags`
Finished dev [unoptimized + debuginfo] target(s) in 3m 16s
error: [Errno 2] No such file or directory: ''

However, if I locked setuptools-rust==1.7.0, everything went fine:

Running `rustc --crate-name brz --edition=2021 breezy/main.rs --tons-of-flags`
Finished dev [unoptimized + debuginfo] target(s) in 3m 18s
Copying rust artifact from target/debug/brz to brz
# Cython logs ...

I guess the regression was introduced by 7ced8d2

cwd = os.getcwd()
if dylib_path.startswith(cwd):
dylib_path = os.path.relpath(dylib_path, cwd)
if ext_path.startswith(cwd):
ext_path = os.path.relpath(ext_path, cwd)
os.makedirs(os.path.dirname(ext_path), exist_ok=True)
logger.info("Copying rust artifact from %s to %s", dylib_path, ext_path)

Let's assume:

cwd = '/<<cwd>>'
ext_path = '/<<cwd>>/executable'

The above code snippet will resulting in:

>>> ext_path = os.path.relpath(ext_path, cwd)
>>> assert ext_path == 'executable'
>>> assert os.path.dirname(ext_path) == ''
>>> os.makedirs('', exist_ok=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen os>", line 225, in makedirs
FileNotFoundError: [Errno 2] No such file or directory: ''
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.

1 participant