ni / niveristand-custom-device-build-tools

Tools for automating builds of NI VeriStand custom devices.
MIT License
18 stars 28 forks source link

Bug in ProjectPath resolution when path contains spaces #167

Closed Karl-G1 closed 1 year ago

Karl-G1 commented 1 year ago

When building the latest PR in Instrument Addon, I'm getting failures from the LV CLI call. Looking at the build log versus the last successful build, there are double quotes around the ProjectPath parameter:

-ProjectPath ""C:\agent_work\37\s\niveristand-instrument-addon-custom-device\Source\Addon\Instrument Addon.lvproj""

I'm guessing this is an issue introduced in #165, specifically the double quotes around the string that already contains quotes.

Full log comparing the two strings below:

PS C:\agent\_work\37\s> LabVIEWCLI -PortNumber 3363 -LabVIEWPath "C:\Program Files\National Instruments\LabVIEW 2021\LabVIEW.exe" -AdditionalOperationDirectory "C:\agent\_work\37\s\niveristand-custom-device-build-tools\lv\operations"     -OperationName "ExecuteBuildSpec"     -ProjectPath ""C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\Source\Addon\Instrument Addon.lvproj""     -TargetName "My Computer"      -BuildSpecName "Host API"      -LogFilePath "C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\lvBuildSpecs.log"
LabVIEWCLI started logging in file:  C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\lvBuildSpecs.log
Using LabVIEW: "C:\Program Files\National Instruments\LabVIEW 2021\LabVIEW.exe"
LabVIEW launched successfully.
Connection established with LabVIEW at port number 3363.

Operation output:
Error Code : -350051
Error Message : LabVIEW CLI: (Hex 0xFFFAA89D) The CLI for LabVIEW failed to run the operation because the command contains illegal arguments.
An error occurred while running the ExecuteBuildSpec operation.

ExecuteBuildSpec operation failed.

PS C:\agent\_work\37\s> LabVIEWCLI -PortNumber 3363 -LabVIEWPath "C:\Program Files\National Instruments\LabVIEW 2021\LabVIEW.exe" -AdditionalOperationDirectory "C:\agent\_work\37\s\niveristand-custom-device-build-tools\lv\operations"     -OperationName "ExecuteBuildSpec"     -ProjectPath "C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\Source\Addon\Instrument Addon.lvproj"     -TargetName "My Computer"      -BuildSpecName "Host API"      -LogFilePath "C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\lvBuildSpecs.log"
LabVIEWCLI started logging in file:  C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\lvBuildSpecs.log
Using LabVIEW: "C:\Program Files\National Instruments\LabVIEW 2021\LabVIEW.exe"
Connection established with LabVIEW at port number 3363.

Operation output:
Generated files are:
C:\agent\_work\37\s\niveristand-instrument-addon-custom-device\Source\Built\IA\Custom Devices\Instrument Addon\Windows\Host Automation API\Instrument Host Automation API.lvlibp

ExecuteBuildSpec operation succeeded.
Karl-G1 commented 1 year ago

I'm guessing this still succeeds when building the Build Tools test assets because of the lack of spaces in the path: -ProjectPath ""C:\agent_work\4\s\niveristand-custom-device-build-tools\test-build\Source\AllTargetBuildSpecs.lvproj""