Details
Description
This added support for AVR toolchains, but, seems, that the qbs.architecture contains the superfluous symbols (e.g. \n\r).QBS-1203
E.g. when I use the 'archiver' module, with this code:
import qbs import qbs.FileInfo import qbs.ModUtils import qbs.TextFile Product { builtByDefault: false targetName: project.name + qbs.architecture destinationDirectory: project.buildDirectory Depends { name: "cpp" } // for qbs.architecture Depends { name: "archiver" } type: ["archiver.archive"] archiver.type: "zip" archiver.workingDirectory: qbs.installRoot Rule { multiplex: true inputsFromDependencies: ["installable"] Artifact { filePath: product.name + ".tarlist" fileTags: ["archiver.input-list"] } prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; cmd.sourceCode = function() { var ofile = new TextFile(output.filePath, TextFile.WriteOnly); try { for (var i = 0; i < inputs["installable"].length; ++i) { var inp = inputs["installable"][i]; var installRoot = inp.moduleProperty("qbs", "installRoot"); var installedFilePath = ModUtils.artifactInstalledFilePath(inp); ofile.writeLine(FileInfo.relativePath(installRoot, installedFilePath)); } } finally { ofile.close(); } }; return [cmd]; } } }
Then it fails, because generates an wrong file output path, like:
Creating archive: D:/WORK/Projects/firmware-avr2 <<< THIS, SEEMS ADDS A NEW LINE SYMBOLS .zip Items to compress: 2 Error: cannot open file D:/WORK/Projects/firmware-avr2 <<< THIS, SEEMS ADDS A NEW LINE SYMBOLS .zip
But, If I add the trim() function:
targetName: project.name + qbs.architecture.trim()
then it generates a correct path:
Creating archive: D:/WORK/Projects/firmware-avr2.zip
Attachments
For Gerrit Dashboard: QBS-1217 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
208401,2 | Properly split newlines from gcc and nm output on Windows | 1.10 | qbs/qbs | Status: MERGED | +2 | 0 |