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

Safer linux distro version checks in Qt installation script. #1587

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

namark
Copy link
Contributor

@namark namark commented Jan 29, 2022

This error was reported on discord

-- EXTERNAL_BUILD_ASSETS: https://athena-public.s3.amazonaws.com
-- GLES_OPTION:
Using the Python interpreter located at: /usr/bin/python3.10
-- The CXX compiler identification is GNU 11.1.0
GCC compiler detected, adding -O3 -fPIC -ggdb flags
-- VIRCADIA_OPTIMIZE: true
Adding CPU architecture flags: -march=native -mtune=native
-- VIRCADIA_CPU_ARCHITECTURE: -march=native -mtune=native
 -O3 -fPIC -ggdb -march=native -mtune=native
['/home/ben/build/vircadia/prebuild.py', '--release-type', 'DEV', '--build-root', '/home/ben/build/vircadia/build']
Using a packaged Qt
Traceback (most recent call last):
  File "/home/ben/build/vircadia/prebuild.py", line 194, in <module>
    main()
  File "/home/ben/build/vircadia/prebuild.py", line 119, in main
    qt = hifi_qt.QtDownloader(args)
  File "/home/ben/build/vircadia/hifi_qt.py", line 145, in __init__
    u_major = int( distro.major_version() )
ValueError: invalid literal for int() with base 10: ''
CMake Error at CMakeLists.txt:159 (message):
  prebuild.py failed with error 1

building on Arch linux. According to the docs here the version getters may return an empty string, and otherwise nothing suggest they are necessarily always integers. This PR defaults the major version variables to 0 when parsing the version string as int fails, and removes the unused minor version variables.

@digisomni digisomni added allow-build-upload Allows the upload of a build for non white-listed users needs CR (code review) labels Jan 29, 2022
@digisomni digisomni added this to the 2022.1.1 Selene Release milestone Jan 29, 2022
@digisomni digisomni added needs testing (QA) The PR is ready for testing linux This is related to Linux. labels Jan 29, 2022
@digisomni digisomni added CR Approved At least one code reviewer has approved the PR. needs testing (QA) The PR is ready for testing and removed needs CR (code review) needs testing (QA) The PR is ready for testing labels Jan 29, 2022
@digisomni
Copy link
Member

Awaiting testing from Ry with Arch Linux.

@3d1go
Copy link
Contributor

3d1go commented Feb 2, 2022

I have tested and confirmed that this works. A nice clear message is presented letting you know what to do if you run into the error. I've also written up a build guide for Arch/Arch-based distros, based on the original guide, which I will share as it's a bit different on Debian/Ubuntu and other distros.

Before the fix:
before

After the fix:
after

@digisomni digisomni added QA Approved The PR has been tested successfully. and removed needs testing (QA) The PR is ready for testing labels Feb 3, 2022
@daleglass daleglass merged commit 4c37aa7 into vircadia:master Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-build-upload Allows the upload of a build for non white-listed users CR Approved At least one code reviewer has approved the PR. linux This is related to Linux. QA Approved The PR has been tested successfully.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants