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

Windows-style paths #298

Open
ruairimoran opened this issue Oct 12, 2022 · 0 comments
Open

Windows-style paths #298

ruairimoran opened this issue Oct 12, 2022 · 0 comments
Labels
bug Something isn't working python issue related to python windows Windows

Comments

@ruairimoran
Copy link
Collaborator

Describe the bug

Backslash messes up things when local open is used:

[INFO] Building optimizer
error: failed to parse manifest at `D:\PycharmProjects\OpEn_Fix_107\open-codegen\opengen\my_optimizers\rosenbrock\Cargo.toml`
Caused by:
  could not parse input as TOML
Caused by:
  TOML parse error at line 19, column 35
     |
  19 | optimization_engine = {path = "D:\PycharmProjects\OpEn_Fix_107\"}
     |                                   ^
  Unexpected `P`
  While parsing escape sequence
  While parsing a Basic String
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 198, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2021.2.3\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:/PycharmProjects/OpEn_Fix_107/open-codegen/opengen/main.py", line 47, in <module>
    builder.build()
  File "D:\PycharmProjects\OpEn_Fix_107\venv\lib\site-packages\opengen\builder\optimizer_builder.py", line 804, in build
    self.__build_optimizer()             # build overall project
  File "D:\PycharmProjects\OpEn_Fix_107\venv\lib\site-packages\opengen\builder\optimizer_builder.py", line 570, in __build_optimizer
    raise Exception('Rust build failed')
Exception: Rust build failed

The issue has been analysed to be due to the function get_open_local_absolute_path() in main.py providing an address path incompatible with windows.

To Reproduce

Use with_open_version(local_path=...) on Windows. We need get_open_local_absolute_path() to return paths with forward slashes both on Windows and Linux/MacOS.

System information:

  • Windows
@ruairimoran ruairimoran added bug Something isn't working python issue related to python windows Windows labels Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python issue related to python windows Windows
Projects
None yet
Development

No branches or pull requests

1 participant