-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Modernize Sample Extensions's AMBuildScript #2107
Modernize Sample Extensions's AMBuildScript #2107
Conversation
public/sample_ext/AMBuilder
Outdated
if not cxx.target.arch in sdk['platforms'][cxx.target.platform]: | ||
continue | ||
|
||
binary = Extension.HL2ExtConfig(project, builder, cxx, extName + sdk['extension'], sdk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a dot at extName + sdk['extension']
? I tried to compile it, got tank.ext2.tf2.so
instead of tank.ext.2.tf2.so
Hi @FortyTwoFortyTwo . Yeah I indeed missed a dot. Updated the scripts. Could you please test again? |
All works fine for Linux, though trying in windows gives me |
I was unable to reproduce this when compiling the sample_ext. Tried both x86 and x86_64 MSVC (Visual Studio 2022). |
Thanks for the update. However I noticed that when you use -static-libstdc++ it crashes when you pipe a number bigger than a char into iostream like this.
I am not sure we can do anything about this or whether it is preferential to dynamically link to stdc++ instead. SRCDS appears to dynamically link. However if we don't statically link to stdc++ it would mean extensions wouldn't be able to load on an OS running older versions of stdc++ which seems to be quite often. stdc++ versions often change every OS release. There should probably be a very big notice alerting the user about these problems either way. |
The issue is loosely connected to alliedmodders/metamod-source#167 the fix from that part needs to be backported to metamod 1.12 And applied there as well (that's how extensions are loaded) |
I'm assuming you mean sourcemod? It is already in metamod. I just added RTLD_DEEPBIND, recompiled sourcemod, and it still crashes. |
I did mean metamod. Currently the fix was applied to metamod 2.0, not 1.12.
Hmmm, I'll try investigating as well when I get the chance. |
I just checked, I'm already using 2.0, and double checked that it has the deepbind change. Metamod:Source Version Information |
- Pull alliedmodders/sourcemod#2107 wholesale to modernize the build script (multiplat, hl2sdk-manifests, safetyhook) and make some minor adjustments to support CDetour. - Stub out plugin compilation for now; it will be added in a separate commit to preserve readability. - Hoist reading 'tf2.items.nosoop' and add it as a fallback for GiveNamedItem. SM's gamedata updater will stomp all over any changes we make in asherkin's. - Fix sizing for reverse-engineered TF2 classes to match the 64-bit release. - Rename smsdk_ext.hpp since CDetour is picky about the filename.
- Pull alliedmodders/sourcemod#2107 wholesale to modernize the build script (multiplat, hl2sdk-manifests, safetyhook) and make some minor adjustments to support CDetour. - Stub out plugin compilation for now; it will be added in a separate commit to preserve readability. - Hoist reading 'tf2.items.nosoop' and add it as a fallback for GiveNamedItem. SM's gamedata updater will stomp all over any changes we make in asherkin's. - Fix sizing for reverse-engineered TF2 classes to match the 64-bit release. - Rename smsdk_ext.hpp since CDetour is picky about the filename.
Copying the HL2SDK manifest is no longer needed. Requires latest AMBuild.
Check if the manifest already exists in the project folder. If not, then search in the path specified by --hl2sdk-manifest-path.
Hi, @Kenzzer I've made the changes you requested. Please review and see if I didn't forgot anything. Both scripts compiled successfully on Debian with Clang 11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! I spotted one more issue, my apologies for not catching it in the earlier review. Otherwise I believe this is good to merge.
I'm ready to take this in. However I'd rather not shake up the build environments for current 3rd-party extensions, and introduce two competing standards, so I'm adding extra env var checks. Anyways, thanks for your work! |
7edf814
to
6872d64
Compare
Summary
This PR aims to modernize the AMBuildScripts of the sample extensions. Bringing them closer to SM own AMBuildScript and adding support for compiling 64 bits extensions.
Sample
The build script is based on SM own build script. It was updated to use the HL2SDK manifests and allow compiling for multiple archs. Minimum AMBuild version increased to 2.2.
Two new arguments added to configure.py.
Sample (NO SDK)
The build script was updated to allow compiling for multiple archs. Minimum AMBuild version increased to 2.2.
One new argument added to configure.py.