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

qml_minimal example fails to bulid due to "byte index 1 is out of bounds of ``" #590

Open
spacekookie opened this issue Jun 25, 2023 · 11 comments
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo

Comments

@spacekookie
Copy link

spacekookie commented Jun 25, 2023

Hey there,

sorry if this is the wrong channel to ask questions. I was looking around for a Matrix/IRC/Discord channel in the documentation but couldn't find anything.

I'm new to both cxx-qt and qt development, so apologies also if this is an obvious problem :D

I'm trying to build the qml_minimal example from the cxx-qt repository. I'm using a NixOS shell environment to install the build requirements into my environment (nix-shell -p rustc cargo qt5.full mold clang cmake - it also happens with the qt6.full package). I don't know if there's something missing from it though.

I try building the qml-minimal example via this command:

cargo run -p qml-minimal-no-cmake

And here's the full stacktrace of my build (it looks like the cxx macro fails?): https://paste.rs/GBOwa.txt

Anyway, I hope you can give me some pointers as to what is wrong on my system/ what I'm missing to make this example build. Thanks in advance!

@ahayzen-kdab ahayzen-kdab added the 🪲 bug Something isn't working label Jun 26, 2023
@ahayzen-kdab
Copy link
Collaborator

Thanks for taking to the time to report a bug, here is fine for questions we don't have any chat channels yet, or a discussion in github is fine for non-bugs :-)

This error does look curious, it seems to suggest that one of our .rs files with CXX bridges is failing to be parsed by CXX / syn / somewhere else.

I assume that it is stopping on these block and not getting any futher?

let mut builder =
cxx_build::bridges(rust_bridges.iter().map(|bridge| format!("src/{bridge}.rs")));

Could you try commenting out some of the rust_bridges (in the code block below), to see if it is one specific .rs file that is causing an issue ?

Otherwise I can try to get a Nix environment setup to see if the issue is reproducible :-)

I also assume you are trying this from main ? Please also note that we are going through a slight API reshuffle so main is halfway between what is documented in the book and what is in #555. Also note that main has a regression for Qt 5 builds meaning that cargo-only builds will have issues with numbers in QML #592.

let mut rust_bridges = vec![
"core/qbytearray",
"core/qcoreapplication",
"core/qdate",
"core/qdatetime",
"core/qhash/qhash_i32_qbytearray",
"core/qhash/qhash_qstring_qvariant",
"core/qlist/qlist_bool",
"core/qlist/qlist_f32",
"core/qlist/qlist_f64",
"core/qlist/qlist_i8",
"core/qlist/qlist_i16",
"core/qlist/qlist_i32",
"core/qlist/qlist_i64",
"core/qlist/qlist_qbytearray",
"core/qlist/qlist_qdate",
"core/qlist/qlist_qdatetime",
"core/qlist/qlist_qmargins",
"core/qlist/qlist_qmarginsf",
"core/qlist/qlist_qpersistentmodelindex",
"core/qlist/qlist_qpoint",
"core/qlist/qlist_qpointf",
"core/qlist/qlist_qrect",
"core/qlist/qlist_qrectf",
"core/qlist/qlist_qsize",
"core/qlist/qlist_qsizef",
"core/qlist/qlist_qstring",
"core/qlist/qlist_qtime",
"core/qlist/qlist_qurl",
"core/qlist/qlist_qvariant",
"core/qlist/qlist_u8",
"core/qlist/qlist_u16",
"core/qlist/qlist_u32",
"core/qlist/qlist_u64",
"core/qmap/qmap_qstring_qvariant",
"core/qmargins",
"core/qmarginsf",
"core/qmetaobjectconnection",
"core/qmodelindex",
"core/qpersistentmodelindex",
"core/qpoint",
"core/qpointf",
"core/qrect",
"core/qrectf",
"core/qset/qset_bool",
"core/qset/qset_f32",
"core/qset/qset_f64",
"core/qset/qset_i8",
"core/qset/qset_i16",
"core/qset/qset_i32",
"core/qset/qset_i64",
"core/qset/qset_qbytearray",
"core/qset/qset_qdate",
"core/qset/qset_qdatetime",
"core/qset/qset_qpersistentmodelindex",
"core/qset/qset_qstring",
"core/qset/qset_qtime",
"core/qset/qset_qurl",
"core/qset/qset_u8",
"core/qset/qset_u16",
"core/qset/qset_u32",
"core/qset/qset_u64",
"core/qsize",
"core/qsizef",
"core/qstring",
"core/qstringlist",
"core/qt",
"core/qtime",
"core/qtimezone",
"core/qurl",
"core/qvariant/mod",
"core/qvariant/qvariant_bool",
"core/qvariant/qvariant_f32",
"core/qvariant/qvariant_f64",
"core/qvariant/qvariant_i8",
"core/qvariant/qvariant_i16",
"core/qvariant/qvariant_i32",
"core/qvariant/qvariant_i64",
"core/qvariant/qvariant_qbytearray",
"core/qvariant/qvariant_qdate",
"core/qvariant/qvariant_qdatetime",
"core/qvariant/qvariant_qmodelindex",
"core/qvariant/qvariant_qpersistentmodelindex",
"core/qvariant/qvariant_qpoint",
"core/qvariant/qvariant_qpointf",
"core/qvariant/qvariant_qrect",
"core/qvariant/qvariant_qrectf",
"core/qvariant/qvariant_qsize",
"core/qvariant/qvariant_qsizef",
"core/qvariant/qvariant_qstring",
"core/qvariant/qvariant_qstringlist",
"core/qvariant/qvariant_qtime",
"core/qvariant/qvariant_qurl",
"core/qvariant/qvariant_u8",
"core/qvariant/qvariant_u16",
"core/qvariant/qvariant_u32",
"core/qvariant/qvariant_u64",
"core/qvector/qvector_bool",
"core/qvector/qvector_f32",
"core/qvector/qvector_f64",
"core/qvector/qvector_i8",
"core/qvector/qvector_i16",
"core/qvector/qvector_i32",
"core/qvector/qvector_i64",
"core/qvector/qvector_qbytearray",
"core/qvector/qvector_qdate",
"core/qvector/qvector_qdatetime",
"core/qvector/qvector_qmargins",
"core/qvector/qvector_qmarginsf",
"core/qvector/qvector_qpersistentmodelindex",
"core/qvector/qvector_qpoint",
"core/qvector/qvector_qpointf",
"core/qvector/qvector_qrect",
"core/qvector/qvector_qrectf",
"core/qvector/qvector_qsize",
"core/qvector/qvector_qsizef",
"core/qvector/qvector_qstring",
"core/qvector/qvector_qtime",
"core/qvector/qvector_qurl",
"core/qvector/qvector_qvariant",
"core/qvector/qvector_u8",
"core/qvector/qvector_u16",
"core/qvector/qvector_u32",
"core/qvector/qvector_u64",
];
if feature_qt_gui_enabled {
rust_bridges.extend([
"core/qlist/qlist_qcolor",
"core/qvariant/qvariant_qcolor",
"core/qvector/qvector_qcolor",
"gui/qcolor",
"gui/qguiapplication",
"gui/qvector2d",
"gui/qvector3d",
"gui/qvector4d",
]);
}
if feature_qt_qml_enabled {
rust_bridges.extend(["qml/qqmlapplicationengine", "qml/qqmlengine"]);
}
for bridge in &rust_bridges {
println!("cargo:rerun-if-changed=src/{bridge}.rs");
}

@ahayzen-kdab
Copy link
Collaborator

Trying this out with Qt 6 i get a different error with Nix, due to the .prl file missing / in a different place.

warning: Could not open /nix/store/5vn1qrh0dh60i3hnc87adsq5llxjxzyc-qtbase-6.5.1/lib/libQt6Qml.prl file to read libraries to link: No such file or directory (os error 2)

I can see the file here instead

[nix-shell:~/Projects/cxx-qt]# find /nix/store/ |grep -i libQt6Qml.prl
/nix/store/nflaf93xf4q0q6i7b3hay6nqk7b4ksp3-qtdeclarative-6.5.1/lib/libQt6Qml.prl
/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/libQt6Qml.prl
[nix-shell:~/Projects/cxx-qt]# qmake -query
Detected locale "C" with character encoding "UTF-8", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
QT_SYSROOT:
QT_INSTALL_PREFIX:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_ARCHDATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_DATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_DOCS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/doc
QT_INSTALL_HEADERS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/include
QT_INSTALL_LIBS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib
QT_INSTALL_LIBEXECS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec
QT_INSTALL_BINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/bin
QT_INSTALL_TESTS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/tests
QT_INSTALL_PLUGINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/qt-6/plugins
QT_INSTALL_QML:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/qt-6/qml
QT_INSTALL_TRANSLATIONS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/examples
QT_INSTALL_DEMOS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/examples
QT_HOST_PREFIX:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_HOST_DATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_HOST_BINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/bin
QT_HOST_LIBEXECS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec
QT_HOST_LIBS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:6.5.1

@Be-ing Looks like another case for qt-build-utils to cover?

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Jun 26, 2023

@LeonMatthesKDAB also suffers from the missing prl file in Fedora but the build doesn't fail.

So I suspect my actual error here with Qt 6 is this one, failing to find qmltyperegistrar (full error here https://paste.rs/Iq1Ce.txt )

  --- stderr
  thread 'main' panicked at 'Could not find qmltyperegistrar: ()', /var/home/andrew/Projects/cxx-qt/crates/qt-build-utils/src/lib.rs:508:22
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@LeonMatthesKDAB
Copy link
Collaborator

LeonMatthesKDAB commented Jun 26, 2023

@ahayzen-kdab I get this error on Fedora as well:

warning: Could not open /usr/lib64/libQt6Qml.prl file to read libraries to link: No such file or directory (os error 2)
warning: Could not open /usr/lib64/libQt6Qml.prl file to read libraries to link: No such file or directory (os error 2)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 19s

But that doesn't cause any issues for me on Fedora 37. So I don't think this is the issue.

I'm getting another error though when trying to build in a nix docker container: https://paste.rs/rYfyU.txt
So we clearly still have work to do with CXX-Qt in Nix 🤔

@spacekookie did you experience any of these issues as well? Also, please let us know what version of cxx-qt you're building. 0.5? main?

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Jun 26, 2023

So Qt 5 works under Nix for me (other than #593 ), i get the warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] warning many times and that's it.

And as a side note it does find the prl files.

[nix-shell:~/Projects/cxx-qt]# find /nix/store/ |grep -i libQt6Qml.prl
/nix/store/nflaf93xf4q0q6i7b3hay6nqk7b4ksp3-qtdeclarative-6.5.1/lib/libQt6Qml.prl
/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/libQt6Qml.prl
[nix-shell:~/Projects/cxx-qt]# qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_INSTALL_ARCHDATA:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_INSTALL_DATA:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_INSTALL_DOCS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/share/doc/qt-5.15.9
QT_INSTALL_HEADERS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/include
QT_INSTALL_LIBS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/lib
QT_INSTALL_LIBEXECS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/libexec
QT_INSTALL_BINS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/bin
QT_INSTALL_TESTS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/tests
QT_INSTALL_PLUGINS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/lib/qt-5.15.9/plugins
QT_INSTALL_IMPORTS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/imports
QT_INSTALL_QML:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/lib/qt-5.15.9/qml
QT_INSTALL_TRANSLATIONS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/translations
QT_INSTALL_CONFIGURATION:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_INSTALL_EXAMPLES:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/examples
QT_INSTALL_DEMOS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/examples
QT_HOST_PREFIX:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_HOST_DATA:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9
QT_HOST_BINS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/bin
QT_HOST_LIBS:/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.15.9
[nix-shell:~/Projects/cxx-qt]# command -v qmltyperegistrar 
/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/bin/qmltyperegistrar

@ahayzen-kdab
Copy link
Collaborator

Then going back to Qt 6 with a clean build again, it does look like qmltyperegistrar is the problem for me.

[nix-shell:~/Projects/cxx-qt]# command -v qmltyperegistrar

[nix-shell:~/Projects/cxx-qt]# find /nix -name qmltyperegistrar
/nix/store/nflaf93xf4q0q6i7b3hay6nqk7b4ksp3-qtdeclarative-6.5.1/libexec/qmltyperegistrar
/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec/qmltyperegistrar
/nix/store/kkcf2gs5xqbirk55906zmly37pk29qwk-qtdeclarative-5.15.9-bin/bin/qmltyperegistrar
/nix/store/v25rhh4pgvwjspr3bax3kls0r97f16fi-qtdeclarative-5.15.9-dev/bin/qmltyperegistrar
/nix/store/4zmqkx9ws3vi40wc0fq6q1hrzvmwi0y3-qt-full-5.15.9/bin/qmltyperegistrar

[nix-shell:~/Projects/cxx-qt]# qmake -query                
Detected locale "C" with character encoding "UTF-8", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
QT_SYSROOT:
QT_INSTALL_PREFIX:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_ARCHDATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_DATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_INSTALL_DOCS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/doc
QT_INSTALL_HEADERS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/include
QT_INSTALL_LIBS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib
QT_INSTALL_LIBEXECS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec
QT_INSTALL_BINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/bin
QT_INSTALL_TESTS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/tests
QT_INSTALL_PLUGINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/qt-6/plugins
QT_INSTALL_QML:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib/qt-6/qml
QT_INSTALL_TRANSLATIONS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/examples
QT_INSTALL_DEMOS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/examples
QT_HOST_PREFIX:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_HOST_DATA:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1
QT_HOST_BINS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/bin
QT_HOST_LIBEXECS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec
QT_HOST_LIBS:/nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:6.5.1

[nix-shell:~/Projects/cxx-qt]# ls -l /nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec/qmltyperegistrar
lrwxrwxrwx 2 root root 88 Jan  1  1970 /nix/store/sy5dy9hqshc7smrq2q7cjnllsbkg1zla-qt-full-6.5.1/libexec/qmltyperegistrar -> /nix/store/nflaf93xf4q0q6i7b3hay6nqk7b4ksp3-qtdeclarative-6.5.1/libexec/qmltyperegistrar

So appears for me that qt-build-utils needs to search QT_INSTALL_LIBEXECS ? cc @Be-ing

@ahayzen-kdab
Copy link
Collaborator

OK, so Qt 6 is now working by pointing to the right qmake executable. Appears that qmake6 gives incorrect values compared to qmake under Qt 6 in a Nix environment. I'll create a patch to discuss the default, but you can always override with your own QMAKE env var.

ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 26, 2023
When using Nix with Qt 6 the output of qmake6 -query is incorrect
and ends up pointing to the incorrect locations. But qmake -query
points to the correct ones.

This solves the issue for Nix but looks like Debian only has
qmake for Qt 5 and qmake6 for Qt 6.

Related to KDAB#590
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 26, 2023
When using Nix with Qt 6 the output of qmake6 -query is incorrect
and ends up pointing to the incorrect locations. But qmake -query
points to the correct ones.

qt_build_utils also will iterate through the possible qmake
executables and match to the major version.

Related to KDAB#590
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 26, 2023
When using Nix with Qt 6 the output of qmake6 -query is incorrect
and ends up pointing to the incorrect locations. But qmake -query
points to the correct ones.

qt_build_utils also will iterate through the possible qmake
executables and match to the major version.

Related to KDAB#590
@ahayzen-kdab
Copy link
Collaborator

Note that qmake6 giving incorrect values in Qt 6 should be fixed via NixOS/nixpkgs#239971, while waiting for this to flow to your nix channel you can set the env var QMAKE to point to qmake as a workaround.

@spacekookie
Copy link
Author

Hey! Thanks for investigating this so quickly. I've not gotten any other errors, no. I've since tried using a more recent nixpkgs, with Qt6 (and setting QMAKE=qmake) yields the same error. Here's a full build log, including which version hashes of dependencies I'm using: https://paste.rs/oQNHT.txt

I don't know if the build failures you've observed on Fedora are before or after the code is supposed to make it to that macro. I'm wondering if I'm missing some other dependency? If you want me to run any commands to test things in my environment, let me know (and apologies if you already have and I missed them in the comments)

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Jun 27, 2023

The byte index 1 is out of bounds of error is still odd, it looked like before it was coming from cxx/syn itself when parsing the rust files. I assume you haven't modified any of them or have any potential weird character encodings or something ? As when we tried a Nix env it didn't fail on that error for us but instead the qmake issues.

The failures we observed are after yours I believe, and once working around them we were able to have a successful build.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 4, 2023

Hi, fancy seeing you here @spacekookie :)

Here's a full build log, including which version hashes of dependencies I'm using: https://paste.rs/oQNHT.txt

Could you rerun this with RUST_BACKTRACE=1? Panicking in the Rust standard library is puzzling.

@Be-ing Be-ing added the 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo
Projects
None yet
Development

No branches or pull requests

4 participants