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

Reexport CXX if possible to avoid needing dependency #883

Open
ahayzen-kdab opened this issue Mar 6, 2024 · 1 comment
Open

Reexport CXX if possible to avoid needing dependency #883

ahayzen-kdab opened this issue Mar 6, 2024 · 1 comment
Labels
⬆️ feature New feature or request

Comments

@ahayzen-kdab
Copy link
Collaborator

Can we avoid needing cxx as a dependency and instead use CXX as a dependency of cxx-qt/cxx-qt-build and reexport it? This will ensure that the cxx version is the same etc.

@ahayzen-kdab ahayzen-kdab added the ⬆️ feature New feature or request label Mar 6, 2024
@LeonMatthesKDAB
Copy link
Collaborator

Funnily enough, I've tried this literally 2 min. ago.

Alas, it doesn't work :/

The approach I took:

  1. Re-exported cxx from cxx_qt
  2. Add use cxx_qt::cxx; in front of each generated cxx bridge

Now I get the following error:

error[E0433]: failed to resolve: could not find `cxx` in the list of imported crates
  --> examples/qml_minimal/rust/src/cxxqt_object.rs:12:1
   |
12 | #[cxx_qt::bridge]
   | ^^^^^^^^^^^^^^^^^ could not find `cxx` in the list of imported crates
   |
   = note: this error originates in the attribute macro `cxx_qt::bridge` (in Nightly builds, run with -Z macro-backtrace for more info)

Checking this out with cargo expand, the issue seems to be that CXX is generating its own paths in the form of ::cxx::...
Which means it's fully-qualifying the path to cxx.
And afaik this means it will definitely look for a crate of that name, which must be added as a direct dependency 😢 .

So I think we may have to close this as wontfix :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants