Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.2.0] Combined cc_shared_library cherry-picks #22321

Merged
merged 5 commits into from
May 10, 2024

Commits on May 10, 2024

  1. Generate .pdb files when building cc_shared_library targets for Windows

    This enables the functionality to generate .pdb files when building a DLL from a cc_shared_library target with the Lexan toolchain, which is already supported when using a cc_binary target.
    
    The change has been tested manually with a local cc_shared_library target, with and without the shared_lib_name attribute.
    
    I'm not exactly sure how the automated/unit tests for cc_shared_library work, but it seems like when the test targets in //third_party/bazel/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/BUILD.builtin_test are built for Windows, the pdb logic should also be executed, so if there are failures they should be caught. A test that would make sense is to check the filenames for the generated pdb files, but I don't see tests that do this for DLLs so I assume we're not doing that for Windows.
    
    PiperOrigin-RevId: 588441321
    Change-Id: I20aa6d855514d3864c7f2f4b658f279367128030
    Googler authored and fmeum committed May 10, 2024
    Configuration menu
    Copy the full SHA
    d7962ab View commit details
    Browse the repository at this point in the history
  2. Add -ffunction-sections, -fdata-sections, -gc-sections to fastbuild b…

    …uilds.
    
    This will decrease binary size for binaries built with fastbuild by ~15-17% (https://docs.google.com/spreadsheets/d/1Jy-jvrdfp3hcf5-EIAUj5Arr6-6g9y0A14sdTGZiqMM/edit?resourcekey=0-9qG_DHCYO0N-3TrRsGoYZA#gid=899160323)
    
    BEGIN_PUBLIC
    Increase memory for link actions.
    END_PUBLIC
    
    PiperOrigin-RevId: 601570607
    Change-Id: I54614de97ca8affb73fb2eece38d6671bfe6e83a
    alinas authored and fmeum committed May 10, 2024
    Configuration menu
    Copy the full SHA
    a33c822 View commit details
    Browse the repository at this point in the history
  3. Clean up cc_shared_library runfiles test

    Simplifies the test of `cc_shared_library`'s runfiles behavior using new rules_testing features, which also result in better failure messages.
    
    Also format `BUILD.builtin_test` with buildifier to simplify future contributions.
    
    Work towards bazelbuild#21833
    
    Closes bazelbuild#21880.
    
    PiperOrigin-RevId: 626315579
    Change-Id: Ib7b3d1367586ba7215132d6a9f3711f4ae0a9b09
    fmeum committed May 10, 2024
    Configuration menu
    Copy the full SHA
    64b020c View commit details
    Browse the repository at this point in the history
  4. Add pdb_file and def_file output groups to cc_shared_library

    This matches `cc_binary`'s behavior at https://github.com/bazelbuild/bazel/blob/d738910e83427d394526cbdfc8ac665027dd9196/src/main/starlark/builtins_bzl/common/cc/cc_binary.bzl#L828-L832
    
    Fixes bazelbuild#21602
    
    Closes bazelbuild#21900.
    
    PiperOrigin-RevId: 626309605
    Change-Id: I58683eaa2eedd590746e51df8c97833527c409f4
    fmeum committed May 10, 2024
    Configuration menu
    Copy the full SHA
    74ea826 View commit details
    Browse the repository at this point in the history
  5. Allow native.package_relative_label in initializers

    Work towards bazelbuild#21622
    
    RELNOTES: `native.package_relative_label` can now be used in rule initializers.
    
    Closes bazelbuild#21740.
    
    PiperOrigin-RevId: 631546734
    Change-Id: Id6eb237f0f79195b678bb954deaef071e1c45ab1
    fmeum committed May 10, 2024
    Configuration menu
    Copy the full SHA
    27e8b7a View commit details
    Browse the repository at this point in the history