Browse Source

skipGlibcCheck, #340

master
probonopd 6 years ago
committed by GitHub
parent
commit
ae8fad38fe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      tools/linuxdeployqt/main.cpp

42
tools/linuxdeployqt/main.cpp

@ -64,6 +64,7 @@ int main(int argc, char **argv)
QStringList additionalExecutables; QStringList additionalExecutables;
bool qmldirArgumentUsed = false; bool qmldirArgumentUsed = false;
bool skipTranslations = false; bool skipTranslations = false;
bool skipGlibcCheck = false;
QStringList qmlDirs; QStringList qmlDirs;
QStringList qmlImportPaths; QStringList qmlImportPaths;
QString qmakeExecutable; QString qmakeExecutable;
@ -73,6 +74,20 @@ int main(int argc, char **argv)
extern bool copyCopyrightFiles; extern bool copyCopyrightFiles;
// Check arguments // Check arguments
// Due to the structure of the argument parser, we have to check all arguments at first to check whether the user
// wants to get the version only
// TODO: replace argument parser with position independent, less error prone version
for (int i = 0; i < argc; i++ ) {
QString argument = argv[i];
if (argument == "-version" || argument == "-V" || argument == "--version") {
// can just exit normally, version has been printed above
return 0;
}
if (argument == QByteArray("-show-exclude-libs")) {
qInfo() << generatedExcludelist;
return 0;
}
}
for (int i = 2; i < argc; ++i) { for (int i = 2; i < argc; ++i) {
QByteArray argument = QByteArray(argv[i]); QByteArray argument = QByteArray(argv[i]);
@ -133,6 +148,9 @@ int main(int argc, char **argv)
} else if (argument == QByteArray("-no-translations")) { } else if (argument == QByteArray("-no-translations")) {
LogDebug() << "Argument found:" << argument; LogDebug() << "Argument found:" << argument;
skipTranslations = true; skipTranslations = true;
} else if (argument == QByteArray("-unsupported-allow-new-glibc")) {
LogDebug() << "Argument found:" << argument;
skipGlibcCheck = true;
} else if (argument.startsWith("-extra-plugins=")) { } else if (argument.startsWith("-extra-plugins=")) {
LogDebug() << "Argument found:" << argument; LogDebug() << "Argument found:" << argument;
int index = argument.indexOf("="); int index = argument.indexOf("=");
@ -157,8 +175,14 @@ int main(int argc, char **argv)
// We need to catch those errors at the source of the problem // We need to catch those errors at the source of the problem
// https://github.com/AppImage/appimage.github.io/search?q=GLIBC&unscoped_q=GLIBC&type=Issues // https://github.com/AppImage/appimage.github.io/search?q=GLIBC&unscoped_q=GLIBC&type=Issues
const char *glcv = gnu_get_libc_version (); const char *glcv = gnu_get_libc_version ();
if (strverscmp (glcv, "2.21") >= 0) if(skipGlibcCheck) {
{ qInfo() << "WARNING: Not checking glibc on the host system.";
qInfo() << " The resulting AppDir or AppImage may not run on older systems.";
qInfo() << " This mode is unsupported and discouraged.";
qInfo() << " For more information, please see";
qInfo() << " https://github.com/probonopd/linuxdeployqt/issues/340";
} else {
if (strverscmp (glcv, "2.21") >= 0) {
qInfo() << "ERROR: The host system is too new."; qInfo() << "ERROR: The host system is too new.";
qInfo() << "Please run on a system with a glibc version no newer than what comes with the oldest"; qInfo() << "Please run on a system with a glibc version no newer than what comes with the oldest";
qInfo() << "still-supported mainstream distribution, which currently is glibc 2.20."; qInfo() << "still-supported mainstream distribution, which currently is glibc 2.20.";
@ -167,20 +191,6 @@ int main(int argc, char **argv)
qInfo() << "https://github.com/probonopd/linuxdeployqt/issues/340"; qInfo() << "https://github.com/probonopd/linuxdeployqt/issues/340";
return 1; return 1;
} }
// due to the structure of the argument parser, we have to check all arguments at first to check whether the user
// wants to get the version only
// TODO: replace argument parser with position independent, less error prone version
for (int i = 0; i < argc; i++ ) {
QString argument = argv[i];
if (argument == "-version" || argument == "-V" || argument == "--version") {
// can just exit normally, version has been printed above
return 0;
}
if (argument == QByteArray("-show-exclude-libs")) {
qInfo() << generatedExcludelist;
return 0;
}
} }
if (argc < 2 || (firstArgument.startsWith("-"))) { if (argc < 2 || (firstArgument.startsWith("-"))) {

Loading…
Cancel
Save