Commit Graph

591 Commits

Author SHA1 Message Date
Fabian Meumertzheim 8395ec0172 Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/263
BEGIN_PUBLIC
Copybara import of the project:

--
82e44f3c47 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Copy over runfiles library from Bazel

The runfiles library can be maintained independently of Bazel releases and bazel_tools can refer to it via an alias.

--
885d333d55 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Switch to new include path and namespace

--
b8cd815963 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Fix CI

--
41b7d48ed8 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Silence warnings

--
b97a30e8bb by Fabian Meumertzheim <fabian@meumertzhe.im>:

Remove per_file_copt

END_PUBLIC

PiperOrigin-RevId: 697942902
Change-Id: I10a6c9baf0464722fca026db99cf572acfd159f1
2024-11-19 02:58:45 -08:00
Grzegorz Lukasik 4db02b76c9 Removed unused local variable
Copybara Import from https://github.com/bazelbuild/rules_cc/pull/276

BEGIN_PUBLIC
Removed unused local variable (#276)

Closes #276
END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/276 from hauserx:unused_msvc_vars 72454acb13
PiperOrigin-RevId: 697918518
Change-Id: I88fa8c6836d62cfcbc38818a4241fb623ebc7ae6
2024-11-19 01:23:42 -08:00
Yun Peng 475a3539c4 Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/275
BEGIN_PUBLIC
Copybara import of the project:

--
e4857939bd by Yun Peng <pcloudy@google.com>:

Use full path for dirname and basename in osx_cc_wrapper.sh.tpl

Context: https://github.com/bazelbuild/rules_rust/pull/2998

END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/275 from bazelbuild:meteorcloudy-patch-4 e4857939bd
PiperOrigin-RevId: 697557587
Change-Id: I6ceb3d5f0fd747acb758926750fa48493edbdf3e
2024-11-18 02:54:44 -08:00
Copybara-Service a0e347f493 Merge pull request #272 from fhanau:felix/clang-cl-masm-revert
PiperOrigin-RevId: 696878198
Change-Id: Ib50f61a9c0e5d56b049d25a913bf7ada3ee81ba7
2024-11-15 07:16:24 -08:00
Felix Hanau c5a0333261 Use clang-cl assembler in clang-cl toolchain again
This essentially reverts bazelbuild/bazel#23337 now that the toolchain
configuration has been moved here. clang-cl does support assembly just like
other clang variants and unlike MASM supports assembly using native AT&T syntax
as with regular clang. MSVC-style assembly requires using MASM, which continues
to be available in the MSVC toolchain.

This has previously been discussed in bazelbuild/bazel#24152 and reverted for
Bazel 7.4.1 in bazelbuild/bazel#24211. Ideally, we'd want to have some mechanism
to make assembler selection configurable and support several kinds of asm syntax
in the future.
2024-11-11 15:00:01 -05:00
Googler fe7ca631ab Automated rollback of commit 0640261093.
*** Reason for rollback ***

Breaks cc_builtin_tests

*** Original change description ***

Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/257

BEGIN_PUBLIC
Copybara import of the project:

--
12a8bd59af by Fabian Meumertzheim <fabian@meumertzhe.im>:

Move static library validation helper to `ar_files`

It doesn't need to be staged for every compile or link action. The action that uses it stages `all_files`.

END_PUBLIC

***

PiperOrigin-RevId: 695300596
Change-Id: If10c95c1867716c82a09ad3acdfd479beedcc6c5
2024-11-11 05:50:19 -08:00
Googler 1698d2bf3a Apply external repo transforms to all migrated files
This ensures that markdown files also have //third_party/* labels changed to external-friendly @foo// labels.

PiperOrigin-RevId: 694229457
Change-Id: I7f3bd56f0a196112a82159d6f47f8285049fc324
2024-11-07 13:29:51 -08:00
Ivo List 28cf2e8160 Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/269
BEGIN_PUBLIC
Copybara import of the project:

--
0c245a456a by Ivo List <ilist@google.com>:

Revert "Remove cc_proto_library from defs.bzl"

This reverts commit b15fed2409.

--
d4311f4bdd by Ivo List <ilist@google.com>:

Move back WORKSPACE.bzlmod (unrevert)

--
e62ddd085a by Ivo List <ilist@google.com>:

Rename protobuf to com_google_protobuf

This keeps compatiblity with WORKSPACE mode in older Bazel versions

--
0e1618fa83 by Ivo List <ilist@google.com>:

Adding deprecated comment

--
a272300c18 by Ivo List <ilist@google.com>:

Restore # @unsorted-dict-items

END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/269 from comius:add-back-cc_proto_library a272300c18
PiperOrigin-RevId: 694079850
Change-Id: Iaa57586636997fd3db9cf9289bddc40c673033c9
2024-11-07 05:14:59 -08:00
Googler da65f24105 Add release automation for rules_cc
Tracking issue: https://github.com/bazelbuild/rules_cc/issues/268

This CL adds a release workflow for rules_cc. It also adds a ci.bazelrc file that is used to configure Bazel on CI.

The release workflow is based on the release workflow for rules_proto. It uses the same release script, which generates a source archive and a release notes file. The release notes file is used as the top of the release notes for the release.

The ci.bazelrc file is used to configure Bazel on CI. It sets the --announce_rc option, which causes Bazel to print a message to the console whenever an option is set. It also sets the --disk_cache option, which tells Bazel to use a disk cache for downloaded external artifacts. This can help to speed up builds.

Finally, the ci.bazelrc file sets the --test_output option to errors. This causes Bazel to print test logs to the console, even if the tests pass. This can be helpful for debugging test failures.

PiperOrigin-RevId: 694052882
Change-Id: I7a55ec2d9b6b9161428dd3bb3c6c6b78b789ada2
2024-11-07 03:17:54 -08:00
Googler 7348965146 Bump rules_cc version to 0.0.14
BEGIN_PUBLIC
Bump rules_cc version to 0.0.14
END_PUBLIC

PiperOrigin-RevId: 693728781
Change-Id: Ie40637a2a64eca9e2cce9bfe451b69d29ab0fdfd
2024-11-06 08:01:01 -08:00
Ivo List 891cf0fc2c Merge remote-tracking branch 'origin/main' 2024-11-06 16:49:18 +01:00
Googler f5044c0097 Fix rules_shell copybara
BEGIN_PUBLIC
Internal change
END_PUBLIC

PiperOrigin-RevId: 693722123
Change-Id: I97ace26fc9275ff7417302a6f39ab90002c733f4
2024-11-06 07:36:04 -08:00
Googler 7e5f6a9391 Remove defs.bzl usages
BEGIN_PUBLIC
Remove defs.bzl usages
END_PUBLIC

PiperOrigin-RevId: 693709660
Change-Id: I1c92999e23c153f865ad68ab802d907abaea74eb
2024-11-06 07:35:53 -08:00
Copybara-Service 76413676fc Merge pull request #265 from comius:rules-shell-in-cc
PiperOrigin-RevId: 693699461
Change-Id: Icd113a5668da50f186836ca79036f6620ad0bfce
2024-11-06 07:35:39 -08:00
Ivo List ba0dbe8852
Merge pull request #265 from comius/rules-shell-in-cc
Use sh rules from rules_shell
2024-11-06 15:16:51 +01:00
Ivo List 2b8d08c910 Use rules_shell 2024-11-06 14:21:54 +01:00
Ivo List 5ebe5a71fe Remove bad target 2024-11-06 14:19:32 +01:00
Copybara-Service a5827bf372 Merge pull request #256 from fmeum:235-better-tool-map
PiperOrigin-RevId: 691529088
Change-Id: Idbda52a6b2eecbdefd83b2c89a0c7eb01dfee074
2024-10-30 13:15:53 -07:00
Googler b15fed2409 Remove cc_proto_library from defs.bzl
This makes it possible to remove dependency on protobuf. The dependency causes more problems than compatibility with some users of cc_proto_library from rules_cc.

Move WORKSPACE.bzlmod into correct directory.

PiperOrigin-RevId: 691445019
Change-Id: I45d7b4e381483de14ea2d20110be40f471a1ad12
2024-10-30 09:22:18 -07:00
Copybara-Service 597be676dd Merge pull request #234 from alexeagle:patch-2
PiperOrigin-RevId: 691379288
Change-Id: I4c48b399a3689caf2c0632856aa73180de4c5995
2024-10-30 05:18:29 -07:00
Copybara-Service 0d44d3ee76 Merge pull request #260 from hauserx:main
PiperOrigin-RevId: 691373476
Change-Id: I7a09129bdc7ac32bbbdb5f06a586bc0ceee2a8b7
2024-10-30 04:54:20 -07:00
Copybara-Service 0640261093 Merge pull request #257 from fmeum:validate-library
PiperOrigin-RevId: 691372917
Change-Id: Idebbc95f1e24990ec61d5224fbc28cd238a8fdbd
2024-10-30 04:51:22 -07:00
Copybara-Service 7381e24175 Merge pull request #198 from zaucy:emscripten-compiler
PiperOrigin-RevId: 691372690
Change-Id: I02e074a82591ba4112fe8449c0a7a86a35d64777
2024-10-30 04:49:48 -07:00
Copybara-Service faeafdb828 Merge pull request #253 from meteorcloudy:fix_compatibility
PiperOrigin-RevId: 689379342
Change-Id: Ia90576c00b917bf58a53362981d1f3e775d6dfd5
2024-10-24 07:51:08 -07:00
Googler f4e71c3a0c Update CODEOWNERS for rules_cc
PiperOrigin-RevId: 689375444
Change-Id: Ie4d9261f85290e25d76d634293bb7add9babea57
2024-10-24 07:37:56 -07:00
Googler f6c19dd20f Remove outdated toolchain README contents.
BEGIN_PUBLIC

Remove outdated toolchain README contents.

END_PUBLIC

PiperOrigin-RevId: 689365688
Change-Id: I78f3be0651e8aeaf842c3ea06d63161dd7ab42b4
2024-10-24 07:02:04 -07:00
Grzegorz Lukasik 7c39729245 Remove redundant with_feature_set for sanitizers
It uses the same name as the feature itself.
2024-10-23 10:52:47 +02:00
Googler 9e3e907560 Exclude intentionally broken build target from GH CI
BEGIN_PUBLIC

Exclude intentionally broken build target from GH CI

Gets GitHub CI passing again.

END_PUBLIC

PiperOrigin-RevId: 687335065
Change-Id: Icb3d9d1f7b6ccfd1e19c9174ad3481ecc2dfcc7f
2024-10-18 09:46:57 -07:00
Fabian Meumertzheim 12a8bd59af Move static library validation helper to `ar_files`
It doesn't need to be staged for every compile or link action. The action that uses it stages `all_files`.
2024-10-15 14:38:18 +02:00
Fabian Meumertzheim 3d51aaa430 Deduplicate tools for `cc_tool_map`
Fixes #235
2024-10-15 14:30:10 +02:00
Yun Peng f7ca57feac Restore compatibility with Bazel 6 2024-10-11 18:23:48 +02:00
Googler ba3ec91a55 Enable cquery in GitHub CI
BEGIN_PUBLIC

Enable cquery in GitHub CI

This will prevent incompatible targets from being built and tested.

END_PUBLIC

PiperOrigin-RevId: 684771349
Change-Id: Iba8807531e2c5465f1378bc384359be439373bf6
2024-10-11 03:15:37 -07:00
Googler ae44550707 Add missing defaults for cc_toolchain
BEGIN_PUBLIC

Add missing defaults for cc_toolchain

Fixes breakage caused by fully enumerating known attributes of a cc_toolchain without providing default values for optional arguments.

END_PUBLIC

PiperOrigin-RevId: 684719429
Change-Id: I8d031a344a65218fc925025cfef7768d123ad879
2024-10-10 23:37:00 -07:00
Googler 4a2d37625b Bump rules_cc version to 0.0.13
PiperOrigin-RevId: 684052002
Change-Id: I91de575a1ad021297787d00f9f95f0d569d9a5d8
2024-10-09 08:46:16 -07:00
Googler 324612d107 Add documentation for `cc_toolchain`
BEGIN_PUBLIC

Add documentation for `cc_toolchain`

Updates and includes documentation for the `cc_toolchain` rule, fixing some minor typos along the way.

END_PUBLIC

PiperOrigin-RevId: 684051451
Change-Id: I5bb62f22b3fb68e2d233fb85255d1a86bb45a47d
2024-10-09 08:44:04 -07:00
Googler 56f4a8bfa1 Add testing for Bazel@HEAD and Bazel 6
PiperOrigin-RevId: 684046113
Change-Id: I98875f8c67b491759f121c21e33ed04ec1d590e0
2024-10-09 08:26:06 -07:00
Copybara-Service 7782be6db1 Merge pull request #237 from armandomontanez:rules-based-toolchain-example
PiperOrigin-RevId: 684024413
Change-Id: I36767bb7452d83749a48342ff447f792979da576
2024-10-09 07:10:20 -07:00
Googler 013a082858 Redirect cc_proto_library to protobuf
PiperOrigin-RevId: 683876696
Change-Id: I0444b3b3bc3ac67bb641d82fe1d67117a6e2bcae
2024-10-08 21:18:29 -07:00
Googler a2949e206e Fix toolchain argument ordering
BEGIN_PUBLIC

Fix argument ordering

Expected argument ordering should be:

1. Arguments listed in `args`.
2. Legacy/built-in features.
3. User-defined features.

Due to some implementation changes, user-defined arguments were being applied last, reducing the ability for features to properly toggle behaviors dynamically.

This also fixes an issue caught by this change where cc_sysroot was applying flags to actions that had no associated action config.

END_PUBLIC

PiperOrigin-RevId: 683677895
Change-Id: I60e25ca22ffefce717e4e5ce476db0a070ca1993
2024-10-08 10:34:59 -07:00
Armando Montanez b82c650543 Merge branch 'main' into rules-based-toolchain-example 2024-10-08 10:12:35 -07:00
Googler eeed2a9ab7 Remove crostool migration tools
The migration to .bzl configured toolchains happened a long time ago and the conversion tools from proto files are not needed anymore.

This also cleans up rules_cc dependencies to build those tools. And unblock me around the import of py_proto_library, which is not needed anymore.

PiperOrigin-RevId: 683582749
Change-Id: I9a56d9e3f9089f7434708a2cfefdd4f12d186658
2024-10-08 05:35:42 -07:00
Googler b96ca29763 Directly exposing functions in toolchain_config_utils.bzl
setup_vc_env_vars should accepts more parameters than the wrapper previously allowed.

PiperOrigin-RevId: 683192260
Change-Id: Ie6063e0706640856e0f4c9dce3e1f4e8fe1ec9e9
2024-10-07 08:24:18 -07:00
Googler 19a278e626 Prepare for 0.0.12 release
PiperOrigin-RevId: 683189389
Change-Id: I6092c6d9716502cb236c307b9761d88a09b41334
2024-10-07 08:14:05 -07:00
Googler be5e15fc27 Prepare version 0.0.11 release
PiperOrigin-RevId: 683098220
Change-Id: I85a6ea0c63070e4a880a67f3063e1c2c4bef31ac
2024-10-07 02:36:13 -07:00
Copybara-Service aba461762f Merge pull request #250 from bazelbuild:Wyverald-patch-1
PiperOrigin-RevId: 683088860
Change-Id: I8aae0bbe569e834bc4d1d46dcee29c1c2ee51a64
2024-10-07 01:59:36 -07:00
Copybara-Service 37dacbbcf2 Merge pull request #249 from meteorcloudy:stardoc-dev
PiperOrigin-RevId: 683088422
Change-Id: Id6308c12494f4b591fd1d47ffbe84cb3b01b745d
2024-10-07 01:57:42 -07:00
Xùdōng Yáng 5cbd830262
Fix empty glob in cc/private/BUILD
the glob pattern `**/*.bzl` doesn't match anything there, and this is bad for `--incompatible_disallow_empty_glob`. This PR removes the offending line.
2024-10-04 22:54:53 +02:00
Fabian Meumertzheim 083ace4f11 Make stardoc a dev dependency
Otherwise rules_cc is transitively incompatible with Bazel 6 through the chain stardoc 0.7.0 -> rules_java 7.6.1.

`stardoc` targets are not needed by consumers of the ruleset.
2024-10-04 15:07:57 +02:00
Copybara-Service 7343c660a4 Merge pull request #244 from keith:ks/allow-extra-args-to-cc_sysroot
PiperOrigin-RevId: 682280945
Change-Id: I1f0256f6c99dd1e67efdcd08145700e10ab26e6a
2024-10-04 05:25:37 -07:00
Copybara-Service 565dbd65bd Merge pull request #245 from keith:ks/add-objc_compile-to-compile_actions
PiperOrigin-RevId: 682280777
Change-Id: If9c3a8aa883f7630d9a21d09e65c3c7a230140f2
2024-10-04 05:24:32 -07:00