Skip to content

bazel: is_dev_linux config setting should be false when cross_flag is#96129

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
srosenberg:sr/fix_is_dev_linux
Feb 10, 2023
Merged

bazel: is_dev_linux config setting should be false when cross_flag is#96129
craig[bot] merged 1 commit intocockroachdb:masterfrom
srosenberg:sr/fix_is_dev_linux

Conversation

@srosenberg
Copy link
Copy Markdown
Member

true

When cross-compiling on a gce worker and invoking bazel directly, build fails with "cannot find -lresolv_wrapper", owing to the fact that is_dev_linux is not mutually exclusive of cross_linux. That is, when both configs are active "-lresolv_wrapper" is passed to clinkopts in pkg/ccl/gssapiccl/BUILD.bazel; the cross-compiler doesn't have this lib nor does it need it.

Note, when using ./dev instead of bazel, the above issue is side-stepped because the dev wrapper invokes bazel inside docker which ignores ~/.bazelrc.

The workaround is to make is_dev_linux false when cross_flag is true.

Epic: none

Release note: None

@srosenberg srosenberg requested a review from a team as a code owner January 28, 2023 01:54
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@srosenberg
Copy link
Copy Markdown
Member Author

Running the following on a gce worker fails without this change,

bazel build //pkg/cmd/cockroach //pkg/compose/compare/compare:compare_test --config=ci --config=crosslinux --config=test

The reason is that ~/.bazelrc contains the line build --config=dev, which in conjunction with --config=crosslinux results in -lresolv_wrapper being passed to the cross-builder's linker,

/home/srosenberg/.cache/bazel/_bazel_srosenberg/3f1e38fca2391d213d04e1064a5fee62/external/toolchain_cross_x86_64-unknown-linux-gnu/bin/../lib/gcc/x86_64-unknown-linux-gnu/6.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld.bfd: cannot find -lresolv_wrapper
collect2: error: ld returned 1 exit status
compilepkg: error running subcommand external/toolchain_cross_x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc: exit status 1

@srosenberg srosenberg requested review from rickystewart and removed request for a team January 28, 2023 01:58
true

When cross-compiling on a gce worker and invoking bazel directly, build
fails with "cannot find -lresolv_wrapper", owing to the fact that
is_dev_linux is not mutually exclusive of cross_linux. That is, when
both configs are active "-lresolv_wrapper" is passed to clinkopts in
pkg/ccl/gssapiccl/BUILD.bazel; the cross-compiler doesn't have this lib nor
does it need it.

Note, when using ./dev instead of bazel, the above issue is side-stepped
because the dev wrapper invokes bazel inside docker which ignores
~/.bazelrc.

The workaround is to make is_dev_linux false when cross_flag is true.

Epic: none

Release note: None
@srosenberg
Copy link
Copy Markdown
Member Author

bors r=rickystewart

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 10, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 10, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 10, 2023

Build succeeded:

@craig craig bot merged commit 173e3d9 into cockroachdb:master Feb 10, 2023
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.

3 participants