Skip to content

Comments

Update to the latest internal version#194

Merged
s-kanev merged 6 commits intomasterfrom
copybara_staging
Feb 23, 2026
Merged

Update to the latest internal version#194
s-kanev merged 6 commits intomasterfrom
copybara_staging

Conversation

@s-kanev
Copy link
Contributor

@s-kanev s-kanev commented Feb 18, 2026

Closes #192

jcking and others added 6 commits February 18, 2026 14:17
PiperOrigin-RevId: 840871948
PiperOrigin-RevId: 859219669
PiperOrigin-RevId: 869299341
Fix upstreaming process so that it doesn't accidentally strip out cc and proto rules.

Also, update our internal CI-for-upstream to use a newer docker container with a bazel 9.0 default.

PiperOrigin-RevId: 871975647
@google-cla
Copy link

google-cla bot commented Feb 18, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@@ -2,6 +2,9 @@ load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your patch as is fails to link in my cloudtop machine (using a public bazel build). Can you reproduce this?

ERROR: /usr/local/google/home/victorvianna/repos/perf_data_converter/src/BUILD:149:10: Linking src/perf_to_profile failed: (Exit 1): gcc failed: error executing CppLink command (from cc_binary rule target //src:perf_to_profile) /usr/bin/gcc @bazel-out/k8-fastbuild/bin/src/perf_to_profile-0.params

Gemini-cli suggested this fix and now it works.

$ git diff
diff --git a/src/BUILD b/src/BUILD
index b12658e..dff870c 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -139,6 +139,7 @@ cc_library(
     name = "perf_to_profile_lib",
     srcs = ["perf_to_profile_lib.cc"],
     hdrs = ["perf_to_profile_lib.h"],
+    alwayslink = 1,
     deps = [
         ":perf_data_converter",
         "//src/quipper:base",
@@ -149,6 +150,8 @@ cc_library(
 cc_binary(
     name = "perf_to_profile",
     srcs = ["perf_to_profile.cc"],
+    copts = ["-fPIC"],
+    linkopts = ["-Wl,--gc-sections"],
     deps = [
         ":perf_data_converter",
         ":perf_to_profile_lib",

Copy link
Contributor Author

@s-kanev s-kanev Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced some linker issues, but definitely not something that should be solved with alwayslink, which tends to be a pretty big bandaid.

Basically, Ubuntu (and internal gLiunux as a result) have picked up a broken version of GCC -- the details are here llvm/llvm-project#156667 (comment)

The bazel team recommends this in your bazelrc as a workaround until the toolchain gets into a proper state:

common --copt=-Wa,--gsframe=no
common --host_copt=-Wa,--gsframe=no

That worked on my gLinux machine.

Feel free to comment on b/483020832 internally with the full exact errors you're seeing, if this doesn't work.

(bugs like this are exactly why we shouldn't be using the system toolchain, but unfortunately bazel backtracked on the initial hermetic builds design)

@s-kanev
Copy link
Contributor Author

s-kanev commented Feb 20, 2026

@victorvianna did the gsframe workaround work?

@blakej11 can you review please?

@victorvianna
Copy link

@s-kanev Yes, adding that to ~/.bazelrc helped, thanks

Copy link
Contributor

@blakej11 blakej11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quipper source changes LGTM.

@s-kanev s-kanev merged commit c30db70 into master Feb 23, 2026
4 checks passed
@s-kanev s-kanev deleted the copybara_staging branch February 23, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails with Bazel 9: proto_library and cc_proto_library not defined

4 participants