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

[bug] user_property_file_name causes "error MSB4115: The "exists" function only accepts a scalar value" in MSBuild with with vs2015 #7806

Open
michaelmaguire opened this issue Oct 3, 2020 · 1 comment

Comments

@michaelmaguire
Copy link

michaelmaguire commented Oct 3, 2020

Environment Details (include every applicable attribute)

  • Operating System+version: Windows Server 2012 R2
  • Compiler+version: VS2015, Microsoft (R) Build Engine version 14.0.25420.1
  • Conan version: Conan version 1.29.0
  • Python version: Python 3.8.6

Using user_property_file_name as follows in my conanfile.py:

    def build(self):
        msbuild = MSBuild(self)
        msbuild.build("MyProject.sln", user_property_file_name=os.path.join(self.build_folder, "conanbuildinfo.props"))

doesn't seem to work for me in either of the conan build or conan create cases.

Here's the error for conan build:

C:\dev\src\nx\platform\build>conan build ..

[...]

----Running------
> call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC/vcvarsall.bat" amd64 && msbuild "C:\dev\src\nx\platform\Platform.sln" /p:Configuration="Debug" /p:UseEnv=true /p:Platform="x64" /m:8 /p:PlatformToolset="v140" /verbosity:normal /p:ForceImportBeforeCppTargets="C:\dev\src\nx\platform\build\conan_build.props;C:\dev\src\nx\platform\build\conanbuildinfo.props"
-----------------
Microsoft (R) Build Engine version 14.0.25420.1

[...]

   20>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Current.targets(14,11): error MSB4115: The "exists" function only accepts a scalar value, but its argument "$(ForceImportBeforeCppTargets)" evaluates to "C:\dev\src\nx\platform\build\conan_build.props;C:\dev\src\nx\platform\build\conanbuildinfo.props" which is not a scalar value. [C:\dev\src\nx\platform\SolutionPlatformCommonTasks\SolutionPlatformCommonTasks.vcxproj]

and here's the error for conan create:

C:\dev\src\nx\platform>conan create . PORT/stable

[...]

----Running------
> call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC/vcvarsall.bat" amd64 && msbuild "C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\Platform.sln" /p:Configuration="Debug" /p:UseEnv=true /p:Platform="x64" /m:8 /p:PlatformToolset="v140" /verbosity:normal /p:ForceImportBeforeCppTargets="C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\conan_build.props;C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\conanbuildinfo.props"
-----------------
Microsoft (R) Build Engine version 14.0.25420.1

[...]

    20>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Current.targets(14,11): error MSB4115: The "exists" function only accepts a scalar value, but its argument "$(ForceImportBeforeCppTargets)" evaluates to "C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\conan_build.props;C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\conanbuildinfo.props" which is not a scalar value. [C:\dev\conan\platform\0.0.1\PORT\stable\build\0b258a3cc8a011fb233dfdd231934614cdc10438\SolutionPlatformCommonTasks\SolutionPlatformCommonTasks.vcxproj]

In both cases I can confirm it's setting the right directory for conanbuildinfo.props, but doesn't seem to like a semi-colon separated list of items for $(ForceImportBeforeCppTargets). Maybe a vs2015 issue?

( Note: I understand from discussion in #7805 (comment) that it's probably suboptimal to try to inject conanbuildinfo.props this way, but nevertheless I wouldn't have expected this error, which would also impede setting any other .props file )

Logs (Executed commands with output) (Include/Attach if Applicable)

@memsharded
Copy link
Member

Hi @michaelmaguire

yes, this seems very specific to VS2015.

The behavior is tested in user_properties_multifile_test test, with a full integration test, which is run in VS2017, so it totally seems that it is VS2015.

Do you know if VS2015 allows multiple ForceImportBeforeCppTargets properties in the command line, instead of a single one with multiple values separated by ";"?

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