rust-lang / rust-lang/cc-rs

Compilation errors not shown in output

Open
#809 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.2k
Forks
617
Avg merge
22h 32m
Merged PRs (30d)
41

Description

Version: 1.0.79
OS: Windows 11 x64 with MSVC (with french language module)

This build script: https://github.com/ennis/openimageio-rs/blob/master/openimageio-sys/build.rs
produces the following output:

The following warnings were emitted during compilation:
warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e
warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e
warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e
warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e
warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e
error: failed to run custom build command for `openimageio-sys v0.1.0 (C:\Users\Alexandre\devel\openimageio-rs\openimageio-sys)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_TEST_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
  process didn't exit successfully: `C:\Users\Alexandre\devel\openimageio-rs\target\debug\build\openimageio-sys-62699496145a9d69\build-script-build` (exit code: 1)
  --- stderr
  trying to detect/fetch OpenImageIO via vcpkg...
  found OpenImageIO through vcpkg
  -> libs: ["C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\OpenImageIO.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\OpenImageIO_Util.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\zlib.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\tiff.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\lzma.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\jpeg.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\turbojpeg.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\Iex-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\IlmThread-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\OpenEXR-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\OpenEXRCore-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\OpenEXRUtil-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\Imath-3_1.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\libpng16.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\fmt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_thread-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_system-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_regex-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_container-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_exception-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_date_time-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_chrono-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_atomic-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_stacktrace_noop-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_stacktrace_windbg-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_stacktrace_windbg_cached-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_random-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_filesystem-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_coroutine-vc140-mt.lib", "C:\\vcpkg\\installed\\x64-windows-static-md\\lib\\boost_context-vc140-mt.lib"]
  -> link paths: ["C:\\vcpkg\\installed\\x64-windows-static-md\\lib"]
  -> include paths: ["C:\\vcpkg\\installed\\x64-windows-static-md\\include"]
  -> DLLs: []
  -> DLL paths: []
  clang version 15.0.4
  Target: x86_64-pc-windows-msvc
  Thread model: posix
  InstalledDir: 
  ignoring nonexistent directory "lib\clang\15.0.4\include"
  #include "..." search starts here:
  #include <...> search starts here:
   C:\vcpkg\installed\x64-windows-static-md\include
   C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include
   C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\atlmfc\include
   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared
   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um
   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt
   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt
  End of search list.
  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "src/glue" "-I" "C:\\vcpkg\\installed\\x64-windows-static-md\\include" "-W4" "-std=c++17" "-DOIIO_STATIC_DEFINE" "-FoC:\\Users\\Alexandre\\devel\\openimageio-rs\\target\\debug\\build\\openimageio-sys-fdd0f34cca1069aa\\out\\src/glue/imagecache.o" "-c" "src/glue/imagecache.cpp" with args "cl.exe" did not execute successfully (status code exit code: 2).
Process finished with exit code 101

If I compile the file separately I can see the compilation errors:

src/glue/imagecache.cpp(9): error C2027: utilisation du type non défini 'OpenImageIO_v2_4::ImageCache'
C:\vcpkg\installed\x64-windows-static-md\include\OpenImageIO/imagebuf.h(27): note: voir la déclaration de 'OpenImageIO_v2_4::ImageCache'
src/glue/imagecache.cpp(9): error C3861: 'create' : identificateur introuvable
src/glue/imagecache.cpp(13): error C2027: utilisation du type non défini 'OpenImageIO_v2_4::ImageCache'
C:\vcpkg\installed\x64-windows-static-md\include\OpenImageIO/imagebuf.h(27): note: voir la déclaration de 'OpenImageIO_v2_4::ImageCache'
src/glue/imagecache.cpp(13): error C3861: 'destroy' : identificateur introuvable
src/glue/imagecache.cpp(17): error C2027: utilisation du type non défini 'OpenImageIO_v2_4::ImageCache'
...

Curiously the script still prints the warnings for the invalid command line parameters (warning: cl�: Ligne de commande warning D9002�: option '-std=c++17' inconnue ignor�e), but compilation warning and errors are not reported.

It works fine (it reports the errors) if I install the VS english language pack and set that as the default language, so I suppose this is a problem related to non-UTF8 output being silently dropped somehow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the cc-rs compiler-output handling around the build script invocation, then reproduce the failure with the referenced openimageio-sys build.rs and MSVC using the French language pack. Compare the output with the separately compiled src/glue/imagecache.cpp errors; done means compilation diagnostics are reported instead of being silently dropped.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.