Vertexwahn / rules_qt6

Bazel rules for Qt6
https://vertexwahn.de/page/open_source/
Apache License 2.0
30 stars 8 forks source link

Qt6 on Linux: How to copy required libs? #2

Closed Vertexwahn closed 2 years ago

Vertexwahn commented 3 years ago

On Linux with Bazel and GCC9 installed you can run my code via:

git clone https://github.com/Vertexwahn/rules_qt6
cd rules_qt6
bazel run --config=gcc9 //:Qt6HelloWorld

When trying to run this Qt6HelloWorld demo this error gets reported:

/home/user/.cache/bazel/_bazel_$USER/196a14423fc09522ef7bd657344d1cd0/execroot/Qt6Testbed/bazel- out/k8-fastbuild/bin/Qt6HelloWorld:
error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directory

There seem to be a libQt6Network.so, libQt6Network.so.6 and libQt6Network.so.6.1.0 in Qt6.1.0. If I copy those file to bazel-out/k8-fastbuild/bin (where the Qt6HelloWorld binary resides) I still get this error.

Any ideas how to fix this error? Any ideas how I can extend my rules to copy over those required libs so Bazel is happy?

Please contribute code to solve this issue!

bazel run --config=gcc9 //:Qt6HelloWorld should work out of the box without doing any further actions!

Vertexwahn commented 3 years ago

There is now a bounty for this.

Chocobo1 commented 3 years ago

There is now a bounty for this.

Hi @Vertexwahn, I would like to help on this issue.

I already can build the application on linux and run it but I'm struggling with your requirement: bazel run --config=gcc9 //:Qt6HelloWorld should work out of the box without doing any further actions!

Currently I cannot progress further due to my lack of experience with bazel scripts (the task would be easy in linux shell scripts). So I'll ask, would you consider the task solved if I provided how I did it instead of contributing bazel code?

Vertexwahn commented 3 years ago

There is now a bounty for this.

Hi @Vertexwahn, I would like to help on this issue.

I already can build the application on linux and run it but I'm struggling with your requirement: bazel run --config=gcc9 //:Qt6HelloWorld should work out of the box without doing any further actions!

Currently I cannot progress further due to my lack of experience with bazel scripts (the task would be easy in linux shell scripts). So I'll ask, would you consider the task solved if I provided how I did it instead of contributing bazel code?

Short answer: No.

Long answer: No. Sorry. No additional scripting is allowed. As a developer, I only want to do

git clone https://github.com/Vertexwahn/rules_qt6.git
bazel run --config=gcc9 //:Qt6HelloWorld

Maybe this helps to fix the issues: https://stackoverflow.com/questions/68405534/link-to-versioned-pre-built-libraries-with-bazel

Vertexwahn commented 2 years ago

Solved by https://github.com/Vertexwahn/rules_qt6/pull/6