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

Warnings as errors #938

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

HifiExperiments
Copy link
Member

@HifiExperiments HifiExperiments commented Apr 16, 2024

Closes #930

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo
NGI Zero Logo

@HifiExperiments
Copy link
Member Author

this one's failing with some kind of cmake error, but my changes to cmake were very minor...

@daleglass
Copy link
Contributor

this one's failing with some kind of cmake error, but my changes to cmake were very minor...

It's failing in glslang, it's possible the warnings as errors setting is being applied to a dependency that's building with warnings?

@HifiExperiments
Copy link
Member Author

ah that makes sense. should we pass a different set of flags to dependencies? or just only set this flag later?

@daleglass
Copy link
Contributor

I think setting it later might work?

Copy link
Contributor

@daleglass daleglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested changes set the options in CMake instead of the environment. This stops the flags from propagating to vcpkg and breaking the dependencies.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@HifiExperiments HifiExperiments changed the base branch from protocol_changes to master October 21, 2024 17:48
@HifiExperiments HifiExperiments changed the base branch from master to protocol_changes January 14, 2025 00:46
@HifiExperiments HifiExperiments changed the base branch from protocol_changes to master January 14, 2025 00:47
@HifiExperiments
Copy link
Member Author

HifiExperiments commented Jan 16, 2025

okie dokie! just a few more errors:

Windows (fixed):

2025-01-14T01:12:04.9462247Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(155,1): error C2220: the following warning is treated as an error (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.0693610Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(154): message : while compiling class template member function 'void std::basic_ostream<char,std::char_traits<char>>::_Osfx(void)' (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1363854Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(118): message : see reference to function template instantiation 'void std::basic_ostream<char,std::char_traits<char>>::_Osfx(void)' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1534907Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(640): message : see reference to class template instantiation 'std::basic_ostream<char,std::char_traits<char>>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1850661Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(155,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]


2025-01-14T01:12:14.5853011Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1296,1): error C2220: the following warning is treated as an error (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5858137Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1286): message : while compiling class template member function 'void std::vector<geometry::Vec,std::allocator<geometry::Vec>>::_Reallocate_exactly(const unsigned __int64)' (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5865921Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1363): message : see reference to function template instantiation 'void std::vector<geometry::Vec,std::allocator<geometry::Vec>>::_Reallocate_exactly(const unsigned __int64)' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5874185Z D:\a\overte\overte\libraries\shared\src\shared\Shapes.h(36): message : see reference to class template instantiation 'std::vector<geometry::Vec,std::allocator<geometry::Vec>>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.6131198Z D:\a\overte\overte\libraries\shared\src\shared\Shapes.h(61): message : see reference to class template instantiation 'geometry::Solid<N>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.6140566Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1296,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]

Ubuntu 20.04, amd64 (fixed):

In file included from /__w/overte/overte/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp:37:
/__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/crashpad_info.h:223:18: error: multi-character character constant [-Werror=multichar]
  223 |     kSignature = 'CPad',

Ubuntu 22.04, aarch64 (fixed):

/__w/overte/overte/libraries/octree/src/OctreePacketData.cpp: In static member function 'static int OctreePacketData::unpackDataFromBytes(const unsigned char*, QSet<QString>&)':
/__w/overte/overte/libraries/octree/src/OctreePacketData.cpp:831:11: error: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'class QString' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
  831 |     memcpy(resultVector.data(), dataBytes, length * sizeof(QString));

I'm not sure about the Window's issues. The second one is an issue in crashpad. I'll take a look at the third one.

@HifiExperiments
Copy link
Member Author

HifiExperiments commented Jan 18, 2025

(fixed) new windows error:

2025-01-18T05:48:06.6445109Z D:\a\overte\overte\libraries\networking\src\SockAddr.cpp(25,10): fatal error C1083: Cannot open include file: 'netinet/in.h': No such file or directory [D:\a\overte\overte\build\libraries\networking\networking.vcxproj]

offending lines:

#ifdef WIN32
#include <winsock2.h>
#include <WS2tcpip.h>
#else
#include <netinet/in.h>
#endif

@HifiExperiments
Copy link
Member Author

HifiExperiments commented Jan 19, 2025

(fixed) new linux issue inside crashpad? I don't think anything changed about the paths...

In file included from /__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/annotation_list.h:21,
                 from /__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/crashpad_info.h:21,
                 from /__w/overte/overte/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp:37:
/__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/annotation.h:30:10: fatal error: util/synchronization/scoped_spin_guard.h: No such file or directory
   30 | #include "util/synchronization/scoped_spin_guard.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@HifiExperiments HifiExperiments added the server If used for a Pull Request, server packages are going to be built. label Jan 19, 2025
@HifiExperiments
Copy link
Member Author

HifiExperiments commented Jan 19, 2025

on the server, an interesting one from tbb (fixed):

In member function 'store',
    inlined from 'store' at /usr/include/c++/12/atomic:104:20,
    inlined from 'abort_all_relaxed' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:431:53,
    inlined from 'abort_all' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:414:26,
    inlined from 'destroy' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:447:24,
    inlined from '__dt_base ' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/market_concurrent_monitor.h:102:16,
    inlined from '__dt_base ' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/market.h:55:7:
/usr/include/c++/12/bits/atomic_base.h:464:25: error: '__atomic_store_1' writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  464 |         __atomic_store_n(&_M_i, __i, int(__m));

for this one we might just have to add -Wno-error=stringop-overflow?

@HifiExperiments HifiExperiments added server If used for a Pull Request, server packages are going to be built. and removed server If used for a Pull Request, server packages are going to be built. labels Jan 19, 2025
@HifiExperiments HifiExperiments added server If used for a Pull Request, server packages are going to be built. and removed server If used for a Pull Request, server packages are going to be built. labels Jan 20, 2025
@HifiExperiments HifiExperiments added server If used for a Pull Request, server packages are going to be built. and removed server If used for a Pull Request, server packages are going to be built. labels Jan 20, 2025
@HifiExperiments HifiExperiments added server If used for a Pull Request, server packages are going to be built. needs CR This pull request needs to be code reviewed needs QA This pull request needs to be tested and removed server If used for a Pull Request, server packages are going to be built. work in progress Do not merge yet labels Jan 20, 2025
@HifiExperiments
Copy link
Member Author

success!! this is ready for testing and review

Copy link
Member

@ksuprynowicz ksuprynowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
All looks good, I have just one question about possible protocol change

domain-server/src/DomainServer.cpp Show resolved Hide resolved
@ksuprynowicz
Copy link
Member

Surprisingly I tested Interface from this version and it does seem to work on regular servers, but indeed if there's change in protocol it's best to target it to protocol_changes.

@HifiExperiments
Copy link
Member Author

yeah, the problem only affects tags, which no one is using

I’ll retarget this, since I’m working on some other protocol changes, hopefully it won’t be too long before we can merge back to master

@HifiExperiments HifiExperiments changed the base branch from master to protocol_changes January 23, 2025 07:29
@HifiExperiments HifiExperiments added CR approved This pull request has been successfully code reviewed QA approved This pull request has been successfully tested and removed needs CR This pull request needs to be code reviewed needs QA This pull request needs to be tested labels Jan 23, 2025
@HifiExperiments
Copy link
Member Author

retargeted to protocol_changes!

this is ready to merge from my end if it looks good to everyone!

@HifiExperiments HifiExperiments merged commit c0ef3ac into overte-org:protocol_changes Jan 24, 2025
21 checks passed
@HifiExperiments HifiExperiments deleted the warnings branch January 24, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR approved This pull request has been successfully code reviewed Linux NLnet protocol change QA approved This pull request has been successfully tested server If used for a Pull Request, server packages are going to be built. Windows
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Maintenence: Fix remaining blocking warnings and turn on warnings-as-errors
4 participants