alliedmodders / ambuild

AlliedModders C++ Build System
BSD 3-Clause "New" or "Revised" License
60 stars 31 forks source link

Windows can't generate configs for ambuild. #124

Closed HowToDoThis closed 4 years ago

HowToDoThis commented 4 years ago

Not sure did I missed some steps. I was trying to build SourceMod with the Tutorial from Here. But Windows can't generate configs for ambuild.

On Windows, ambuild or configure.py not working and thrown to this error.

D:\Code\Github\TestSourceMod\sourcemod\wbuild>python ..\configure.py --no-mysql --enable-optimize -s none --mms-path ../../mmsource-1.10/
Checking CC compiler (vendor test msvc)... ['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x86\\cl.exe', 'test.c', '-o', 'test-c.exe', '-nologo', '-showIncludes']
found msvc version 1927, x86
Checking CXX compiler (vendor test msvc)... ['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x86\\cl.exe', 'test.cpp', '-o', 'test-cxx.exe', '-nologo', '-showIncludes']
found msvc version 1927, x86
Warning: hl2sdk-episode1 was not found, and will not be included in build.
Warning: hl2sdk-ep2 was not found, and will not be included in build.
Warning: hl2sdk-css was not found, and will not be included in build.
Warning: hl2sdk-hl2dm was not found, and will not be included in build.
Warning: hl2sdk-dods was not found, and will not be included in build.
Warning: hl2sdk-sdk2013 was not found, and will not be included in build.
Warning: hl2sdk-tf2 was not found, and will not be included in build.
Warning: hl2sdk-l4d was not found, and will not be included in build.
Warning: hl2sdk-nucleardawn was not found, and will not be included in build.
Warning: hl2sdk-l4d2 was not found, and will not be included in build.
Warning: hl2sdk-darkm was not found, and will not be included in build.
Warning: hl2sdk-swarm was not found, and will not be included in build.
Warning: hl2sdk-bgt was not found, and will not be included in build.
Warning: hl2sdk-eye was not found, and will not be included in build.
Warning: hl2sdk-csgo was not found, and will not be included in build.
Warning: hl2sdk-blade was not found, and will not be included in build.
Warning: hl2sdk-insurgency was not found, and will not be included in build.
Warning: hl2sdk-contagion was not found, and will not be included in build.
Warning: hl2sdk-bms was not found, and will not be included in build.
Warning: hl2sdk-doi was not found, and will not be included in build.
Traceback (most recent call last):
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\prep.py", line 132, in Configure
    if not cm.generate(options.generator):
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\context_manager.py", line 93, in generate
    self.parseBuildScripts()
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 50, in parseBuildScripts
    self.execContext(cx)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 130, in execContext
    exec(code, scriptGlobals)
  File "D:\Code\Github\TestSourceMod\sourcemod\AMBuildScript", line 713, in <module>
    SP = builder.Build('sourcepawn/AMBuildScript', {
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context.py", line 157, in Build
    return self.cm.runBuildScript(self, path, vars or {})
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 68, in runBuildScript
    return self.runBuildScriptImpl(context, path, vars or {})
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 119, in runBuildScriptImpl
    scriptGlobals = self.execContext(cx)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 130, in execContext
    exec(code, scriptGlobals)
  File "D:\Code\Github\TestSourceMod\sourcemod\sourcepawn\AMBuildScript", line 351, in <module>
    sp.BuildSpcomp()
  File "D:\Code\Github\TestSourceMod\sourcemod\sourcepawn\AMBuildScript", line 268, in BuildSpcomp
    spcomp = self.BuildForArch('compiler/AMBuilder', cxx)
  File "D:\Code\Github\TestSourceMod\sourcemod\sourcepawn\AMBuildScript", line 331, in BuildForArch
    rvalue = builder.Build(scripts, new_vars)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context.py", line 157, in Build
    return self.cm.runBuildScript(self, path, vars or {})
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 68, in runBuildScript
    return self.runBuildScriptImpl(context, path, vars or {})
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 119, in runBuildScriptImpl
    scriptGlobals = self.execContext(cx)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 130, in execContext
    exec(code, scriptGlobals)
  File "D:\Code\Github\TestSourceMod\sourcemod\sourcepawn\compiler\AMBuilder", line 80, in <module>
    rvalue = builder.Add(binary)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\context.py", line 212, in Add
    taskbuilder.finish(self)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\cpp\builders.py", line 559, in finish
    self.buildModules(cx)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\cpp\builders.py", line 467, in buildModules
    self.buildModule(cx, module)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\cpp\builders.py", line 529, in buildModule
    obj_item = builder.buildItem(inputObj, sourceName, sourceFile)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\cpp\builders.py", line 215, in buildItem
    return self.buildRcItem(inputObj, sourceFile, encodedName)
  File "C:\Users\Vox Nein\AppData\Roaming\Python\Python38\site-packages\ambuild2\frontend\v2_2\cpp\builders.py", line 259, in buildRcItem
    assert not self.vendor.emits_dependency_files
AttributeError: 'MSVC' object has no attribute 'emits_dependency_files'
Configure failed: 'MSVC' object has no attribute 'emits_dependency_files'

On Windows WSL Ubuntu(Same machine, Same Code Path), it works and build successfully.

xein@Xein:/mnt/d/Code/Github/testsourcemod/sourcemod/build$ sudo python3 ../configure.py --no-mysql --enable-optimize -s none --mms-path ../../mmsource-1.10/
[sudo] password for xein:
Checking CC compiler (vendor test gcc)... ['clang', '-m32', 'test.c', '-o', 'test-c']
found clang version 10.0, x86
Checking CXX compiler (vendor test gcc)... ['clang++', '-m32', 'test.cpp', '-o', 'test-cxx']
found clang version 10.0, x86
Warning: hl2sdk-episode1 was not found, and will not be included in build.
Warning: hl2sdk-ep2 was not found, and will not be included in build.
Warning: hl2sdk-css was not found, and will not be included in build.
Warning: hl2sdk-hl2dm was not found, and will not be included in build.
Warning: hl2sdk-dods was not found, and will not be included in build.
Warning: hl2sdk-sdk2013 was not found, and will not be included in build.
Warning: hl2sdk-tf2 was not found, and will not be included in build.
Warning: hl2sdk-l4d was not found, and will not be included in build.
Warning: hl2sdk-nucleardawn was not found, and will not be included in build.
Warning: hl2sdk-l4d2 was not found, and will not be included in build.
Warning: hl2sdk-csgo was not found, and will not be included in build.
Warning: hl2sdk-insurgency was not found, and will not be included in build.
Warning: hl2sdk-bms was not found, and will not be included in build.
Warning: hl2sdk-doi was not found, and will not be included in build.
xein@Xein:/mnt/d/Code/Github/testsourcemod/sourcemod/build$

So, I think there is some bugs on building with MSVC?

dvander commented 4 years ago

Just fixed this, thanks - I need to add a test for rc compilation so this doesn't happen again.

HowToDoThis commented 4 years ago

Updated to latest commit and tested, working now!

D:\Code\Github\TestSourceMod\sourcemod\wbuild>..\configure.py --no-mysql --enable-optimize -s none
Note: upgrading database from version 5 to 6
Checking CC compiler (vendor test msvc)... ['cl', 'test.c', '-o', 'test-c.exe', '-nologo', '-showIncludes']
found msvc version 1927, x86
Checking CXX compiler (vendor test msvc)... ['cl', 'test.cpp', '-o', 'test-cxx.exe', '-nologo', '-showIncludes']
found msvc version 1927, x86
Warning: hl2sdk-episode1 was not found, and will not be included in build.
Warning: hl2sdk-ep2 was not found, and will not be included in build.
Warning: hl2sdk-css was not found, and will not be included in build.
Warning: hl2sdk-hl2dm was not found, and will not be included in build.
Warning: hl2sdk-dods was not found, and will not be included in build.
Warning: hl2sdk-sdk2013 was not found, and will not be included in build.
Warning: hl2sdk-tf2 was not found, and will not be included in build.
Warning: hl2sdk-l4d was not found, and will not be included in build.
Warning: hl2sdk-nucleardawn was not found, and will not be included in build.
Warning: hl2sdk-l4d2 was not found, and will not be included in build.
Warning: hl2sdk-darkm was not found, and will not be included in build.
Warning: hl2sdk-swarm was not found, and will not be included in build.
Warning: hl2sdk-bgt was not found, and will not be included in build.
Warning: hl2sdk-eye was not found, and will not be included in build.
Warning: hl2sdk-csgo was not found, and will not be included in build.
Warning: hl2sdk-blade was not found, and will not be included in build.
Warning: hl2sdk-insurgency was not found, and will not be included in build.
Warning: hl2sdk-contagion was not found, and will not be included in build.
Warning: hl2sdk-bms was not found, and will not be included in build.
Warning: hl2sdk-doi was not found, and will not be included in build.

D:\Code\Github\TestSourceMod\sourcemod\wbuild>