Improve get_lib_version, use as check#415
Improve get_lib_version, use as check#415horstle wants to merge 2 commits intoemilsvennesson:masterfrom
Conversation
Strange, maybe related to this: https://github.community/t/segmentation-fault-when-running-binary-in-a-job/18418 |
|
@horstle
I added the old Feel free to make a better fix, but this is good enough for me to get merged. |
|
Ha, while looking at previous discussions I found my original code from a year ago: |
|
@mediaminister It is supposed to fail when there is an arch mismatch, so it won't install the wrong lib. That's what this PR is trying to fix (see #413). Also, the legacy version doesn't detect an arch mismatch, so it can't be used as a check. I'm currently looking into AWS CodeBuild, so we can run the ARM tests on ARM hardware. I think it makes sense to have separate Github actions for each platform, then the ARM tests could be run via CodeBuild and maybe at some point the Windows tests could run on Windows (it seems that's already possible in Github, but idk if it would cost something, might look into it later). That way closing the lib wouldn't be necessary, too, although I wouldn't mind keeping that change. |
5d417cc to
bc92eba
Compare
|
SonarCloud Quality Gate failed.
|
|
Okay, I removed the fallback. Tests fail, but now you can see why. |
Based on the code from @CastagnaIT, this improves the functionality of get_lib_version and adds a check to it. It now returns an empty string if the file is corrupt or the architecture doesn't match.
Currently unit tests fail. I guess that's because they are running on x86 hardware, so the aforementioned check fails. So far I only tested Linux x86 manually.
Closes #413.