COVESA / dlt-viewer

Diagnostic Log and Trace viewing program
Other
425 stars 240 forks source link

Can not build on MacOS arm64 from Release v2.24.0 #367

Closed SangTruongTan closed 1 year ago

SangTruongTan commented 1 year ago

Hi, I've just faced a problem when I tried to build the app for my MacOS. I think that there is a change between v2.23.0 and v2.24.0 (later on). It got the following error and I can by pass it by utilizing the static cast method. Error:

Project/dlt-viewer/qdlt/qdltconnection.cpp:79:12: error: no viable conversion from 'QDltDataView' to 'QByteArray'
    data = dataView + bytes;

Remedy:

diff --git a/qdlt/qdltconnection.cpp b/qdlt/qdltconnection.cpp
index 20277fa..2534105 100644
--- a/qdlt/qdltconnection.cpp
+++ b/qdlt/qdltconnection.cpp
@@ -75,7 +75,7 @@ void QDltConnection::add(const QByteArray &bytes)
 {
     bytesReceived += bytes.size();

-    data = dataView + bytes;
+    data = static_cast<QByteArray>(dataView) + bytes;
Hit2theMo commented 1 year ago

Thanks a lot! This solved the same issue I faced.

hannesa2 commented 1 year ago

Where exactly is you issue ? I just created a new version https://github.com/COVESA/dlt-viewer/releases/tag/v2.25.0 and it builds for macOS, at least for x86

SangTruongTan commented 1 year ago

I'm using Apple Silicon, and it's also experienced on v2.25.0 again with the same point.

hannesa2 commented 1 year ago

I applied this change in #369

image

But locally on my M1 I still run into

image

Even on CI https://github.com/COVESA/dlt-viewer/actions/runs/5839431094/job/15837605503?pr=369 it runs into the same error

image

@SangTruongTan Please can you make a pull request to demonstrate, what exactly needs to be done ?

SangTruongTan commented 1 year ago

Hi @hannesa2, It's very strange, that's the only change at my end. Did you try flushing cmake cache?

hannesa2 commented 1 year ago

I did a git clean -xdf What's your recommendation to flush cmake cache ? Maybe you should do this as well.

CI uses

image

But with given/recommended change the CI x86 doesn't work and local on my side arm64 too. These are hard facts

SangTruongTan commented 1 year ago

I believe it's a clean version I have just done it so far. The remedy is also working with @Hit2theMo.

image

This overload operator is supposed to fix the issue by just static_cast. Please check at your end.

alexmucde commented 1 year ago

Reopen as fix is not working.

hannesa2 commented 1 year ago

Please check at your end.

There is nothing to check on my send. Simple look at CI #369 and the resulting error

SangTruongTan commented 1 year ago

Fixed by the remedy: https://github.com/COVESA/dlt-viewer/pull/373/commits/4bb3b26802316cd3fa28fde92f1ea32a72070fa3