Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazelbuild/rules_cc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.13
Choose a base ref
...
head repository: bazelbuild/rules_cc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.2.14
Choose a head ref
  • 10 commits
  • 22 files changed
  • 9 contributors

Commits on Oct 29, 2025

  1. PostMark: Implement the postmark attribute in the cc_binary rule.

    This is not available in Bazel at the moment.
    
    PiperOrigin-RevId: 825562421
    Change-Id: Ib77c80eca0f76c4177e5ed7741846e65dacf46f7
    bigelephant29 authored and copybara-github committed Oct 29, 2025
    Configuration menu
    Copy the full SHA
    01c27aa View commit details
    Browse the repository at this point in the history
  2. Support prefer_pic_for_opt_binaries in linux auto-detecting toolchain

    Copybara Import from #456
    
    BEGIN_PUBLIC
    Support prefer_pic_for_opt_binaries in linux auto-detecting toolchain (#456)
    
    See the demo project [example.zip](https://github.com/user-attachments/files/21706101/example.zip) for reproduction.
    
    Without this fix, `foo.cc` is compiled twice (once PIC, once non-PIC).  With this fix, it is correctly only compiled once because the `.bazelrc` requests `build --features=prefer_pic_for_opt_binaries`.
    
    Closes #456
    END_PUBLIC
    
    COPYBARA_INTEGRATE_REVIEW=#456 from jwnimmer-tri:prefer_pic_for_opt_binaries ac8ec34
    PiperOrigin-RevId: 825651000
    Change-Id: I972d2bc2600268f32296c84412162f2874cc0eaa
    jwnimmer-tri authored and copybara-github committed Oct 29, 2025
    Configuration menu
    Copy the full SHA
    6dd21be View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2025

  1. Add new_objc_provider to rules_cc.

    Motivation: https://buildkite.com/bazel/rules-swift-swift/builds/6565#019a3382-00de-4df8-a9f7-56e425fab10c
    
    This change exposes `new_objc_provider` to support compatibility with Bazel 6.
    
    In Bazel 7+, `new_objc_provider` is equivalent to `ObjcInfo`.
    
    PiperOrigin-RevId: 826025189
    Change-Id: I951f3eb7c1bafab2ff3eec8f0f45e02c499ccf83
    comius authored and copybara-github committed Oct 30, 2025
    Configuration menu
    Copy the full SHA
    b05d305 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2025

  1. fix dynamic library .pyd support

    * should address the example listed in #17117
    * related to #501
    * needed to fix pybind/pybind11_bazel#124
    
    Closes #27434.
    
    PiperOrigin-RevId: 826451549
    Change-Id: Ib649bb2e38e057a1a4de6b660f41d4dd13192e06
    Mizux authored and copybara-github committed Oct 31, 2025
    Configuration menu
    Copy the full SHA
    5a09443 View commit details
    Browse the repository at this point in the history
  2. Add cc_import.defines to rules_cc.

    Prerequisite for merging the rest of #25690
    
    PiperOrigin-RevId: 826546324
    Change-Id: Ie0a1d60c0db5453815c083c3b7c09ea4ebd94aea
    keith authored and copybara-github committed Oct 31, 2025
    Configuration menu
    Copy the full SHA
    9b9efed View commit details
    Browse the repository at this point in the history
  3. [4/5] support C++20 Modules, support one phase compilation

    I split the XXL PR bazelbuild/bazel#19940 into several small patches.
    This is the fourth patch of Support C++20 Modules, which supports one phase compilation.
    
    ## Changes of build graph
    First, files are scanned, resulting in the creation of `.ddi` files. If the compiler being used is Clang, the tool `clang-scan-deps` is employed.
    
    Next, the generated `.ddi` files are aggregated into a `.CXXModules.json` file using the `aggregate-ddi` tool.
    
    Following this, the `.CXXModules.json` file, along with the `.ddi` files, is used to generate `.modmap` files through the `generate-modmap` tool.
    
    Finally, the source files are compiled into object files. If a file is a module interface, a corresponding module file is produced as a byproduct.
    
    The following diagram illustrates the scanning process.
    ```
                  ┌────────┐                  ┌────────┐                  ┌────────┐
                  │foo.cppm│                  │bar.cppm│                  │main.cc │
                  └────┬───┘                  └────┬───┘                  └────┬───┘
                       │  c++-module-deps-scanning │                           │
                       │                           │                           │
                  ┌────▼───┐                  ┌────▼───┐                  ┌────▼───┐
                  │foo.ddi │                  │bar.ddi │                  │main.ddi│
                  └────┬───┘                  └────┬───┘                  └────┬───┘
                       │                           │                           │
                       └───────────────────────────┼───────────────────────────┘
                                                   │aggregate-ddi
                                          ┌────────▼───────────┐
                                          │demo.CXXModules.json│
                                          └────────────────────┘
    ```
    
    The following diagram illustrates the compile process of `foo.cppm`.
    ```
                                                        ┌────────────────────┐
                                                        │demo.CXXModules.json│
                                                        └─────┬──────────────┘
                                                              │
                                                              │
                                            ┌───────┐         │          ┌───────────┐
                                         ┌─►│foo.ddi├─────────┤          │ bar.cppm  │
                                         │  └───────┘         │          └─────┬─────┘
                                         │                    │                │
                                         │                    │                │
                                         │                    │                │
                c++-module-deps-scanning │                    │                │
          ┌────────┐                     │  ┌───────┐   ┌─────▼────┐      ┌────▼─────┐
          │foo.cppm├─────────────────────┴─►│foo.d  │   │foo.modmap│      │ bar.pcm  │
          └───┬────┘                        └──┬────┘   └────┬─────┘      └────┬─────┘
              │                                │             │                 │
              │                                │             │                 │
              │◄───────────────────────────────┴─────────────┴─────────────────┘
              │ c++20-module-compile
     ┌────────▼─────────┐
     │ foo.pcm && foo.o │
     └──────────────────┘
    ```
    
    ## Changes of compile
    
    I modified the CppCompileAction to include the relevant context, inputs, and outputs.
    
    Context: Module files and `.CXXModules.json` files
    Inputs: Module files, `.modmap` file, and `.modmap.input` file
    Outputs: Module files and `.CXXModules.json` files
    The primary difference in CppCompileAction is the addition of the `computeUsedCpp20Modules` function.
    
    The restart mechanism is utilized; if the necessary C++20 Modules files are not ready during compilation, the current compilation will exit and wait for an appropriate time to recompile.
    
    Closes #22553.
    
    PiperOrigin-RevId: 826606472
    Change-Id: I7548ebfbf71a1faaa5d08317429a1e77e2454b54
    PikachuHyA authored and copybara-github committed Oct 31, 2025
    Configuration menu
    Copy the full SHA
    5c3e987 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2025

  1. Fix C++20 module compilation

    The merge of C++20 module support in 5c3e987 wasn't covered by tests and requires a number of fixes so that the test case in Bazel's `cc_integration_test` can pass.
    
    Closes #511
    
    COPYBARA_INTEGRATE_REVIEW=#511 from fmeum:c++20-modules 716b9be
    PiperOrigin-RevId: 827424640
    Change-Id: Iff433f2a9ec0b8ad9585805f7df7a86297731b92
    fmeum authored and copybara-github committed Nov 3, 2025
    Configuration menu
    Copy the full SHA
    a8f6a92 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2025

  1. Fix bzl_library deps for //cc/common

    Copybara Import from #513
    
    BEGIN_PUBLIC
    Fix bzl_library deps for `//cc/common` (#513)
    
    Broken by b81a4f4
    
    Closes #513
    END_PUBLIC
    
    PiperOrigin-RevId: 827898310
    Change-Id: I72f929c48cac16911ae23e8ec6d6a9d1f14d51ca
    hvadehra authored and copybara-github committed Nov 4, 2025
    Configuration menu
    Copy the full SHA
    693fd32 View commit details
    Browse the repository at this point in the history
  2. Fix bzl_library deps for //cc/common:cc_helper_bzl

    PiperOrigin-RevId: 827920142
    Change-Id: Ibfc68d332f13838759e2c8f35f7eb972995f6fec
    hvadehra authored and copybara-github committed Nov 4, 2025
    Configuration menu
    Copy the full SHA
    b5a6559 View commit details
    Browse the repository at this point in the history
  3. Factor out function should_create_test_dwp_for_statically_linked_test

    PiperOrigin-RevId: 827968328
    Change-Id: Ibb35c4aa4ae13a01fed8e7419df1b3f7942d8630
    Googler authored and copybara-github committed Nov 4, 2025
    Configuration menu
    Copy the full SHA
    285fdce View commit details
    Browse the repository at this point in the history
Loading