Skip to content

Cannot build Rust documentation on Windows with spaces in paths to Pandoc and/or LaTeX. #18632

Closed
@vharavy

Description

@vharavy

When I run ./configure and then make from MinGW-W64 shell everything goes fine until the process stumbles:

rustdoc: doc/not_found.html
rustdoc: doc/index.html
pandoc: doc/index.epub
/c/Program Files (x86)/Pandoc/pandoc --standalone --toc --number-sections --to=epub /d/Sources/Rust/src/doc/index.md --output=doc/index.epub
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/c/Program Files (x86)/Pandoc/pandoc --standalone --toc --number-sections --to=epub /d/Sources/Rust/src/doc/index.md --output=doc/index.epub'
/d/Sources/Rust/mk/docs.mk:216: recipe for target 'doc/index.epub' failed
make: *** [doc/index.epub] Error 1

I guess the problem is that I have Pandoc installed in C:\Program Files (x86)\Pandoc and MiKTeX in C:\Program Files\MiKTeX\ and both of these paths contains spaces.

I have tried to fix the problem myself by editing configure script. In particular I have tried replacing

printf "%-20s := %s\n" $1 "$T" >>config.tmp

in putvar function with

printf "%-20s := %q\n" $1 "$T" >>config.tmp

As the result, config.tmp contained properly escaped paths, but the following code at the end of configure script

# Munge any paths that appear in config.mk back to posix-y
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
               -e 's@\\@/@go;' config.tmp 

Replaced all backslashes to forward slashes thus ruining the paths again.

At this point I am stuck. My next try will be disabling this transformation but I am not sure whether it is safe or not. It works for me, but I would very much like to resolve this problem once and for all. I am willing to work on this and submit merge request afterwards but at this point any guidance will be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions