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

[MSVC] protobuf failed to run test on Windows #19584

Open
Zhaojun-Liu opened this issue Dec 10, 2024 · 3 comments
Open

[MSVC] protobuf failed to run test on Windows #19584

Zhaojun-Liu opened this issue Dec 10, 2024 · 3 comments

Comments

@Zhaojun-Liu
Copy link

What version of protobuf and what language are you using?
Version: main
Language: C++

What operating system (Linux, Windows, ...) and version?
Windows Server 2022 Datacenter 21H2
What runtime / compiler are you using (e.g., python version or gcc version)
VS 2022
What did you do?
Steps to reproduce the behavior:

  1. git clone https://github.com/protocolbuffers/protobuf C:\gitP\google\protobuf
  2. Open VS2022 x64 Native Tools command.
  3. set CL=/std:c++17
  4. mkdir C:\gitP\google\protobuf\build_amd64 & cd C:\gitP\google\protobuf\build_amd64
  5. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 ..
  6. msbuild /m /p:Platform=x64 /p:Configuration=Release protobuf.sln /t:Rebuild
  7. cd /d C:\gitP\google\protobuf\build_amd64\Release
  8. .\tests.exe
  9. mkdir C:\gitP\google\protobuf\build_amd64_ltcg & cd C:\gitP\google\protobuf\build_amd64_ltcg
  10. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_EXE_LINKER_FLAGS="/LTCG" -DCMAKE_C_FLAGS="/GL" -DCMAKE_CXX_FLAGS="/GL" ..
  11. msbuild /m /p:Platform=x64 /p:Configuration=Release protobuf.sln /t:Rebuild
  12. cd /d C:\gitP\google\protobuf\build_amd64_ltcg\Release
  13. .\tests.exe

What did you expect to see
all tests passed.

What did you see instead?
F0000 00:00:1733798696.078170 7892 command_line_interface_unittest.cc:342] Check failed: File::GetContents(path, &file_contents, true) is OK (NOT_FOUND: Could not open file)
*** Check failure stack trace: ***
@ 00007FF6E87C4679 (unknown)
@ 00007FF6E8219580 (unknown)
@ 00007FF6E8219086 (unknown)
@ 00007FF6E81FE676 (unknown)
@ 00007FF6E878E51B (unknown)
@ 00007FF6E878E406 (unknown)
@ 00007FF6E87B68A0 (unknown)
@ 00007FF6E87B6C76 (unknown)
@ 00007FF6E87B75F8 (unknown)
@ 00007FF6E878E55B (unknown)
@ 00007FF6E878E4E6 (unknown)
@ 00007FF6E87B6F46 (unknown)
@ 00007FF6E88374E9 (unknown)
@ 00007FF6E87FFB70 (unknown)
@ 00007FFDEC5A4CB0 (unknown)
@ 00007FFDED59EDCB (unknown)

[ RUN ] EditionMessageTest.ParseFromFileDescriptor
F0000 00:00:1733798697.752301 8600 googletest.cc:122] Check failed: mkdir(name_.c_str(), 0777) == 0 File exists
*** Check failure stack trace: ***
@ 00007FF60D87A6B2 (unknown)
@ 00007FF60D31F15C (unknown)
@ 00007FF60DC3673B (unknown)
@ 00007FF60DC35556 (unknown)
@ 00007FF60DC1EAE6 (unknown)
@ 00007FF60DC1F2A8 (unknown)
@ 00007FF60DC2FD27 (unknown)
@ 00007FF60DC369D9 (unknown)
@ 00007FF60DC35712 (unknown)
@ 00007FF60DC2E748 (unknown)
@ 00007FF60DC7A560 (unknown)
@ 00007FFDEC5A4CB0 (unknown)
@ 00007FFDED59EDCB (unknown)

Detailed logs (using commit 75581bf):
the logs when run step 8:
commit_75581bf_step8.txt

the logs when run step 13:
commit_75581bf_step13.txt

The below 2 logs which is using commit 0361a59
Test.log.8.txt
Test.log.13.txt

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment
VS 2022

@Zhaojun-Liu Zhaojun-Liu added the untriaged auto added to all issues by default when created. label Dec 10, 2024
@shaod2 shaod2 added windows and removed untriaged auto added to all issues by default when created. labels Dec 10, 2024
@jskeet jskeet assigned shaod2 and unassigned jskeet Dec 10, 2024
@jskeet
Copy link
Contributor

jskeet commented Dec 10, 2024

@shaod2: I don't have significant C++ experience, and really don't have time to do anything for Protobuf beyond any vital C# work.

@shaod2
Copy link
Member

shaod2 commented Dec 10, 2024

I'm guessing this might relate to how the environment was set up. The error was that the top-level src directory was not found.

Also, could you try a released version of the test?

@Zhaojun-Liu
Copy link
Author

I'm guessing this might relate to how the environment was set up. The error was that the top-level src directory was not found.

Also, could you try a released version of the test?

@shaod2 I tried the latest release 796e49f, it failed to build due to below errors, seems the same issue as #16828.

Error copying file "C:/gitP/google/protobuf/upb/base/descriptor_constants.h" to "C:/gitP/google/protobuf/build_amd64/tmp-install-test/C:/gitP/google/protobuf/upb/base/descriptor_constants.h".
         'true' is not recognized as an internal or external command,
         operable program or batch file.

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

No branches or pull requests

3 participants