Source-Python will not load

Please post any questions about developing your plugin here. Please use the search function before posting!
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Source-Python will not load

Postby arawra » Mon Jan 20, 2014 6:29 pm

After downloading and installing the master of Source-Python, it fails to load with this traceback:

Code: Select all

/addons/source-python/packages/source-python/loggers.py  line 246
    _level = CConVar.get(
AttributeError: type object 'CConVar' has no attribute 'get'


CConvar is imported from cvar_c

Win 7 (linux server runs too poorly for a server =( )
User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Jan 20, 2014 6:31 pm

Did you make your own build? We are in discussions about ConVars, but the current repository version does have a "get" method.

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 6:54 pm

User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Jan 20, 2014 7:00 pm

Ok, but the "master" is just the repo itself. In this state, it is "un-built", meaning you have to build your own binaries. If you do not do this, and simply upload the files, as is, to your server, you are only truly updating the Python API, and not the binaries themselves. You need to build the solution yourself to get those binaries:
http://www.sourcepython.com/showwiki.php?title=Wiki:Building+From+Source

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 7:05 pm

Ok I see what you were talking about with my own build. Looks like I would need to compile as the master does not have a binary in it.

E: Ninja'd XD
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 8:10 pm

Didn't want to have to download git. I am trying to compile from the master I downloaded. I also tried to download the master again and still got the same error (possibly corrupted upload?)

Code: Select all

Determining if the C compiler works failed with the following output:
Change Dir: D:/Source.Python-master/src/Build/CMakeFiles/CMakeTmp

Run Build Command :D :\MICROS~1.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2958815207


Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1>------ Build started: Project: cmTryCompileExec2958815207, Configuration: Debug Win32 ------

1>Build started 1/20/2014 3:08:21 PM.

1>PrepareForBuild:

1>  Creating directory "D:\Source.Python-master\src\Build\CMakeFiles\CMakeTmp\Debug\".

1>InitializeBuildStatus:

1>  Creating "cmTryCompileExec2958815207.dir\Debug\cmTryCompileExec2958815207.unsuccessfulbuild" because "AlwaysCreate" was specified.

1>ClCompile:

1>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86

1>  Copyright (C) Microsoft Corporation.  All rights reserved.

1> 

1>  cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp :p recise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2958815207.dir\Debug\\" /Fd"cmTryCompileExec2958815207.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport :p rompt testCCompiler.c

1> 

1>  testCCompiler.c

1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

1>

1>Build FAILED.

1>

1>Time Elapsed 00:00:00.45

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Jan 20, 2014 8:22 pm

I honestly do not get that at all, even when trying to build in Debug mode. It would be preferable if you used Release instead, but that probably won't fix this issue for you. I would recommend just going ahead and installing either git or TortoiseGit. I prefer using Bash to execute the commands myself, but like having TortoiseGit installed so I can see the file changes I have made much more easily. The error does suggest, though, that a file was corrupt. You might try deleting the "Build" folder that was created and try again. If that doesn't work, then getting git and cloning the repo will probably be the next thing to try.

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 9:06 pm

Got another corrupt message on my first pull, trying again...
Same error on second pull. Trying release build.
Same error on release.

Code: Select all

Determining if the C compiler works failed with the following output:
Change Dir: D:/Source.Python-master/Source.Python/src/Build/CMakeFiles/CMakeTmp

Run Build Command :D :\MICROS~1.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec4239575887


Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1>------ Build started: Project: cmTryCompileExec4239575887, Configuration: Debug Win32 ------

1>Build started 1/20/2014 4:11:49 PM.

1>PrepareForBuild:

1>  Creating directory "D:\Source.Python-master\Source.Python\src\Build\CMakeFiles\CMakeTmp\Debug\".

1>InitializeBuildStatus:

1>  Creating "cmTryCompileExec4239575887.dir\Debug\cmTryCompileExec4239575887.unsuccessfulbuild" because "AlwaysCreate" was specified.

1>ClCompile:

1>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86

1>  Copyright (C) Microsoft Corporation.  All rights reserved.

1> 

1>  cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp :p recise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec4239575887.dir\Debug\\" /Fd"cmTryCompileExec4239575887.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport :p rompt testCCompiler.c

1> 

1>  testCCompiler.c

1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

1>

1>Build FAILED.

1>

1>Time Elapsed 00:00:00.17

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Jan 20, 2014 9:16 pm

Very odd... Which Visual Studio are you using? Also, have you tried using Release instead of Debug? What exact steps have you been taking? Did you follow the tutorial?

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 9:27 pm

Code: Select all

CD /D D:\Source-Python
git clone git://github.com/yadda-yadda-yadda... myDir


After it finished downloading, I run configure-csgo.bat This is where I am getting the errors. This was after downloading CMake and ensuring it was in my path directory (echo %PATH%). Using 2010 as the tutorial instructs. Was going to go with 2013 but apparently it only works with Win8.
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Mon Jan 20, 2014 9:30 pm

I have another idea. I am logging out of my VPN right now and going to try it just on my own connection.

E: No change.
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Tue Jan 21, 2014 6:09 am

After some googling, installing VS 2010 SP1 fixed the problem. Playing with incremental linking did not work for me ( D:\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-CXX.cmake for the write flags ).

http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval

E: After compiling, I still get the original error from my first post!

Code: Select all

/addons/source-python/packages/source-python/loggers.py  line 246
    _level = CConVar.get(
AttributeError: type object 'CConVar' has no attribute 'get'


D:\Source-Python\src\Build\Release\source-python.dll was copied into csgo\addons\
and D:\Source-Python\src\Build\Release\core.dll was copied into csgo\addons\source-python\bin\

EE: I think I'm pulling the most recent code with git... going to try to compile from master source.

And all is well.
User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Jan 21, 2014 6:36 am

Glad you got your compiling issues sorted. As for the error still being there, Ayuto did fix the issue we were having that required us to use the "get" method instead of just instantiating the object. He did fix the Python side as well, by removing the instances of CConVar.get(). You will need to update your Python files on your server, as well, in order to get this update.

There are still ConVar issues that need to be looked into, but those will not affect the usage and will only be internal changes.

Again, if you do a "git pull", you will have the "master" already downloaded in your local repository. This will help you to not have to download "everything" each time you need to build. Once you do the pull, and everything is up-to-date, then build. But remember, that if there are changes to the Python side, you will need to update those files on your server, as well. The same goes with data files, resource files, etc... that might be updated.

Satoon

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 21 guests