8000 Add support to paths with spaces in rust lang implementation · Issue #167 · gpoore/pythontex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support to paths with spaces in rust lang implementation #167

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

Closed
Delanii opened this issue May 18, 2020 · 3 comments
Closed

Add support to paths with spaces in rust lang implementation #167

Delanii opened this issue May 18, 2020 · 3 comments
Labels

Comments

@Delanii
Copy link
Delanii commented May 18, 2020

I think I have hit upon a bug in rust lang support.
Compilation with PythonTeX on Windows fails when using rust command families (or rs in that regard) and if you have a space in path to .pytxcode file.

The error message I am getting is:

error: multiple input filenames provided (first two filenames are `Zaloha\Databaze\JazykAccessASQL\Poznamky\minted\<outputdir>\rust_default_default.exe` and `<outputdir>\rust_default_default.rs`)

If I remove the space in path (which is before "Zaloha"), and if there are no other spaces in filepath, error is gone.

I have looked into pythontex_engines.py and naively tryed to add quotations at line 1540 around {workingdir} and {file}.rs, but the error persists. If I use just very basic compilation with rustc compiler:

rustc C:\filepath\with space\file.rs

I get fully working binary. I am Rust newbie, just experimenting with Rust and PythonTeX, and Rust template for PythonTeX looks to me pretty complicated (or at least extensive).

How could this be fixed?

@gpoore
Copy link
Owner
gpoore commented May 18, 2020

I think the issue is in the compilation command in pythontex_engines.py. Try swapping

['{rustc} --crate-type bin -o {File}.exe -L {workingdir} {file}.rs', '{File}.exe']

for

['{rustc} --crate-type bin -o "{File}.exe" -L "{workingdir}" {file}.rs', '"{File}.exe"']

That is, add quotes around the executable and working directory. {file}.rs shouldn't need quotes, since it is a temp file in the pythontex-files-* directory, and that path should be guaranteed to have no spaces given how it is constructed.

@gpoore gpoore added the bug label May 18, 2020
@Delanii
Copy link
Author
Delanii commented May 19, 2020

Proposed solution of adding quotation marks in compilation command fixes my issue.
Thank you very much Mr. Poore. Next time, I will test adding more quotations than less while debuging.
Will this change end up supported in next pythontex release, or in next TeXlive update?

8000

@gpoore
Copy link
Owner
gpoore commented May 19, 2020

Yes, I'll get this fixed in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0