The initialization of a Workspace object uses the directory path obtained from the cm command cm workspace list --format={wkname}#{path}#{wkid}, whose format depends on the operative system of the node executing the build. That path is then used to build the internal field FilePath, representing the actual path of the workspace (either local or remote).
However, the FilePath object was constructed with a bare new File(path), and since the class File only covers local files, the resulting FilePath pointed to a path based on the controller's OS.
In a scenario where the controller runs on Windows and the agent on Linux/Mac, the workspace path is miscalculated, affecting subsequent cm commands where the workspace path is used.
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[x] Ensure that the pull request title represents the desired changelog entry
[x] Please describe what you did
[x] Link to relevant issues in GitHub or Jira
[x] Link to relevant pull requests, esp. upstream and downstream changes
[x] Ensure you have provided tests (if needed) - that demonstrates feature works or fixes the issue
The initialization of a
Workspace
object uses the directory path obtained from the cm commandcm workspace list --format={wkname}#{path}#{wkid}
, whose format depends on the operative system of the node executing the build. That path is then used to build the internal fieldFilePath
, representing the actual path of the workspace (either local or remote).However, the
FilePath
object was constructed with a barenew File(path)
, and since the classFile
only covers local files, the resultingFilePath
pointed to a path based on the controller's OS.In a scenario where the controller runs on Windows and the agent on Linux/Mac, the workspace path is miscalculated, affecting subsequent cm commands where the workspace path is used.