-
Notifications
You must be signed in to change notification settings - Fork 89
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
Build failing on DEP_QT_INCLUDE_PATH environment variable when building under bazel #298
Comments
from qttype's lib.rs:
Adding the explicit dependency on qttype in my project's Cargo.toml (which is in turn parsed by bazel to scrape dependencies), results in the same error. |
I believe the relevant paths can be scraped from the output of qttypes's build.rs file. Here is the relevant output from cargo clean -p qttypes; cargo build -vv:
|
So if I understand correctly, those line starting with "cargo:" in the stdout of qttypes' build.rs are the metadata that should get passed on... is it a bug that there aren't ~also lines starting with "DEP_QT_" as expected by crates building against qmetaobject? |
I am now able to build and run my small qmetaobject-rs demo project in bazel using a hacky workaround involving hard coding the paths to qt in another part of the build! Steps:
I am a bit baffled as to why cargo works but bazel didn't (without the above hack). It could be that qmetaobject isn't propagating the environment variables correctly, but qmetaobject is just getting lucky that cargo is sloppy an the environment is getting re-used. |
Yes: https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key It looks like a bug in the bazel system |
When building a qmetaobject-rs based demo (which builds cleanly in cargo) in bazel (with rules_rust 0.25.0 and rust 1.70.0, using the crates_repository and crate_repositories mechanisms), I am hitting:
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: NotPresent', external/otiv3__qmetaobject-0.2.9/build.rs:22:64
This is where build.rs reads the DEP_QT_INCLUDE_PATH environment variable. That variable isn't set in the environment where I am running cargo successfully.
In the qttypes crate README, it appears these environment variables it states this is set in that crate:
So I suspect bazel is building qttypes and my crate in stricter isolation (compared to cargo) and will need additional configuration to pass on those variables.
I will keep studying and will update the ticket as I go along, but if someone already resolved this, let me know. Thanks!
The text was updated successfully, but these errors were encountered: