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

bazel: upgrade rules_foreign_cc to 0.7 #73819

Merged
merged 1 commit into from
Dec 17, 2021

Conversation

rickystewart
Copy link
Collaborator

Also add -fcommon to compile flags for krb5.

Closes #71306.

Release note: None

@rickystewart rickystewart requested a review from rail December 14, 2021 20:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rickystewart
Copy link
Collaborator Author

whoops, the geos definition needs to be tweaked a bit. i'll get it tomorrow.

@rickystewart rickystewart force-pushed the upgraderulesforeigncc branch 4 times, most recently from e8cdf20 to 7c2bcba Compare December 16, 2021 19:21
Also add `-fcommon` to compile flags for `krb5`.

Closes cockroachdb#71306.

Release note: None
Copy link
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rail)

@rickystewart
Copy link
Collaborator Author

bors r=rail

@craig
Copy link
Contributor

craig bot commented Dec 16, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Dec 17, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Dec 17, 2021

Build succeeded:

@craig craig bot merged commit 63d35df into cockroachdb:master Dec 17, 2021
@irfansharif
Copy link
Contributor

This might've broken bazel builds. Things work just fine in the commit before (and dev doctor turns up nothing).

$ dev build short -- --verbose_failures --sandbox_debug
$ bazel build //pkg/cmd/cockroach-short:cockroach-short --verbose_failures --sandbox_debug
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
INFO: Analyzed target //pkg/cmd/cockroach-short:cockroach-short (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_irfansharif/99e666e4e674209ecdb66b46371278df/external/com_google_protobuf/BUILD:154:11: Compiling src/google/protobuf/any.cc failed: (Exit 1): sandbox-exec failed: error executing command
  (cd /private/var/tmp/_bazel_irfansharif/99e666e4e674209ecdb66b46371278df/sandbox/darwin-sandbox/186/execroot/cockroach && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/var/folders/3j/6fxg9ckn21g5xm0z_06r7gzr0000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_irfansharif/99e666e4e674209ecdb66b46371278df/sandbox/darwin-sandbox/186/sandbox.sb /var/tmp/_bazel_irfansharif/install/d3bd16a8b22c859ba58f5dca04a9b1aa/process-wrapper '--timeout=0' '--kill_delay=15' external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.d '-frandom-seed=bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.o' -iquote external/com_google_protobuf -iquote bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/zlib -isystem external/com_google_protobuf/src -isystem bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src -isystem external/zlib/zlib/include -isystem bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/zlib/zlib/include -g0 -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/any.cc -o bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.o)
external/com_google_protobuf/src/google/protobuf/any.cc:48:19: error: out-of-line definition of 'PackFrom' does not match any declaration in 'google::protobuf::internal::AnyMetadata'
void AnyMetadata::PackFrom(const Message& message,
                  ^~~~~~~~
external/com_google_protobuf/src/google/protobuf/any.cc:50:14: error: no member named 'SetNoArena' in 'google::protobuf::internal::ArenaStringPtr'
  type_url_->SetNoArena(
  ~~~~~~~~~  ^
external/com_google_protobuf/src/google/protobuf/any.cc:53:37: error: no member named 'MutableNoArena' in 'google::protobuf::internal::ArenaStringPtr'
  message.SerializeToString(value_->MutableNoArena(
                            ~~~~~~  ^
external/com_google_protobuf/src/google/protobuf/any.cc:61:43: error: no member named 'GetNoArena' in 'google::protobuf::internal::ArenaStringPtr'
  return message->ParseFromString(value_->GetNoArena());
                                  ~~~~~~  ^
4 errors generated.
Target //pkg/cmd/cockroach-short:cockroach-short failed to build
ERROR: /Users/irfansharif/Software/src/github.com/cockroachdb/cockroach/pkg/storage/enginepb/BUILD.bazel:35:11 GoCompilePkg pkg/storage/enginepb/enginepb.a failed: (Exit 1): sandbox-exec failed: error executing command
  (cd /private/var/tmp/_bazel_irfansharif/99e666e4e674209ecdb66b46371278df/sandbox/darwin-sandbox/186/execroot/cockroach && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/var/folders/3j/6fxg9ckn21g5xm0z_06r7gzr0000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_irfansharif/99e666e4e674209ecdb66b46371278df/sandbox/darwin-sandbox/186/sandbox.sb /var/tmp/_bazel_irfansharif/install/d3bd16a8b22c859ba58f5dca04a9b1aa/process-wrapper '--timeout=0' '--kill_delay=15' external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.d '-frandom-seed=bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.o' -iquote external/com_google_protobuf -iquote bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/zlib -isystem external/com_google_protobuf/src -isystem bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src -isystem external/zlib/zlib/include -isystem bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/zlib/zlib/include -g0 -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/any.cc -o bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/_objs/protobuf/any.o)
INFO: Elapsed time: 2.294s, Critical Path: 2.03s
INFO: 17 processes: 17 internal.
FAILED: Build did NOT complete successfully
ERROR: exit status 1

@irfansharif
Copy link
Contributor

Getting rid of --incompatible_enable_cc_toolchain_resolution fixed it, do you know what to make of it? I couldn't quite figure out from bazelbuild/bazel#7260.

rickystewart added a commit to rickystewart/cockroach that referenced this pull request Dec 17, 2021
This becomes necessary after cockroachdb#73819, which sets
`--incompatible_enable_cc_toolchain_resolution` for builds. The problem
is that this flag causes Bazel to ignore `--crosstool_top` in favor of
what toolchain it selects via [toolchain resolution](https://docs.bazel.build/versions/main/toolchains.html#toolchain-resolution).
Therefore we update `.bazelrc` to specify the `--platforms` instead of
`--crosstool_top`, and add an appropriate `toolchain` in
`build/toolchains`.

Release note: None
craig bot pushed a commit that referenced this pull request Dec 17, 2021
73875: restoreccl: insert system.namespace entry for synthetic public schemas during restore r=dt a=RichardJCai

Release note (bug fix): Previously during restore we wouldn't insert a system.namespace
entry for synthetic public schemas.

Resolves #73535

73942: sql: simplify inserts into database descs with empty schemas map r=RichardJCai a=RichardJCai

Release note: None

73948: DOC-2096: Update diagrams.go to force scrolling on svg div blocks r=ericharmeling a=nickvigilante

Release note: None

73982: bazel: expose `devdarwinx86_64` toolchain via `platform` rules r=irfansharif a=rickystewart

This becomes necessary after #73819, which sets
`--incompatible_enable_cc_toolchain_resolution` for builds. The problem
is that this flag causes Bazel to ignore `--crosstool_top` in favor of
what toolchain it selects via [toolchain resolution](https://docs.bazel.build/versions/main/toolchains.html#toolchain-resolution).
Therefore we update `.bazelrc` to specify the `--platforms` instead of
`--crosstool_top`, and add an appropriate `toolchain` in
`build/toolchains`.

Release note: None

Co-authored-by: richardjcai <[email protected]>
Co-authored-by: Nick Vigilante <[email protected]>
Co-authored-by: Ricky Stewart <[email protected]>
rickystewart added a commit to rickystewart/cockroach that referenced this pull request Dec 20, 2021
With `--incompatible_enable_cc_toolchain_resolution` set in cockroachdb#73819, now
Bazel selects the appropriate toolchain for you. Bazel was selecting the
`cross_linux_toolchain` when building for the host platform on Linux,
resulting in link errors when trying to compile `stress` under `race`.
We update the toolchains to instead require opting into the cross
toolchains by defining `cockroach_cross=y`.

Closes cockroachdb#73997.

Release note: None
craig bot pushed a commit that referenced this pull request Dec 21, 2021
72992: util/log: fix redactability of logging tags r=abarganier a=knz

Fixes #72905.

Some time in the v21.2 cycle, the log entry preparation logic was
refactored and a mistake was introduced: the logging tags were not any
more subject to the redaction logic. The result was that redaction
markers were missing in log tag values, and if a value had contained
unbalanced redaction markers in a value string (say, as part of a SQL
table key), it would have caused log file corruption and possibly a
confidential data leak.

This patch fixes that, by preparing the logging tags in the same way
as the main message for each entry.

Release note (cli change): A bug affecting the redactability of
logging tags in output log entries has been fixed. This bug had
been introduced in the v21.2 release.

73937: setting: introduce setting classes r=RaduBerinde a=RaduBerinde

This commit introduces the three setting classes in the RFC (#73349):
`SystemOnly`, `TenantReadOnly`, and `TenantWritable`. The `SystemOnly`
class replaces the existing `WithSystemOnly()`.

In this change we don't yet implement the advertised semantics. We
mechanically use `TenantWritable` for all settings except those that
were using `WithSystemOnly()` which use `SystemOnly`; this should not
change any existing behavior. The classes will be revisited in a
separate change, after we implement the semantics.

Release note: None

73978: opt: fix like escape processing for span constraints r=cucaroach a=cucaroach

Fixes: #44123

Previously no attempt was made to properly handle escape ('\\') sequence
in like patterns being turned into constraints. Refactor code used to
process like at runtime to generate a regexp and use that to properly
handle index constraint generation.

Release note (sql change): Escape character processing was missing from
constraint span generation which resulted in incorrect results when
doing escaped like lookups.

74102: sql: do not fetch virtual columns during backfill r=mgartner a=mgartner

Fixes #73372

Release note (bug fix): A bug has been fixed that caused internal errors
when altering the primary key of a table. The bug was only present if
the table had a partial index with a predicate that referenced a virtual
computed column. This bug was present since virtual computed columns
were added in version 21.1.0.

74110: bazel: require setting `cockroach_cross=y` to opt into cross toolchains r=irfansharif a=rickystewart

With `--incompatible_enable_cc_toolchain_resolution` set in #73819, now
Bazel selects the appropriate toolchain for you. Bazel was selecting the
`cross_linux_toolchain` when building for the host platform on Linux,
resulting in link errors when trying to compile `stress` under `race`.
We update the toolchains to instead require opting into the cross
toolchains by defining `cockroach_cross=y`.

Closes #73997.

Release note: None

74111: bench/rttanalysis: allow roundtrips to be off by 1 r=ajwerner a=ajwerner

If we don't have a range, let the currently estimate be wrong by 1.
We mostly care about the ballpark and the growth rate. I'm sick of
these flakes.

Fixes #73884.

Release note: None

74152: ci: don't delete `test.json.txt` after processing r=tbg a=rickystewart

We've seen some issues where Bazel jobs are failing in `github-post`
(#73841, #74013) with the following output:

    found outstanding output. Considering last test failed:

It's hard to say what the problem is because these scripts haven't kept
the `test.json.txt` in `artifacts`. Here I remove the logic to clean up
the file so we can RC further instances of the problem.

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: Tommy Reilly <[email protected]>
Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Ricky Stewart <[email protected]>
Co-authored-by: Andrew Werner <[email protected]>
gustasva pushed a commit to gustasva/cockroach that referenced this pull request Jan 4, 2022
This becomes necessary after cockroachdb#73819, which sets
`--incompatible_enable_cc_toolchain_resolution` for builds. The problem
is that this flag causes Bazel to ignore `--crosstool_top` in favor of
what toolchain it selects via [toolchain resolution](https://docs.bazel.build/versions/main/toolchains.html#toolchain-resolution).
Therefore we update `.bazelrc` to specify the `--platforms` instead of
`--crosstool_top`, and add an appropriate `toolchain` in
`build/toolchains`.

Release note: None
gustasva pushed a commit to gustasva/cockroach that referenced this pull request Jan 4, 2022
With `--incompatible_enable_cc_toolchain_resolution` set in cockroachdb#73819, now
Bazel selects the appropriate toolchain for you. Bazel was selecting the
`cross_linux_toolchain` when building for the host platform on Linux,
resulting in link errors when trying to compile `stress` under `race`.
We update the toolchains to instead require opting into the cross
toolchains by defining `cockroach_cross=y`.

Closes cockroachdb#73997.

Release note: None
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.

bazel: apply gcc10 fix to kerberos build in bazel
4 participants