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: is_dev_linux config setting should be false when cross_flag is #96129

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

srosenberg
Copy link
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
Member

This change is Reviewable

@srosenberg
Copy link
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
Member Author

bors r=rickystewart

@craig
Copy link
Contributor

craig bot commented Feb 10, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Feb 10, 2023

Build failed (retrying...):

@craig
Copy link
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