mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpiutil] Use C++23 stacktrace library on Windows (#6839)
This lets us remove the unmaintained StackWalker library and its hacky upstream_utils script. @Gold856 reported that StackWalker gives blank stacktraces: https://discord.com/channels/176186766946992128/368993897495527424/1261940029287301150. They also reported an earlier version of this PR giving the following stacktrace instead: ``` D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(18): developerRobotCpp!Robot::RobotInit+0xB6 D:\allwpilib\wpilibc\src\main\native\cpp\TimedRobot.cpp(22): wpilibcd!frc::TimedRobot::StartCompetition+0x4F D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(36): developerRobotCpp!frc::impl::RunRobot<Robot>+0xC8 D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(106): developerRobotCpp!frc::StartRobot<Robot>+0x17E D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(60): developerRobotCpp!main+0xB D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79): developerRobotCpp!invoke_main+0x39 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): developerRobotCpp!__scrt_common_main_seh+0x132 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331): developerRobotCpp!__scrt_common_main+0xE D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17): developerRobotCpp!mainCRTStartup+0xE KERNEL32!BaseThreadInitThunk+0x1D ntdll!RtlUserThreadStart+0x28 ```
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
common:linux --repo_env=BAZEL_COPTS="-Wall:-Wextra:-Werror:-gz=zlib"
|
||||
|
||||
# C++ only
|
||||
common:linux --repo_env=BAZEL_CXXOPTS="-std=c++20:-Wformat=2:-pedantic:-Wno-psabi:-Wno-unused-parameter:-fPIC:-pthread:-Wno-deprecated-enum-enum-conversion"
|
||||
common:linux --repo_env=BAZEL_CXXOPTS="-std=c++23:-Wformat=2:-pedantic:-Wno-psabi:-Wno-unused-parameter:-fPIC:-pthread:-Wno-deprecated-enum-enum-conversion"
|
||||
|
||||
# C Only
|
||||
common:linux --repo_env=BAZEL_CONLYOPTS="-Wformat=2:-pedantic:-Wno-psabi:-Wno-unused-parameter:-fPIC:-pthread"
|
||||
|
||||
@@ -2,7 +2,7 @@ common:macos --repo_env=BAZEL_COPTS="-Wall:-Wextra:-Werror:-Wno-shorten-64-to-32
|
||||
common:macos --host_per_file_copt=external/.*@-Wno-deprecated-non-prototype,-Wno-unused-function,-Wno-sign-compare
|
||||
|
||||
# C++ only
|
||||
common:macos --repo_env=BAZEL_CXXOPTS="-std=c++20:-pedantic:-fPIC:-Wno-unused-parameter:-Wno-error=deprecated-enum-enum-conversion:-Wno-missing-field-initializers:-Wno-unused-private-field:-Wno-unused-const-variable:-Wno-error=c11-extensions:-pthread:-Wno-deprecated-anon-enum-enum-conversion"
|
||||
common:macos --repo_env=BAZEL_CXXOPTS="-std=c++23:-pedantic:-fPIC:-Wno-unused-parameter:-Wno-error=deprecated-enum-enum-conversion:-Wno-missing-field-initializers:-Wno-unused-private-field:-Wno-unused-const-variable:-Wno-error=c11-extensions:-pthread:-Wno-deprecated-anon-enum-enum-conversion"
|
||||
|
||||
# C only
|
||||
common:macos --repo_env=BAZEL_CONLYOPTS="-pedantic:-fPIC:-Wno-unused-parameter:-Wno-missing-field-initializers:-Wno-unused-private-field:-Wno-fixed-enum-extension"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
common:windows --repo_env="BAZEL_COPTS=/W3:/WX"
|
||||
|
||||
# C++ options
|
||||
common:windows --repo_env="BAZEL_CXXOPTS=/EHsc:/FS:/Zc%:inline:/wd4244:/wd4267:/wd4146:/wd4996:/Zc%:throwingNew:/D_CRT_SECURE_NO_WARNINGS:/std%:c++20:/permissive-:/utf-8:/bigobj:/Zc%:__cplusplus:/Zc%:preprocessor:/wd5105"
|
||||
common:windows --repo_env="BAZEL_CXXOPTS=/EHsc:/FS:/Zc%:inline:/wd4244:/wd4267:/wd4146:/wd4996:/Zc%:throwingNew:/D_CRT_SECURE_NO_WARNINGS:/std%:c++23preview:/permissive-:/utf-8:/bigobj:/Zc%:__cplusplus:/Zc%:preprocessor:/wd5105"
|
||||
|
||||
# Remove "/D_WIN32_WINNT=0x0601"
|
||||
common:windows --repo_env="BAZEL_WIN32_WINNT="
|
||||
|
||||
@@ -23,7 +23,7 @@ def wpilib_objc_library(
|
||||
"""
|
||||
copts = copts or []
|
||||
if is_cpp:
|
||||
copts.append("-std=c++20")
|
||||
copts.append("-std=c++23")
|
||||
if include_arc:
|
||||
copts += ["-fobjc-weak", "-fobjc-arc"]
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ def header_to_dat(
|
||||
cmd += " " + include_root
|
||||
cmd += _location_helper(RESOLVE_CASTERS_DIR + casters_pickle)
|
||||
cmd += " $(OUTS)"
|
||||
cmd += " bogus c++20 ccache c++ -- -std=c++20" # TODO(pj) Does it matter what these values are?
|
||||
cmd += " bogus c++23 ccache c++ -- -std=c++23" # TODO(pj) Does it matter what these values are?
|
||||
|
||||
native.genrule(
|
||||
name = name + "." + class_name,
|
||||
|
||||
Reference in New Issue
Block a user