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

Error in download_test_data.vcxproj when compiling with Visual Studio 2019 16.7.7 Professional msbuild on Windows 10 2004 Professional #2594

Closed
1 of 2 tasks
Andreas-Schniertshauer opened this issue Jan 14, 2021 · 4 comments · May be fixed by #3765
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@Andreas-Schniertshauer
Copy link

I get the following error in the CustomBuild step of test\download_test_data.vcxproj when compiling with Visual Studio 2019 16.7.7 Professional msbuild on Windows 10 2004 Professional:

CustomBuild:
Downloading test data from https://github.com/nlohmann/json_test_data (v3.0.0)
Der Befehl "test" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Building Custom Rule ./test/CMakeLists.txt

The Command "test" is not found, because it does not exist on Windows.
"test -d json_test_data" is found in the CustomBuild step of the test\download_test_data.vcxproj project.

The problem is located in download_test_data.cmake "COMMAND test -d json_test_data || ...",
here "COMMAND if not exist json_test_data ..." should be used on Windows.

Please describe the steps to reproduce the issue.

  1. Download json-3.9.1.zip and unzip
  2. Open a Developer command Prompt v16.7.7
  3. cd json-3.9.1
  4. Create directory build and cd build
  5. cmake ..\ -D JSON_Install:BOOL=OFF -D JSON_ImplicitConversions:BOOL=OFF -D JSON_BuildTests:BOOL=ON
  6. msbuild nlohmann_json.sln
  7. msbuild nlohmann_json.sln

What is the expected behavior?

No error.

And what is the actual behavior instead?

Step 6:
CustomBuild:
Downloading test data from https://github.com/nlohmann/json_test_data (v3.0.0)
Der Befehl "test" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Building Custom Rule ./test/CMakeLists.txt

Step 7:
CustomBuild:
Downloading test data from https://github.com/nlohmann/json_test_data (v3.0.0)
Der Befehl "test" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
fatal: destination path 'json_test_data' already exists and is not an empty directory.
c:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6006: "cmd.exe" wurde mit dem Code 128 beendet. [build\test\download_test_data.vcxproj]

Which compiler and operating system are you using?

  • Compiler: Visual Studio 2019 16.7.7 Professional
  • Operating system: Windows 10 2004 Pro German

Which version of the library did you use?

  • [x ] latest release version 3.9.1

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
ctest --output-on-failure

did not work, there is mising a -C in the command

ctest -C Release --output-on-failure

would do the job, but an error is reported about json_test_data.
After deleting the json_test_data folder and executing

ctest -C Release --output-on-failure

it works.
Is also works without deleting the folder when "if exist" is used instead of "test" as reported on top of this post.

Total Test time (real) = 381.65 sec

The following tests FAILED:
51 - cmake_import_configure (Failed)
52 - cmake_import_build (Not Run)
53 - cmake_import_minver_configure (Failed)
54 - cmake_import_minver_build (Not Run)
57 - cmake_fetch_content_configure (Failed)
58 - cmake_fetch_content_build (Not Run)
Errors while running CTest

@nlohmann
Copy link
Owner

Similar to #2593, this issue does not occur on GitHub Actions or AppVeyor. Maybe you need to use a different shell? I'm not using Windows myself, so I don't know what the CI providers do differently.

@nlohmann nlohmann added platform: visual studio related to MSVC state: help needed the issue needs help to proceed labels Jan 14, 2021
@Andreas-Schniertshauer
Copy link
Author

I found it why there are differences see: #2593 (comment)

@Andreas-Schniertshauer
Copy link
Author

It can be solved see #2593 (comment)

@nlohmann
Copy link
Owner

Same fix: #2593 (comment)

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: help needed the issue needs help to proceed labels Jan 26, 2021
@nlohmann nlohmann closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants