Open RobbeBryssinck opened 6 months ago
try this patch. https://github.com/xmake-io/xmake-repo/pull/3706
try this patch. #3706
Isn't this already in the "main repo"? As in, if I were to clean my repository cache, run xrepo update-repo
, and then build again, shouldn't it build already with that patch? Because I tried that already.
Could you please provide a minimal reproduction that will help us pinpoint the root cause? This will assist in narrowing down the issue more effectively.
The issue can be reproduced by adding the gamenetworkingsockets
to a sample project (like, say, this one: https://github.com/xmake-io/xmake/tree/master/tests/projects/c%2B%2B/console). I modified the xmake.lua
file of this project to look like this:
add_rules("mode.debug", "mode.release")
add_requires("gamenetworkingsockets")
target("test")
set_kind("binary")
add_files("src/*.cpp")
add_deps("gamenetworkingsockets")
try
xrepo update-repo
xrepo remove --all abseil
xmake f -cvD
This produces a long list of compilation errors that boils down to string_view not being able to compile:
...
[ 15%]: compiling.proto.release build_7c0aa346\.gens\gns\windows\x64\release\rules\protobuf\src\common\steamnetworkingsockets_messages_certs.pb.cc
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe -c -nologo -O2 -fp:fast -MT -Iinclude -Isrc -Isrc\common -Isrc\tier0 -Isrc\tier1 -Isrc\vstdlib -Isrc\steamnetworkingsockets -Isrc\steamnetworkingsockets\clientlib -Isrc\public -DWIN32 -D_WINDOWS -DSTEAMNETWORKINGSOCKETS_STATIC_LINK -DOPENSSL_USE_STATIC_LIBS -DSTEAMNETWORKINGSOCKETS_CRYPTO_25519_OPENSSL -DSTEAMNETWORKINGSOCKETS_CRYPTO_VALVEOPENSSL -DOPENSSL_HAS_25519_RAW -DVALVE_CRYPTO_ENABLE_25519 -DGOOGLE_PROTOBUF_NO_RTTI -DVALVE_CRYPTO_25519_OPENSSL -DCRYPTO_DISABLE_ENCRYPT_WITH_PASSWORD -DENABLE_OPENSSLCONNECTION /EHsc -external:W0 -external:IC:\Users\pc\AppData\Local\.xmake\packages\p\protobuf-cpp\26.1\6ffa349d1b5f4047a086e95e2d5e70ed\include -external:W0 -external:IC:\Users\pc\AppData\Local\.xmake\packages\a\abseil\20240116.1\f1d1419501d24c1cbe78f072955b1d15\include -external:W0 -external:IC:\Users\pc\AppData\Local\.xmake\packages\o\openssl\1.1.1-w\61d86fc2f8cc4e60a5bef5bc478c3a92\include -DNDEBUG -Ibuild_7c0aa346\.gens\gns\windows\x64\release\rules\protobuf\src\common -Fobuild_7c0aa346\.objs\gns\windows\x64\release\gens\rules\protobuf\src\common\steamnetworkingsockets_messages_certs.pb.cc.obj build_7c0aa346\.gens\gns\windows\x64\release\rules\protobuf\src\common\steamnetworkingsockets_messages_certs.pb.cc
steamnetworkingsockets_messages_certs.pb.cc
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\string_view(12): warning STL4038: The contents of <string_view> are available only with C++17 or later.
C:\Users\pc\AppData\Local\.xmake\packages\a\abseil\20240116.1\f1d1419501d24c1cbe78f072955b1d15\include\absl/strings/string_view.h(53): error C2039: 'string_view': is not a member of 'std'
...
please add set_languages("c++17")
,
https://github.com/xmake-io/xmake-repo/issues/3705#issuecomment-2041039294
or add_requireconfs("**.abseil", {configs = {cxx_standard = "14"}})
I'm assuming these configuration options would be added in my project's configuration, and not the gamenetworkingsockets package configuration? These options don't work, even if cxx_standard
is set to "17"
. I get the same compilation errors.
add to your gamenetworkingsockets package's project xmake.lua
Xmake Version
2.8.9
Operating System Version and Architecture
Windows 11, Ubuntu 22.04
Describe Bug
Linking to
protobuf-cpp
fails.I am guessing it is related to the C++ version not being set correctly (protobuf or abseil using C++11 causing strings compilation to fail). Seems there are other packages like
grpc
that are running into similar issues ( #3705 ).Sometimes, compilation seems to continue, only for it to later fail as the protobuf files are not present, resulting in errors such as the following:
Expected Behavior
protobuf
and/or its dependencies should use the correct C++ version to compile.Project Configuration
The latest version of
gamenetworkingsockets
is used (v1.4.1
).Additional Information and Error Logs