Code Monkey home page Code Monkey logo

Comments (4)

fmeum avatar fmeum commented on June 1, 2024

Is this intentional? Or is this a bug?

Not a C++ rules owner, but I would guess the answer is "neither": This is a result of the changes to label stringification that come with Bzlmod, but the solib paths are also more of an implementation detail of the cc rules.

Could you describe your use case for hardcoding these paths in the first place?

from bazel.

comius avatar comius commented on June 1, 2024

That's more due to bzlmod than any requirements within C++ rules. It could be changed back. But also paths like this shouldn't be hard coded IMO.

from bazel.

werkt avatar werkt commented on June 1, 2024

I think the use of an @@ pathname was unexpected when we had not enabled bzlmod. It looked like an omission that had pulled behavior in for bzlmod without consideration of the option itself.

from bazel.

dws avatar dws commented on June 1, 2024

Is this intentional? Or is this a bug?

Not a C++ rules owner, but I would guess the answer is "neither": This is a result of the changes to label stringification that come with Bzlmod, but the solib paths are also more of an implementation detail of the cc rules.

Could you describe your use case for hardcoding these paths in the first place?

The use case, which I inherited and will not attempt to defend, was as follows:

We have a rule that runs protoc, and tells it to run a Python binary of ours as a plugin. I'll call it //:A. The //:A Python binary in turn wanted to run a prebuilt executable @B//:B from an external repository. This @B//:B binary needs a libtinfo.so.5 shared object, and this happens to be in yet a different external repository. In order to allow @B//:B to run, the code in //:A had set up LD_LIBRARY_PATH by calling the Python runfiles library with the hardcoded _solib_ path to libtinfo.so.5 (relative to the root of the runfiles, naturally), and then taking the dirname of the result since LD_LIBRARY_PATH needs to list directories and not files.

This hardcoded _solib_ path had a single @, so when the mangled path started to contain @@ instead in Bazel 7, even when bzlmod was disabled, this portion of our build failed because @B//:B failed to run, and so //:A bailed out with an error, and so protoc bailed out with an error. It was a merry chase to figure out why : )

from bazel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.