Closed ognevny closed 9 months ago
I've done little testing on windows, on even then it was for x86_64-pc-windows-msvc
.
The build doesn't fail though, right? (In build.rs
that error should return Ok(())
and the build should continue).
That said, seems strange that you have it installed, but it can't find it. How did you install asciidoctor
? Is it on your PATH
?
All that build.rs
does is Command::new("asciidoctor").output()
, so if it's on your PATH
it should work (as far as I know - my understanding of the PATH is Unix-based not Windows-based...).
I've done little testing on windows, on even then it was for
x86_64-pc-windows-msvc
. The build doesn't fail though, right? (Inbuild.rs
that error should returnOk(())
and the build should continue).
it doesn't fail, only asciidoctor isn't found
That said, seems strange that you have it installed, but it can't find it. How did you install
asciidoctor
? Is it on yourPATH
?
installed through pacman -S $MINGW_PACKAGE_PREFIX-asciidoctor
All that
build.rs
does isCommand::new("asciidoctor").output()
, so if it's on yourPATH
it should work.
in msys2 PATH is set for certain MSYSTEMs, so /clang64/bin is included
Can you point me to any documentation on how you setup pacman with msys2? I've not ever setup a windows machine this way, since it's something I don't know about I'm happy to learn.
If you point me to the website/documentation/etc, I'll try to reproduce this in a VM and see how far I get. 🙂
Can you point me to any documentation on how you setup pacman with msys2? I've not ever setup a windows machine this way, since it's something I don't know about I'm happy to learn.
If you point me to the website/documentation/etc, I'll try to reproduce this in a VM and see how far I get. 🙂
just visit https://msys2.org/, there is beginners' guide
Alrighty, so I installed msys2. Hopefully I set things up right!
This was more or less what I did:
# install asciidoctor and ripgrep
$ pacman -S mingw-w64-clang-x86_64-asciidoctor
$ pacman -S mingw-w64-clang-x86_64-ripgrep
# update path to include installed packages
$ export PATH="/clang64/bin:$PATH"
# install rustup in msys2
$ export RUSTUP_HOME="$HOME/.rustup"
$ export CARGO_HOME="$HOME/.cargo"
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host=x86_64-pc-windows-gnu
# install git and clone repgrep
$ pacman -S git
$ git clone https://github.com/acheronfail/repgrep
# check asciidoctor
$ which asciidoctor
/clang64/bin/asciidoctor
# run test
$ cd repgrep
$ cargo clean; cargo build -q && cat target/debug/build/repgrep-*/stderr
Could not run 'asciidoctor' binary, skipping manpage generation.
Error from running 'asciidoctor': program not found
It seems you're right - in this msys2 environment things are weird.
I added a line to print the PATH
in the build.rs
script, and msys2 prints it as this:
"C:\\msys64\\home\\acheronfail\\src\\repgrep\\target\\debug\\deps;C:\\msys64\\home\\acheronfail\\src\\repgrep\\target\\debug;C:\\msys64\\home\\acheronfail\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib;C:/msys64/home/acheronfail/.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\bin;C:\\msys64\\clang64\\bin;C:\\msys64\\home\\acheronfail\\.cargo\\bin;C:\\msys64\\usr\\local\\bin;C:\\msys64\\usr\\bin;C:\\msys64\\usr\\bin;C:\\msys64\\opt\\bin;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\msys64\\usr\\bin\\site_perl;C:\\msys64\\usr\\bin\\vendor_perl;C:\\msys64\\usr\\bin\\core_perl"
It's clear that the /clang64/bin
directory is there - I wonder if this is due to some Windows path behaviour? If I echo $PATH
in hte msys2 terminal it appears to be a unix-like path, but when printing the path in the Rust build script it's been converted to Windows-style paths... I don't know enough about the msys2 environment, but if asciidoctor
can definitely be found on the path, I'm not sure what's going on here... 🤔
I applied a workaround, see https://github.com/msys2/MINGW-packages/pull/19779
sorry for late answer, few notes:
pacman -S mingw-w64-clang-x86_64-rust
), rustup sometimes shows unwanted behaviourC:\msys64\
). also if you use CLANG64 shell, you don't need to add /clang64/bin
to PATH
.Command::new("sh").arg("script")
to make it work. any other ways return os code 3 or os code 193. but when I tried to apply this workaround in build.rs, it didn't workGreat that you were able to find a good workaround. I'm still not 100% clear on how msys2 works, having just used WSL myself on Windows platforms myself.
Since you have the workaround, I'm going to close this issue. Thanks for reporting it though!
running
cargo build
at master shows itwhile actual output from asciidoctor is
toolchain info: (see msys2.org for details) MSYSTEM: CLANG64
asciidoctor -V
:cargo -Vv
:running asciidoctor directly works