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

fix: Changed WorkingDirectory to $(OutDir) as default and $(OutputPath) as fallback #223

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

Brimerland
Copy link
Contributor

@Brimerland Brimerland commented Dec 11, 2023

Exec WorkingDirectory should be $(OutDir) as default and $(OutputPath) as fallback.
$(OutputPath) might not work on large complex solutions.

See https://github.com/dotnet/msbuild/blob/f914c9bfb613d32edb658b803c7fe046f9ee3c37/src/Tasks/Microsoft.Common.CurrentVersion.targets#L107-L122

'OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.'

Experienced this error in my solution where $(OutDir) is used.

Calling dscom.exe to export type library
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003: The specified task executable "cmd.exe" could not be run. System.IO.DirectoryNotFoundException: The working directory "bin\x64\Debug\net8.0-windows\win-x64\" does not exist.
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003:    at Microsoft.Build.Tasks.Exec.GetWorkingDirectory()
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch)
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003:    at Microsoft.Build.Tasks.Exec.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
P:\code\packages_installed\dspace.runtime.interopservices.buildtasks\1.7.0\build\dSPACE.Runtime.InteropServices.BuildTasks.Tools.targets(64,5): error MSB6003:    at Microsoft.Build.Utilities.ToolTask.Execute()

Also there were quotation marks missing causing an exit code 9009 (file not found) on calling the dscom tool if it is located in a path containing spaces.

This Pull Request fixes these issues.

…se $(OutDir) as default and $(OutputPath) as fallback.


$(OutputPath) might not work on large complex solutions.

See https://github.com/dotnet/msbuild/blob/f914c9bfb613d32edb658b803c7fe046f9ee3c37/src/Tasks/Microsoft.Common.CurrentVersion.targets#L107-L122

'OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.'
Copy link
Member

@SOsterbrink SOsterbrink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution and the good explanation.

@Brimerland
Copy link
Contributor Author

Brimerland commented Dec 12, 2023

Do I need to do something here?
The unit test failed without showing any errors except these two lines:
"The active test run was aborted. Reason: Test host process crashed"
"Error: Process completed with exit code 1."
And my commits did not change anything which is unit testable.

@SOsterbrink
Copy link
Member

Do I need to do something here? The unit test failed without showing any errors except these two lines: "The active test run was aborted. Reason: Test host process crashed" "Error: Process completed with exit code 1." And my commits did not change anything which is unit testable.

There should not be a problem. Somehow the test process crashed on the build machine. I'll have to take a closer look if that persists. For now I just restarted the unit tests.

@marklechtermann marklechtermann changed the title Exec WorkingDirectory should be $(OutDir) as default and $(OutputPath) as fallback fix: Changed WorkingDirectory to $(OutDir) as default and $(OutputPath) as fallback Dec 12, 2023
@marklechtermann marklechtermann merged commit 9d28203 into dspace-group:main Dec 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants