build: fix MSVC ccache reporting #31813

pull vijayabhaskar78 wants to merge 1 commits into bitcoin:master from vijayabhaskar78:fix-ccache-reporting changing 4 files +63 −48
  1. vijayabhaskar78 commented at 5:54 pm on February 6, 2025: none

    Fixes #31771

    Summary

    This PR resolves the incorrect reporting of ccache usage for MSVC builds by:

    1. Removing forced compiler launcher configuration
    2. Improving status message accuracy
    3. Documenting proper MSVC+ccache workflows

    Key Changes

    • Deleted: cmake/ccache.cmake (Eliminates conflicts with user/CI configurations like sccache)
    • Updated: CMakeLists.txt status reporting
      0if(CMAKE_CXX_COMPILER_LAUNCHER)
      1  message(STATUS "Compiler launcher .............. ${CMAKE_CXX_COMPILER_LAUNCHER}")
      2else()
      3  message(STATUS "Use ccache for compiling .............. NO")
      4endif()
      
    • Added Documentation:
      • Requires: Ninja generator
      • Configure: cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
      • Use: /Z7 debug flags (not /Zi)

    Testing

    0# MSVC 2022 + Ninja
    1cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
    2cmake --build build
    3ccache -s  # Verified cache hits
    4
    5# User override test
    6cmake -B build -DCMAKE_CXX_COMPILER_LAUNCHER=sccache  # No conflicts
    
  2. Fix MSVC ccache reporting (Fixes #31771) 26a927fd80
  3. DrahtBot commented at 5:54 pm on February 6, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31813.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31665 (build: Make config warnings fatal if -DWCONFIGURE_ERROR=ON by davidgumberg)
    • #30861 (build: Enhance Ccache performance across worktrees and build trees by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. vijayabhaskar78 commented at 6:17 pm on February 6, 2025: none
    @hebasto @ben-kaufman Can you help me regarding this PR please
  5. DrahtBot commented at 6:36 pm on February 6, 2025: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/36804595890

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  6. DrahtBot added the label CI failed on Feb 6, 2025
  7. in doc/build-windows-msvc.md:1 in 26a927fd80


    Prabhat1308 commented at 6:38 pm on February 6, 2025:
    There are a lot of changes in this file that are not required . Adhere to not changing the code if not necessary. Please remove the extra whitespaces and syntax highlighting.

    Prabhat1308 commented at 6:39 pm on February 6, 2025:
    Similar irrelevant changes introduced in this file .
  8. pinheadmz commented at 7:22 pm on February 6, 2025: member
    @vijayabhaskar78 posting external social media links isn’t really appropriate here.
  9. hebasto commented at 8:11 pm on February 6, 2025: member

    @vijayabhaskar78

    Testing

    0cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
    

    All CI job failed. Does this work locally for you?

    What are cache hit rates in the following scenarios:

    • different build trees
    • different git work-trees

    ?

    (for more details, please see #30811 (comment) and #30861)

  10. fanquake renamed this:
    Fix MSVC ccache reporting (Fixes #31771)
    build: fix MSVC ccache reporting
    on Feb 7, 2025
  11. maflcko commented at 10:26 am on February 7, 2025: member

    Looks like there are several general problems:

    • The summary is just AI generated to repeat the code changes (which are also AI generated?). This is problematic, because if someone wanted to look at AI summaries or generations, they could just ask an LLM themselves.
    • The summary repeats the code changes. This is problematic, because the code changes should be explained: Why they are the correct approach (in light of alternatives) and why they fix the problem.
    • All tests are failing. This is problematic, because contributors are expected to at least compile their changes locally before opening a pull request.

    My recommendation would be to close this pull and then start from scratch, ensuring that the changes pass locally on Linux and Windows and yield the expected result. Then, you should explain the changes in the commit message. Finally, you can open a new pull request.

  12. fanquake closed this on Feb 10, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-22 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me