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

Dotnet build command in generated makefile fails when the output directory path contains a space #5497

Closed
RickyGrassmuck opened this issue Aug 22, 2021 · 1 comment

Comments

@RickyGrassmuck
Copy link

While building Z3 on windows with the --dotnet option, I found that the nmake command was failing with the error message below.

C:\Users\Jon Doe\Documents\Development\z3-z3-4.8.12\build>nmake

Microsoft (R) Program Maintenance Utility Version 14.29.30038.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified.
Switch: Doe\Documents\Development\z3-z3-4.8.12\build\.

For switch syntax, type "MSBuild -help"
NMAKE : fatal error U1077: '"C:\Program Files\dotnet\dotnet.EXE"' : return code '0x1'
Stop.

Looking at the line in the make file generated by scripts/mk_make --dotnet, I noticed that the command did not have the path quoted leading to the dotnet commmand seeing an extraneous "project" being specified.

Microsoft.Z3.dll: libz3$(SO_EXT) ..\src\api\dotnet\AlgebraicNum.cs [ ...truncated... ]
@dotnet build z3.csproj -c Release -o C:\Users\Jon Doe\Documents\Development\z3-z3-4.8.12\build\.

Quoting the path allowed the script to work as expected.

Microsoft.Z3.dll: libz3$(SO_EXT) ..\src\api\dotnet\AlgebraicNum.cs [ ...truncated... ]
	@dotnet build dotnet\z3.csproj -c Release -o "C:\Users\Jon Doe\Documents\Development\z3-z3-4.8.12\build\."

Results

C:\Users\Jon Doe\Documents\Development\z3-z3-4.8.12\build>nmake

Microsoft (R) Program Maintenance Utility Version 14.29.30038.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Z3 was successfully built.
Z3Py scripts can already be executed in the 'build\python' directory.
Z3Py scripts stored in arbitrary directories can be executed if the 'build\python' directory is added to the PYTHONPATH environment variable and the 'build' directory is added to the PATH environment variable.

I found the line responsible for this part of the Makefile generation here but I am currently not working from my personal computer and am unable to make the changes.

Let me know if you have any questions.

NikolajBjorner added a commit that referenced this issue Aug 23, 2021
@NikolajBjorner
Copy link
Contributor

I work in a place where we have personal computers (PCs) as work computers :-).
I believe it is fixed.

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

No branches or pull requests

2 participants