-
Notifications
You must be signed in to change notification settings - Fork 240
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
inf2cat.exe Exited with Code -2 and Warnings Treated as Errors Despite Configuration #3944
Comments
Can you please repro this with the "/bl" option? This will give a detailed output exactly what is happening. |
Note: Docs are here: |
Hi @Alan-Jowett , just checking in to see if you had a chance to review the compressed .zip file with the .binlog. Please let me know if you need any additional details to help with troubleshooting. Thanks! |
I will take a look today. My apologies for the delay. |
After clicking through the first error message it points to: and: Which says that the file contains ANSI characters that can't be represented in the current code page (I think). |
Can you try switching these files from ANSI to UTF-8 and seeing if that fixes it? |
Actually, it seems like this might fix it: diff --git a/.gitattributes b/.gitattributes
index fd2f383b..80a082e9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -16,3 +16,6 @@
# Mark generated corpus files as binary.
**/corpus/** -text
+
+*.c* text encoding=utf-8
+*.h* text encoding=utf-8
\ No newline at end of file To try this out:
At this point all the files should have the UTF-8 byte order marker (aka BOM) and be UTF-8 encoded. |
If this fixes it, let me know and we can spin up a PR with this change. |
Thank you so much for all the time and effort you put into helping me troubleshoot this issue. With your guidance, I was finally able to complete the build successfully. The process finished with 10 warnings but no errors, and everything seems to be functioning as expected now. I really appreciate your support! |
Will be fixed by serge1/ELFIO#144 |
Describe the bug
I'm experiencing a build error while attempting to compile the eBPF for Windows project using Visual Studio 2022. The errors persist despite disabling the warnings-as-errors setting in the project properties and using the /p:TreatWarningsAsErrors=false flag in the msbuild command.
OS information
Operating System: Windows 11
Visual Studio Version: Visual Studio 2022 (17.11.2)
Windows SDK Version: 10.0.22621.755
Windows Driver Kit Version: 10.0.22621.382
CMake Version: 3.30
Steps taken to reproduce bug
Clone the
ebpf-for-windows
repository with submodules.git clone --recurse-submodules https://github.com/microsoft/ebpf-for-windows.git
Run the initialization script:
.\scripts\initialize_ebpf_repo.ps1
Open Developer Command Prompt for VS 2022.
Run the following build command:
msbuild /m /p:Configuration=Debug /p:Platform=x64 /p:TreatWarningsAsErrors=false ebpf-for-windows.sln
Expected behavior
The build process should complete successfully without errors. After disabling "Treat Warnings as Errors" in Visual Studio project settings and adding the /p:TreatWarningsAsErrors=false flag in the msbuild command, no warnings should be treated as errors during the build.
Actual outcome
The build process fails despite setting the flags to not treat warnings as errors. The errors encountered are related to inf2cat.exe exiting with code -2 and warnings still being treated as errors in elf_types.hpp. Here are the specific errors:
C:\Program Files (x86)\Windows Kits\10\build\10.0.22621.0\WindowsDriver.common.targets(1362,5): error MSB6006: “inf2cat.exe”已退出,代码为 -2。 [c:\Users\17204\ebpf-for-windows\netebpfext\sys\netebpfext.vcxproj]
c:\Users\17204\ebpf-for-windows\external\ebpf-verifier\external\bpf_conformance\external\elfio\elfio\elf_types.hpp(1,1): error C2220: 以下警告被视为错误 [c:\Users\17204\ebpf-for-windows\tools\bpf2c\bpf2c.vcxproj]
Additional details
and I have re-run the msbuild command as you requested and generated the BuildOutput.log.I'm attaching the log file for your review. Thank you for your assistance
The text was updated successfully, but these errors were encountered: