bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Runtime dependencies for binaries in external repositories not in the sandbox in Remote Execution

Open carlosgalvezp opened this issue 3 years ago • 14 comments

Description of the bug:

Hi,

We have the following use case. A cc_binary defined in external workspace @foo, that has a dep on a cc_library @bar//:baz from the current workspace @bar. When building, the cc_binary gets an RPATH like this:

$ORIGIN/../../_solib_x86_64/...    

This is correct and makes the cc_binary work fine when running it locally via bazel run or directly outside Bazel.

However, this does not work when running in Remote Execution. Inspecting the remote sandbox, we notice that the ../../_solib_x86_64 folder does not exist. It does exist when running locally.

Is this expected? How can we fix it?

Thanks!

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Ubuntu 18.04

What is the output of bazel info release?

release 5.3.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

carlosgalvezp avatar Oct 06 '22 13:10 carlosgalvezp

Could you check whether this is fixed by https://github.com/bazelbuild/bazel/pull/16215?

fmeum avatar Oct 06 '22 13:10 fmeum

Thanks for the quick answer @fmeum ! We are using bazelisk pinning a release version of Bazel. Do you have any tips on how we could test #16215 easily?

carlosgalvezp avatar Oct 07 '22 06:10 carlosgalvezp

@sgowroji You added the more data needed tag - please let me know if I can provide any more information.

carlosgalvezp avatar Oct 07 '22 06:10 carlosgalvezp

Wanted to see the above comment helped ? Please wait for @fmeum update on it. Thanks!

sgowroji avatar Oct 07 '22 06:10 sgowroji

@carlosgalvezp You can either check out the branch and build Bazel from source via bazel build //src:bazel-dev or wait for the PR to get merged and then specify the commit on master as your USE_BAZEL_VERSION.

fmeum avatar Oct 07 '22 08:10 fmeum

@fmeum Thanks, seems like it's easier for us to wait. Do you have an estimate for when the PR could be merged?

carlosgalvezp avatar Oct 07 '22 14:10 carlosgalvezp

You can follow #16215 for updates, looks like merging the PR requires some more complicated procedure within Google.

fmeum avatar Oct 07 '22 14:10 fmeum

Hi!

I can mention that we have now bumped to the official 6.0.0 release and the problem still persists. I thought #16215 should have included the fix?

carlosgalvezp avatar Jan 05 '23 13:01 carlosgalvezp

@carlosgalvezp It does include the fix, so if this isn't working, something else is amiss. Could you provide a reproducer? Then I can take a look and investigate why it is still failing.

fmeum avatar Jan 05 '23 13:01 fmeum

Thanks for the info! Absolutely, will try to create a minimal example and come back :)

carlosgalvezp avatar Jan 05 '23 13:01 carlosgalvezp

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] avatar Mar 11 '24 01:03 github-actions[bot]

@carlosgalvezp Is this still happening with Bazel 7.1.0rc2?

fmeum avatar Mar 11 '24 07:03 fmeum

Hi @fmeum . I took over this task from Carlos. I tried Bazel 7.2.1 and I can confirm that the issue still persists, unfortunately. Do you still need the example to reproduce the issue?

attiladoor avatar Jun 26 '24 14:06 attiladoor

@attiladoor Yes, that would be helpful

fmeum avatar Jun 26 '24 17:06 fmeum