How to build Source.Python?

All other Source.Python topics and issues.
lime
Junior Member
Posts: 7
Joined: Fri Jul 22, 2016 11:45 pm

How to build Source.Python?

Postby lime » Fri Jul 22, 2016 11:51 pm

It seems the build server is down, so I was wondering if anyone has the requirements and steps for building and installing Source.Python, from source. The docs only seem to refer to downloading and installing the precompiled binaries.

I've been able to compile latest master branch on Linux locally, and get a CS:GO server to load the SOs, but the binaries themselves error out after being loaded. I think I'm just missing some unknown build environment requirement here.

Can anyone help?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: How to build Source.Python?

Postby L'In20Cible » Sat Jul 23, 2016 12:01 am

What are the errors?
lime
Junior Member
Posts: 7
Joined: Fri Jul 22, 2016 11:45 pm

Re: How to build Source.Python?

Postby lime » Sat Jul 23, 2016 12:13 am

Right now I'm getting this:

Code: Select all

[Source.Python] Loading...
TypeError: No Python class registered for C++ class CFunctionInfo
[Source.Python] Failed to initialize internal modules.
[Source.Python] Could not initialize python.
Failed to load plugin "addons/source-python"
[Source.Python] Unloading...
Traceback (most recent call last):
  File "/mnt/vdb1/steam/install_dir/csgo/addons/source-python/packages/source-python/__init__.py", line 34, in <module>
    from loggers import _sp_logger  # It's save to import this here
  File "/mnt/vdb1/steam/install_dir/csgo/addons/source-python/packages/source-python/loggers.py", line 24, in <module>
    from cvars import ConVar
  File "/mnt/vdb1/steam/install_dir/csgo/addons/source-python/packages/source-python/cvars/__init__.py", line 10, in <module>
    from _cvars import ConVar
ImportError: No module named '_cvars'
[Source.Python] Failed to unload the main module.
[Source.Python] Unloaded successfully.


but it would be really nice to have some official documentation on how to replicate the build properly.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: How to build Source.Python?

Postby L'In20Cible » Sat Jul 23, 2016 12:31 am

There is no documentation, as you shouldn't be required to build it manually yourself. I didn't have the chance to talk with Ayuto or Necavi (both being currently offline) but I'm sure the buildbot being down is temporarily and will be back up soon enough.

As for the error you get, it tells me that no python module has been registered on the c++ side (_cvars being the first one alphabetically). Could you add -developer to your startup command line? That should generates more debug messages.

EDIT: Necavi is currently looking into it! builds.sourcepython.com is back up and running, thanks Necavi! :smile:
lime
Junior Member
Posts: 7
Joined: Fri Jul 22, 2016 11:45 pm

Re: How to build Source.Python?

Postby lime » Sat Jul 23, 2016 2:33 pm

Thanks for putting the precompiled builds back up, but now I'm getting this:

Code: Select all

[Source.Python] Loading...
PreMinidumpCallback: updating dump comment
assert_20160723092038_1.dmp[20726]: Uploading dump (out-of-process)
/tmp/dumps/assert_20160723092038_1.dmp
assert_20160723092038_1.dmp[20726]: Finished uploading minidump (out-of-process): success = yes
assert_20160723092038_1.dmp[20726]: response: Discarded=1
assert_20160723092038_1.dmp[20726]: file ''/tmp/dumps/assert_20160723092038_1.dmp'', upload yes: ''Discarded=1''
Segmentation fault (core dumped)


That's with the latest July 19th build. CS:GO server is up to date, and runs fine without Source.Python installed.

I've tried adding '-developer' but that doesn't seem to generate any additional logs. I tried '-debug', but the log generated by that has nothing useful in it either.

I'm running 4.5.5-300.fc24.x86_64 (Fedora 24) if that makes a difference.

Any ideas?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: How to build Source.Python?

Postby L'In20Cible » Sun Jul 24, 2016 12:13 am

Are you sure nothing else gets printed to the console after "[Source.Python] Loading...?" when "-develper" is enabled?
lime
Junior Member
Posts: 7
Joined: Fri Jul 22, 2016 11:45 pm

Re: How to build Source.Python?

Postby lime » Sun Jul 24, 2016 4:57 pm

Fairly certain. It doesn't appear to make a difference in the output.
lime
Junior Member
Posts: 7
Joined: Fri Jul 22, 2016 11:45 pm

Re: How to build Source.Python?

Postby lime » Sun Jul 24, 2016 5:10 pm

I was able to get SP to work with the Windows CS:GO dedicated server. That will at least let me develop and test some, but I'd still like to figure out how to use it with the Linux version in the long run.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: How to build Source.Python?

Postby satoon101 » Sun Jul 24, 2016 7:49 pm

I'm crashing with build 409 on Linux, as well. Here is the output I am seeing:



*Edit: nevermind this post... I forgot I had the server.cfg setup to plugin_load "addons/source-python" for testing loading SourceMod with Source.Python on the same server, which caused it to try to load twice. After I removed that, I have no issues.

*Edit2: though, I feel a bit confused that Valve would not have a check before loading a plugin to see if it is already loaded.
Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: How to build Source.Python?

Postby L'In20Cible » Sun Jul 24, 2016 8:26 pm

Is that the logs of a single startup?

EDIT: Just saw your edits, was checking the logs and I noticed it was loading twice and was confusing. :grin:
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: How to build Source.Python?

Postby Ayuto » Mon Jul 25, 2016 9:37 pm

CS:GO on Linux is working fine for me. To print additional output you need to add +developer 5 to the command line. And -debug is always helpful.
jballou
Junior Member
Posts: 2
Joined: Sun Jul 17, 2016 2:27 am

Re: How to build Source.Python?

Postby jballou » Sat Jul 30, 2016 2:44 pm

If anyone thinks it'd be useful, I am working on adding Source.Python into my SRCDS Docker images for Insurgency, which will be a one-button deployment for a complete functioning game server with whichever build is specified. If a build/test environment list is available, I can try to make Dockerfiles for several of your use cases to help get new people ready to write plugins without a lot of setup hassle. I've been using it for working with SourceMod, specifically extensions which have different glibc dependencies, and it's been exceedingly helpful for me.

I can also help out if you want to make your buildbot generate artifacts or Docker images as part of the build process. I am just getting my feet wet with Source.Python, but once I start getting stuff working I'll put it all on my GitHub. If anyone more familiar with the project wants to give me some background and needs so I can focus on the stuff you guys find useful, feel free to ping me.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: How to build Source.Python?

Postby satoon101 » Sat Jul 30, 2016 3:00 pm

That's awesome! Though, I don't think Source.Python works for Insurgency, yet. It is an engine/game I think we should look to support, but currently don't. I don't know if creating Docker images is something we want to have as part of the build process, but it sounds intriguing.
Image
jballou
Junior Member
Posts: 2
Joined: Sun Jul 17, 2016 2:27 am

Re: How to build Source.Python?

Postby jballou » Sat Jul 30, 2016 3:20 pm

Yeah, I worked a bit with asherkin on the vtable dumper for SourceMod, and getting Insurgency supported in SourceMod. I wrote a majority of publicly available popular Insurgency specific SourceMod plugins, and I'm looking to do the same for Source.Python if I can. A great example of something I'm wholly unqualified for, but since nobody else is doing it, I'll muddle through :)
User avatar
La Muerte
Administrator
Posts: 180
Joined: Sun Jul 15, 2012 1:48 pm
Location: Belgium
Contact:

Re: How to build Source.Python?

Postby La Muerte » Sat Jul 30, 2016 3:31 pm

Docker images could be very helpful in certain specific scenario's. If those that would be willing/able to use it could generate the docker images on their end, customized to their needs, that'd be pretty awesome. I wonder how the procedure for that would look like.
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: How to build Source.Python?

Postby BackRaw » Sat Jul 30, 2016 4:27 pm

I would also like to see how these Docker images can help! Go for it :D
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: How to build Source.Python?

Postby satoon101 » Sat Jul 30, 2016 5:00 pm

jballou wrote:Yeah, I worked a bit with asherkin on the vtable dumper for SourceMod, and getting Insurgency supported in SourceMod. I wrote a majority of publicly available popular Insurgency specific SourceMod plugins, and I'm looking to do the same for Source.Python if I can. A great example of something I'm wholly unqualified for, but since nobody else is doing it, I'll muddle through :)

We certainly appreciate any help in this regard! If you have any questions for us, don't hesitate to ask.
Image

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 34 guests