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 "Cannot match vs include prefix" #14

Closed
Telokis opened this issue Jan 5, 2020 · 24 comments
Closed

Error "Cannot match vs include prefix" #14

Telokis opened this issue Jan 5, 2020 · 24 comments

Comments

@Telokis
Copy link
Contributor

Telokis commented Jan 5, 2020

Describe the bug
Attempting to run sw build in my project prints the following error:
Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:1323, function detectMsvcPrefix: Cannot match vs include prefix.

This is probably environment related, I don't think it is easily reproducible.

Expected behavior
I expected sw to build my project.

To Reproduce
Steps to reproduce the behavior:

  1. sw build

Information:

  • sw --version
sw.client.sw version 0.3.1
git revision fa94bb323c990e038df2eeaffa7ba74b16bd7cc1 plus 1 modified files
assembled on 03.01.2020 13:30:13 Romance Standard Time
  • Windows 10 Education
  • Visual Studio 2017 Community. (Fresh, installed yesterday on a new Windows 10 system)
  • I am running the command on Git bash for Windows, in case it matters. (Latest version as of today)
@egorpugin
Copy link
Contributor

I've added explicit error message. Could you try it again?

sw.client.sw-0.3.1.exe.zip

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

This is what I get when I try sw build

Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:1328, function detectMsvcPrefix: Cannot match VS include prefix (regex_search failed):
aff3-27f6-151e-36fd.cpp
c1xx: fatal error C1356: unable to find mspdbcore.dll

stderr:
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

@egorpugin
Copy link
Contributor

Very helpful! Let me try to fix this.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

No problem. Let me know if I can help in any way!
(Can't wait to try sw)

@egorpugin
Copy link
Contributor

Also can you send me sw -trace build output?

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

----------------------------------------
Starting sw...
Checking remote version
Detected target: com.Microsoft.VisualStudio.VC.cl-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.cl-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.24.28314
Exception might be thrown from one of the modules, so not unloading them
Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:1328, function detectMsvcPrefix: Cannot match VS include prefix (regex_search failed):
4cd7-8304-8382-0d15.cpp
c1xx: fatal error C1356: unable to find mspdbcore.dll

stderr:
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

@egorpugin
Copy link
Contributor

egorpugin commented Jan 5, 2020

Ok, try next binary. Post outputs, also please check directories near cl.exe for mspdbcore.dll.

sw.client.sw-0.3.1.exe.zip

ps.: Thank you for your support! :)

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

----------------------------------------
Starting sw...
Checking remote version
Detected target: com.Microsoft.VisualStudio.VC.cl-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.cl-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.24.28314
Exception might be thrown from one of the modules, so not unloading them
Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:1458, function detectMsvcPrefix: Cannot match VS include prefix (regex_search failed):
f900-c2da-63a7-afcd.cpp
c1xx: fatal error C1356: unable to find mspdbcore.dll

stderr:
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.


command:
set Path=C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64

cd C:\Users\Telokis\Documents\Dev\Git\Rayon

"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe" ^
    "/showIncludes" ^
    "/c" ^
    "C:\\Users\\Telokis\\AppData\\Local\\Temp\\sw\\cliprefix\\f900-c2da-63a7-afcd.cpp" ^
    "/Fo:C:\\Users\\Telokis\\AppData\\Local\\Temp\\sw\\cliprefix\\f900-c2da-63a7-afcd.cpp.obj" ^
    "/I" ^
    "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include"

The DLL is present in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64.
The DLL is present in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\

PS: No problem, it's well deserved!

@egorpugin
Copy link
Contributor

It's strange.
We have C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64 in PATH.
You say, dll is there.

Maybe you could try to run those commands (from output) in cmd window?

> set Path=...
> cd ...
> cl.exe ...

@egorpugin
Copy link
Contributor

Oh, there won't be the source file there C:\\Users\\Telokis\\AppData\\Local\\Temp\\sw\\cliprefix\\f900-c2da-63a7-afcd.cpp. Create simple 1.cpp with #include <iostream>.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

I didn't think about trying SW from Windows CMD, here is the output:

C:\Users\Telokis\Documents\Dev\Git\Rayon>sw.client.sw-0.3.1.exe -trace build
----------------------------------------
Starting sw...
Checking remote version
Detected target: com.Microsoft.VisualStudio.VC.cl-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.cl-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\ml64.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.cl-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.16.27034
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\ml.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.16.27034
Detected target: com.Microsoft.VisualStudio.VC.cl-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x86\cl.exe
Detected target: com.Microsoft.VisualStudio.VC.link-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x86\link.exe
Detected target: com.Microsoft.VisualStudio.VC.lib-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x86\lib.exe
Detected target: com.Microsoft.VisualStudio.VC.ml-19.24.28314
Detected program: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x86\ml.exe
Detected target: com.Microsoft.VisualStudio.VC.libcpp-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.concrt-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.runtime-19.24.28314
Detected target: com.Microsoft.VisualStudio.VC.libcpp-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.concrt-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.runtime-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.libcpp-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.concrt-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.runtime-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.libcpp-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.concrt-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.runtime-15.9.28307.960
Detected target: com.Microsoft.VisualStudio.VC.libcpp-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.ATLMFC-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.concrt-16.4.29613.14
Detected target: com.Microsoft.VisualStudio.VC.runtime-16.4.29613.14
Cannot get size of string value: RegGetValue failed.
Found Windows Kit: 10
Found Windows10 Kit: 10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.ucrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.ucrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.ucrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.ucrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.um-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.um-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.um-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.um-10.0.17763.0
No include dir "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\km" found for library: km
Detected target: com.Microsoft.Windows.SDK.winrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.winrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.winrt-10.0.17763.0
Detected target: com.Microsoft.Windows.SDK.winrt-10.0.17763.0
Detected target: com.Microsoft.Windows.rc-10.0.10011.16384
Detected program: C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\rc.exe
Found Windows Kit: 8.1
Cannot get size of string value: RegGetValue failed.
No include dir "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um" found for library: um
No include dir "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\km" found for library: km
Host configuration: {"native":{"configuration":"release","library":"shared","mt":"false","program":{"asm":"com.Microsoft.VisualStudio.VC.ml-*","c":"com.Microsoft.VisualStudio.VC.cl-*","cpp":"com.Microsoft.VisualStudio.VC.cl-*","lib":"com.Microsoft.VisualStudio.VC.lib-*","link":"com.Microsoft.VisualStudio.VC.link-*"},"stdlib":{"c":"com.Microsoft.Windows.SDK.ucrt-10.0.17763.0","cpp":"com.Microsoft.VisualStudio.VC.libcpp-*","kernel":"com.Microsoft.Windows.SDK.um-*"}},"os":{"arch":"x86_64","kernel":"com.Microsoft.Windows.NT"}}
Selecting driver org.sw.sw.driver.cpp-0.3.1 for input C:/Users/Telokis/Documents/Dev/Git/Rayon/cppan.yml
build id 000001D0332D6470 performing void __cdecl sw::SwBuild::loadInputs(void)
using cppan frontend
Loading input "C:/Users/Telokis/Documents/Dev/Git/Rayon\\cppan.yml", settings = {"native":{"configuration":"release","library":"shared","mt":"false","program":{"asm":"com.Microsoft.VisualStudio.VC.ml-*","c":"com.Microsoft.VisualStudio.VC.cl-*","cpp":"com.Microsoft.VisualStudio.VC.cl-*","lib":"com.Microsoft.VisualStudio.VC.lib-*","link":"com.Microsoft.VisualStudio.VC.link-*"},"stdlib":{"c":"com.Microsoft.Windows.SDK.ucrt-10.0.17763.0","cpp":"com.Microsoft.VisualStudio.VC.libcpp-*","kernel":"com.Microsoft.Windows.SDK.um-*"}},"os":{"arch":"x86_64","kernel":"com.Microsoft.Windows.NT"}}
build id 000001D0332D6470 performing void __cdecl sw::SwBuild::setTargetsToBuild(void)
build id 000001D0332D6470 performing void __cdecl sw::SwBuild::resolvePackages(void)
Requesting dependency list from origin remote...
Exception in file D:\dev\cppan2\client2\src\sw\manager\api.cpp:130, function resolvePackages: Server error. Contact administrator, please.
Exception might be thrown from one of the modules, so not unloading them
Exception in file D:\dev\cppan2\client2\src\sw\manager\sw_context.cpp:117, function resolve: Package 'pvt.cppan.demo.boost.filesystem-1.68.0' is not resolved

(I don't use CMD, I use Git Bash so there may be an env mismatch somewhere)

@egorpugin
Copy link
Contributor

(I don't use CMD, I use Git Bash so there may be an env mismatch somewhere)

Oh. I'll try, maybe I can repro it locally.


Your log is ok now. Show your build script. From what I see, you need to fix packages (deps) from pvt.cppan.demo prefix to org.sw.demo.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

I don't have a build script yet, I didn't migrate so it's using my cppan.yml, there.

I'll try to create a sw.cpp to get the hang of it.

@egorpugin
Copy link
Contributor

I see. SW have some beginner support for CPPAN syntax (cppan.yml).
That is why it tries to work on your script without any changes.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

Oh. I'll try, maybe I can repro it locally.

Ok, let me know if I can do anything else!


I see. SW have some beginner support for CPPAN syntax (cppan.yml).
That is why it tries to work on your script without any changes.

Yes, I noticed that. I'm writing my sw.cpp file.
What is the purpose of api_name/ApiName?

@egorpugin
Copy link
Contributor

This is exactly for shared build.
You can write target.ApiName = "MY_API";.
Then in header MY_API void f(); and it marks function as exported.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

I hope you don't mind if I hijack this issue for asking help regarding my new sw.cpp.

Here it is:

void build(Solution& s)
{
  auto& engine = s.addTarget<StaticLibraryTarget>("engine");
  {
    engine.CPPVersion = CPPLanguageStandard::CPP17;

    // Files
    engine.Private += "Projects/Engine/Source/.*"_rr;
    engine.Private += "Projects/Engine/Include/.*"_rr;
    engine.Private += "Dependencies/json/Json.cpp";
    engine.Private += "Dependencies/json/Json.h";
    engine.Private += "Dependencies/json/Json-forwards.h";

    // Dependencies
    engine.Private += "org.sw.demo.boost.filesystem-1.68.0"_dep;

    // Include directories
    engine.Public += "Projects/Engine/Include"_id;
    engine.Public += "Dependencies/json"_id;
    engine.Public += "Dependencies/glm/include"_id;

    engine.ApiName = "RAYON_ENGINE_API";
  }

  auto& cli = s.addTarget<ExecutableTarget>("cli");
  {
    cli.CPPVersion = CPPLanguageStandard::CPP17;

    // Files
    cli.Private += "Projects/CLI/Source/.*"_rr;
    cli.Private += "Projects/CLI/Include/.*"_rr;
    cli.Private += "Projects/Engine/Include/.*"_rr;
    cli.Private += "Dependencies/json/Json-forwards.h";

    // Dependencies
    cli.Private += engine;
    cli.Private += "org.sw.demo.boost.filesystem-1.68.0"_dep;
    cli.Private += "org.sw.demo.boost.program_options-1.68.0"_dep;

    // Include directories
    cli.Private += "Projects/CLI/Include/"_id;
    cli.Private += "Dependencies/glm/include"_id;
  }
}

I get this error when I sw b (from CMD, this time)

[99/100] [org.sw.demo.boost.array-1.68.0]/[config]
Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:572, function execute1: When executing: [org.sw.demo.boost.array-1.68.0]/[config]
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(156): error C2065: 'TargetOptionsGroup': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(156): error C2065: 't': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(156): error C2059: syntax error: 'const'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(157): error C2143: syntax error: missing ';' before '{'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(157): error C2447: '{': missing function header (old-style formal list?)
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(164): error C2065: 'TargetOptionsGroup': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(164): error C2065: 't': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(164): error C2059: syntax error: 'const'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(165): error C2143: syntax error: missing ';' before '{'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(165): error C2447: '{': missing function header (old-style formal list?)
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(176): error C2065: 'TargetOptionsGroup': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(176): error C2065: 't': undeclared identifier
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(176): error C2059: syntax error: 'const'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(177): error C2143: syntax error: missing ';' before '{'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(177): error C2447: '{': missing function header (old-style formal list?)
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(192): error C3861: 'addPrivateDefinitions': identifier not found
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(193): error C3861: 'addSharedDefinitions': identifier not found
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(194): error C3861: 'addStaticDefinitions': identifier not found
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(202): error C3861: 'addPrivateDefinitions': identifier not found
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(203): error C3861: 'addStaticDefinitions': identifier not found
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(330): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(379): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(385): error C2676: binary '<<': 'T' does not define this operator or a conversion to a type acceptable to the predefined operator
        with
        [
            T=sw::TargetOptions
        ]
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(387): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(401): error C2676: binary '<<': 'NativeExecutedTarget' does not define this operator or a conversion to a type acceptable to the predefined operator
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(442): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(458): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(461): error C2676: binary '>>': 'sw::LibraryTarget' does not define this operator or a conversion to a type acceptable to the predefined operator
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(462): error C2676: binary '>>': 'sw::LibraryTarget' does not define this operator or a conversion to a type acceptable to the predefined operator
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(468): error C2039: 'Settings': is not a member of 'sw::Build'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\build.h(60): note: see declaration of 'sw::Build'
C:/Users/Telokis/Documents/Dev/sw/storage/pkg/70/e2/e531/src/sdir/sw.cpp(474): error C2039: 'fileWriteOnce': is not a member of 'sw::NativeCompiledTarget'
C:\Users\Telokis\Documents\Dev\sw\storage\pkg\1c\10\717f\src\sdir\src\sw\driver\command.h(22): note: see declaration of 'sw::NativeCompiledTarget'
command failed: exit code = 2

@egorpugin
Copy link
Contributor

Just use the latest boost (hope it's ok for you). Older versions are not updated for sw changes.

    // Dependencies
    engine.Private += "org.sw.demo.boost.filesystem"_dep; // without version = the latest

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

Ok thank you, that worked!
Is there a way to tell SW to output bin files to a specific directory of my choice?

And how would I convert the following cppan options?

local_settings:
  local_build: true
  build_dir: ./.cppan/build
  build:
    generator: Visual Studio 15 2017
    configuration: Release

root_project: rayon

@egorpugin
Copy link
Contributor

egorpugin commented Jan 5, 2020

  1. root_project
auto &p = s.addProject("rayon");
auto &t = p.addTarget ...
  1. local_build is defaulted in sw.

  2. build_dir defaulted to .sw. Cannot be changed at the moment. I have some preparations to make it custom, but not now.

  3. configuration: Release
    sw -config release ... or just -config r.

  4. generator: Visual Studio 15 2017
    You must write it as compiler version.
    sw -compiler msvc-19.16 ...

  5. Is there a way to tell SW to output bin files to a specific directory of my choice?

This is not very customizable yet. Outputs will be in .sw/out/*somedir*.
Where do you want to store outputs? I'll think how it could be implemented.


Also FYI: sw is able to generate very cool VS solutions. Just use generate command instead of build one like sw ... generate.

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

  1. Thanks, it's very clean but may I ask what it does, exactly? If I do not rely on a Visual Studio solution, is it useful?

  2. Good to know!

  3. .sw is fine for my needs.

  4. Very nice! If I may suggest something, it would be nice to have a command to list the available/possible configurations and their aliases. (I guess there is release and debug at least, which is enough for my needs anyway).
    What is the default config?

  5. Oh thank you, it's good. I have the same suggestion than for 4., it would be nice to have a command listing all available compilers. Especially because MSVC uses the most surprising versioning ever.
    I have both 2019 and 2017 on my computer, how do I know which one is used? (And where did you take the version 19.16 from? I know it's for the latest 2017 but I don't know where to find a reference for those.

  6. I just wanted to store the output to <repo>/bin so that I can use a custom launch task to run it with special args just by pressing F5. (I use VSCode as my IDE)


It's good that it can generate VS solutions. I may give it a try since I'm using VSCode for now. (I do JS dev at work so I'm used to its configuration)

@egorpugin
Copy link
Contributor

egorpugin commented Jan 5, 2020

1

We have boost, qt projects. They define top level project. Also it's possible to define subprojects myproject.mysubproject.etc.

4

Default config is release+shared build. You already can use any combination on command line you want:
sw -config d,r generate - generate VS solution with release and debug configs.
sw -static -config d,r,rwdi build - build static configs d,r and rel with deb info.
sw -static -shared -config d,r,rwdi build - build static and shared configs d,r and rel with deb info.
sw -mt ... - VS /MT builds with static stdlib.
And tons more! Run sw -help

5

Yeah, my knowledge comes from studying MS VS versions. And listing would be nice, but it's about documentation task. I'm pretty close to start working on it.

6

I'll think about it.


We are talking here mostly in question-answer mode. If you miss some feature more than that, feel free to open separate issue. It's simpler to track them for me also.

@egorpugin
Copy link
Contributor

This issue is fixed.
Run sw --self-upgrade to update sw client.
You could try it yourself in git-bash windows again.
Feel free to report any futher issues. :)

@Telokis
Copy link
Contributor Author

Telokis commented Jan 5, 2020

Thanks! I confirm that it seems to be fixed!

I created three issues (#15 , #16 , #17) related to our discussion.
Thank you so much for your work!

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