Apply CMake best practices and remove stale references#1416
Conversation
34e4948 to
790fdd0
Compare
9a5a166 to
2feeb94
Compare
PR microsoft#1416 inadvertently regressed PR microsoft#1415 by removing -fno-finite-math-only from the three Unix REL_FLAGS branches and adding -Wno-nan-infinity-disabled to silence the Clang diagnostic. That left release builds using -ffast-math without preserving the NaN/Inf semantics needed by nlohmann::json and SQLite paths. Remove -ffast-math entirely from the GCC, AppleClang, and generic Clang release flags rather than relying on -fno-finite-math-only to partially undo it. This SDK is not floating-point compute-bound; its hot paths are string, Bond/JSON serialization, HTTP I/O, and SQLite reads/writes. Avoiding -ffast-math: - preserves std::isnan/std::isinf behavior for JSON and storage code, - avoids compiler/runtime fast-math side effects such as x86 GCC's crtfastmath.o changing MXCSR FTZ/DAZ behavior process-wide, and - aligns with SQLite's guidance to avoid fast-math. This subsumes microsoft#1415's partial mitigation and aligns with microsoft#1392's intent, extended to GCC because GCC fast-math has the same broad assumptions and runtime side effects. Also remove -Wno-nan-infinity-disabled because the warning should not be suppressed once the cause is gone. Validation: - CMake Release build of UnitTests on macOS arm64 (AppleClang 21). - UnitTests passed on macOS arm64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b34147f to
0e8018c
Compare
Keep PR microsoft#1416 focused by reverting the broad MSBuild project metadata cleanup now carried by a separate branch. Files changed: - Solutions/Clienttelemetry/Clienttelemetry.vcxitems - examples/cpp project and filter files - lib/pal and lib/tracing shared item files - tests/googletest filter metadata - third_party/Solutions/zlib/vc14/zlibvc.vcxproj - tools/ports/mstelemetry/v142-build.patch Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
17b72ca to
1d09c10
Compare
- Modernize CMakeLists.txt: flatten nesting, deduplicate, use consistent quoting and variable patterns - Remove stale header references from vcxproj and vcxitems files - Simplify test CMakeLists.txt files - Fix CMake conventions in packaging scripts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the before.targets toolset selection deterministic on newer Visual Studio hosts, but only set the MIP props fallback when a consumer has not already chosen a toolset. While addressing the MSBuild review comments, also point the optional module test conditions and source paths at the real lib/modules locations and use CPACK_PACKAGE_FILE_NAME for the RPM status message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Quote the optional ECS test.json configure_file input and output paths so CMake handles source or build directories that contain spaces. Files changed: - tests/functests/CMakeLists.txt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR microsoft#1416 inadvertently regressed PR microsoft#1415 by removing -fno-finite-math-only from the three Unix REL_FLAGS branches and adding -Wno-nan-infinity-disabled to silence the Clang diagnostic. That left release builds using -ffast-math without preserving the NaN/Inf semantics needed by nlohmann::json and SQLite paths. Remove -ffast-math entirely from the GCC, AppleClang, and generic Clang release flags rather than relying on -fno-finite-math-only to partially undo it. This SDK is not floating-point compute-bound; its hot paths are string, Bond/JSON serialization, HTTP I/O, and SQLite reads/writes. Avoiding -ffast-math: - preserves std::isnan/std::isinf behavior for JSON and storage code, - avoids compiler/runtime fast-math side effects such as x86 GCC's crtfastmath.o changing MXCSR FTZ/DAZ behavior process-wide, and - aligns with SQLite's guidance to avoid fast-math. This subsumes microsoft#1415's partial mitigation and aligns with microsoft#1392's intent, extended to GCC because GCC fast-math has the same broad assumptions and runtime side effects. Also remove -Wno-nan-infinity-disabled because the warning should not be suppressed once the cause is gone. Validation: - CMake Release build of UnitTests on macOS arm64 (AppleClang 21). - UnitTests passed on macOS arm64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid carrying a confusing note about warning flags that are not used, and keep CMakeLists.txt focused on active compiler settings. Files changed: - CMakeLists.txt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1d09c10 to
1cfe326
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (2)
tests/unittests/CMakeLists.txt:84
- The appended privacyguard test source paths are unquoted. If
${CMAKE_SOURCE_DIR}contains spaces, these will be split into multiple arguments and break the build. Quote each${CMAKE_SOURCE_DIR}/...path in thislist(APPEND SRCS ...)block.
if(EXISTS "${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/" AND BUILD_PRIVACYGUARD)
add_definitions(-DHAVE_MAT_PRIVACYGUARD)
list(APPEND SRCS
${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/tests/unittests/InitializationConfigurationTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/tests/unittests/PrivacyConcernEventTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/tests/unittests/PrivacyConcernMetadataProviderTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/tests/unittests/PrivacyGuardTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/privacyguard/tests/unittests/SystematicSamplerTests.cpp
tests/unittests/CMakeLists.txt:96
- The sanitizer test source paths added here are unquoted. If
${CMAKE_SOURCE_DIR}contains spaces, the paths can be mis-parsed as multiple arguments. Quote each${CMAKE_SOURCE_DIR}/...entry when appending toSRCS.
if(EXISTS "${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/" AND BUILD_SANITIZER)
list(APPEND SRCS
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerJwtTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerProviderTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerSitePathTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerStringUtilsTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerUrlTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SanitizerTrieTests.cpp
${CMAKE_SOURCE_DIR}/lib/modules/sanitizer/tests/unittests/SPOPasswordTests.cpp
Copilot review on PR microsoft#1416 flagged 7 unquoted ${CMAKE_SOURCE_DIR}/... paths inside list(APPEND SRCS ...) calls. CMake splits unquoted arguments on whitespace, so a checkout path containing spaces (very common on Windows: C:\Users\First Last\source\...) would fragment a single source path into multiple list elements and the test wouldn't compile. Quote every ${CMAKE_SOURCE_DIR}/.../*.cpp path inside list(APPEND SRCS ...) in both tests/unittests/CMakeLists.txt and tests/functests/CMakeLists.txt (23 paths total, including the privacyguard + sanitizer blocks Copilot didn't cite but that share the same hazard). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed in 1de44ae: quoted all 23 ${CMAKE_SOURCE_DIR}/... paths inside list(APPEND SRCS ...) blocks across both ests/unittests/CMakeLists.txt and ests/functests/CMakeLists.txt (including the privacyguard + sanitizer blocks not explicitly flagged but sharing the same hazard). Re-requesting Copilot review. |
Copilot review on PR microsoft#1416 flagged that mapping VisualStudioVersion >= 18.0 to PlatformToolset v145 is a guess: VS 2025/2026/etc. has not shipped, the toolset moniker for that release may differ, and pinning to a non-existent toolset name causes MSBuild to fail early with "unknown PlatformToolset" on any machine that does pick up that VS version. Drop the v145 mapping from both before.targets and build.MIP.props. Future VS versions fall through to the v141 fallback (same behavior as before PR microsoft#1416, just one less wrong-toolset-name failure mode). Add explicit mappings for new toolsets as they actually ship. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed Copilot round 2: dropped the speculative |
Pure build/project cleanup
CMake improvements (3 files)
Cleanup / CMake hygiene
LANGUAGES C CXXto the top-levelproject()callmessage(STATUS ...)instead of baremessage(...)message(FATAL_ERROR, ...)comma bug (invalid CMake syntax)if(EXISTS ...)quoting inlib/,tests/functests/, andtests/unittestsconfigure_file(... COPYONLY)Solutions/before.targetsandSolutions/build.MIP.propsMATSDK_API_VERSIONfrom 3.4 to 3.10 to match recent releases-fPICflags preservedinclude_directoriesentryVisual Studio project cleanup (8 files)
targetver.h(SampleCpp, SampleCppMini)LogManagerV1.hpp(Shared.vcxitems)MockILocalStorageReader.hpp(UnitTests.vcxproj)SanitizerBaseTests.cpp(FuncTests.vcxproj)Packaging