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

Suggestion: more output on error for troubleshooting #128

Open
kazuki0824 opened this issue Sep 17, 2021 · 0 comments · May be fixed by #191
Open

Suggestion: more output on error for troubleshooting #128

kazuki0824 opened this issue Sep 17, 2021 · 0 comments · May be fixed by #191

Comments

@kazuki0824
Copy link

kazuki0824 commented Sep 17, 2021

If you call this from build.rs and it terminates in error, the output will be too small to be useful like below.

Caused by:
process didn't exit successfully: C:\Users\kazuk\Desktop\recisdb-rust\target\debug\build\libarib25-sys-2f57403dcdef0bcc\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\kazuk.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5
stack backtrace: ..........

I suggest that we print an additional output to make it easier to reproduce the error. This can be done by simply changing here; https://github.com/alexcrichton/cmake-rs/blob/9af8515c781fc2a6163d60315a33485e45543e64/src/lib.rs#L940 to

    eprintln!("running: {:?}", cmd);

.
By this change, we can see what is now executed like:

Caused by:
process didn't exit successfully: C:\Users\kazuk\Desktop\recisdb-rust\target\debug\build\libarib25-sys-2f57403dcdef0bcc\build-script-build (exit code: 101)
--- stderr
running: "cmake" "-Wdev" "--debug-output" "C:\Users\kazuk\Desktop\recisdb-rust\libarib25-sys\./libarib25" "-Thost=x64" "-Ax64" "-G" "Visual Studio 16" "-DCMAKE_INSTALL_PREFIX=C:\Users\kazuk\Desktop\recisdb-rust\target\debug\build\libarib25-sys-e0102d33ba4baf38\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--" "/m:4"
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\kazuk.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5
stack backtrace:

But that is just a workaround and I bet there's more appropriate way to fix it.
I'm welcome to any discussion and suggestion. Thank you.

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