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

Unable to read messages from localized versions of utilities. #317

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions tools/linuxdeployqt/shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ LddInfo findDependencyInfo(const QString &binaryPath)
ldd.waitForFinished();

if (ldd.exitStatus() != QProcess::NormalExit || ldd.exitCode() != 0) {
LogError() << "findDependencyInfo:" << ldd.readAllStandardError();
LogError() << "findDependencyInfo:" << QString::fromLocal8Bit(ldd.readAllStandardError());
return info;
}

static const QRegularExpression regexp(QStringLiteral("^.+ => (.+) \\("));

QString output = ldd.readAllStandardOutput();
QString output = QString::fromLocal8Bit(ldd.readAllStandardOutput());
QStringList outputLines = output.split("\n", QString::SkipEmptyParts);
if (outputLines.size() < 2) {
if ((output.contains("statically linked") == false)){
Expand Down Expand Up @@ -608,7 +608,7 @@ QSet<QString> getBinaryRPaths(const QString &path, bool resolve = true, QString
objdump.waitForFinished();

if (objdump.exitCode() != 0) {
LogError() << "getBinaryRPaths:" << objdump.readAllStandardError();
LogError() << "getBinaryRPaths:" << QString::fromLocal8Bit(objdump.readAllStandardError());
}

if (resolve && executablePath.isEmpty()) {
Expand Down Expand Up @@ -776,7 +776,7 @@ QString runPatchelf(QStringList options)
}
patchelftool.waitForFinished();
if (patchelftool.exitCode() != 0) {
LogError() << "runPatchelf:" << patchelftool.readAllStandardError();
LogError() << "runPatchelf:" << QString::fromLocal8Bit(patchelftool.readAllStandardError());
// LogError() << "runPatchelf:" << patchelftool.readAllStandardOutput();
// exit(1); // Do not exit because this could be a script that patchelf can't work on
}
Expand Down Expand Up @@ -939,16 +939,16 @@ void runStrip(const QString &binaryPath)
patchelfread.waitForFinished();

if (patchelfread.exitCode() != 0){
LogError() << "Error reading rpath with patchelf" << QFileInfo(resolvedPath).completeBaseName() << ":" << patchelfread.readAllStandardError();
LogError() << "Error reading rpath with patchelf" << QFileInfo(resolvedPath).completeBaseName() << ":" << patchelfread.readAllStandardOutput();
LogError() << "Error reading rpath with patchelf" << QFileInfo(resolvedPath).completeBaseName() << ":" << QString::fromLocal8Bit(patchelfread.readAllStandardError());
LogError() << "Error reading rpath with patchelf" << QFileInfo(resolvedPath).completeBaseName() << ":" << QString::fromLocal8Bit(patchelfread.readAllStandardOutput());
exit(1);
}

QString rpath = patchelfread.readAllStandardOutput();

if (rpath.startsWith("$")){
LogDebug() << "Already contains rpath starting with $, hence not stripping";
LogDebug() << patchelfread.readAllStandardOutput();
LogDebug() << QString::fromLocal8Bit(patchelfread.readAllStandardOutput());
return;
}

Expand All @@ -970,11 +970,12 @@ void runStrip(const QString &binaryPath)
if (strip.exitCode() == 0)
return;

if (strip.readAllStandardError().contains("Not enough room for program headers")) {
QString stdErr = QString::fromLocal8Bit(strip.readAllStandardError());
if (stdErr.contains("Not enough room for program headers")) {
LogNormal() << QFileInfo(resolvedPath).completeBaseName() << "already stripped.";
} else {
LogError() << "Error stripping" << QFileInfo(resolvedPath).completeBaseName() << ":" << strip.readAllStandardError();
LogError() << "Error stripping" << QFileInfo(resolvedPath).completeBaseName() << ":" << strip.readAllStandardOutput();
LogError() << "Error stripping" << QFileInfo(resolvedPath).completeBaseName() << ":" << stdErr;
LogError() << "Error stripping" << QFileInfo(resolvedPath).completeBaseName() << ":" << QString::fromLocal8Bit(strip.readAllStandardOutput());
exit(1);
}

Expand Down Expand Up @@ -1067,12 +1068,12 @@ static QString captureOutput(const QString &command)
process.waitForFinished();

if (process.exitStatus() != QProcess::NormalExit) {
LogError() << command << "crashed:" << process.readAllStandardError();
LogError() << command << "crashed:" << QString::fromLocal8Bit(process.readAllStandardError());
} else if (process.exitCode() != 0) {
LogError() << command << "exited with" << process.exitCode() << ":" << process.readAllStandardError();
LogError() << command << "exited with" << process.exitCode() << ":" << QString::fromLocal8Bit(process.readAllStandardError());
}

return process.readAllStandardOutput();
return QString::fromLocal8Bit(process.readAllStandardOutput());
}

DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables, const QString& qmake)
Expand Down