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

Follow the cxx build for output file names #855

Closed
1 task
ahayzen-kdab opened this issue Feb 21, 2024 · 7 comments
Closed
1 task

Follow the cxx build for output file names #855

ahayzen-kdab opened this issue Feb 21, 2024 · 7 comments
Labels
🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo 🤔 discussion Feedback welcome

Comments

@ahayzen-kdab
Copy link
Collaborator

At the moment we use the file stem or the module ident or the cxx_file_stem depending on the situation in cxx-qt-build.

With CXX if the bridge is in src/folder/binding.rs they generate src/folder/binding.rs.h.

In this situation should we do the following

bridge type proposed path current path
#[cxx::bridge] src/folder/binding.rs.h binding.cxx.h
#[cxx_qt::bridge] src/folder/binding.rs.qt.h binding.cxxqt.h
#[cxx_qt::bridge(cxx_file_stem = "binding"] binding.rs.qt.h binding.cxxqt.h

Note that due missing support in macros we cannot find the path in the second case (as seen in #200 ) so ...

  • For now disable having a cxx_qt::bridge without a cxx_file_stem until span source_file() API is stable
@ahayzen-kdab ahayzen-kdab added 🤔 discussion Feedback welcome 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo labels Feb 21, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Feb 21, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 18, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 18, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 18, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 18, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 18, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 23, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 23, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 23, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 23, 2024
@LeonMatthesKDAB
Copy link
Collaborator

New idea:
CXX probably only needs the include! in the build script expansion, where it generates the C++ code.
So could we just emit the include! to our generated header in the build script, where we know all the paths?

If that doesn't work, we could also try hashing the tokenstream to get a unique filename that we could reference when expanding the macro.
The build script could then generate symlinks from the hashed file name to the actual path, as the build script knows the paths.

ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 4, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 4, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 4, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 4, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 5, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 5, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 6, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 6, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 10, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 10, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 10, 2024
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 10, 2024
@dphaldes
Copy link
Contributor

dphaldes commented Oct 3, 2024

now that cxx_file_stem is gone, how do you use prevent the linking error because of same module name ?

@ahayzen-kdab
Copy link
Collaborator Author

What is the linker error you get ? As now we are following the path similar to CXX, i also wonder what happens if you do the same with CXX ?

@dphaldes
Copy link
Contributor

dphaldes commented Oct 3, 2024

It's a linker error. it cannot find the objects for linking the library. I have cxx-qt based Library which builds fine but when I consume it another project, it fails with linker error.

@ahayzen-kdab
Copy link
Collaborator Author

Don't know how much this is possibly related to #1065 which we hope to sort out in the next cycle.

Do you have an example project and the errors or an easy way to reproduce ?

@dphaldes
Copy link
Contributor

dphaldes commented Oct 3, 2024

I do. I will send it along with proper logs after I am done with work.

@dphaldes
Copy link
Contributor

dphaldes commented Oct 4, 2024

I did a clean update+build and it seems to start working automatically. so for now it seems to be resolved. Thanks for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo 🤔 discussion Feedback welcome
Projects
None yet
Development

No branches or pull requests

3 participants