danielga / garrysmod_common Goto Github PK
View Code? Open in Web Editor NEWA repository of common bits for compilation projects based on Garry's Mod.
Home Page: https://github.com/danielga/garrysmod_common
License: Other
A repository of common bits for compilation projects based on Garry's Mod.
Home Page: https://github.com/danielga/garrysmod_common
License: Other
Basically I'm not sure if I'm reading it right but would this allow for creating versions of modules that can work on x64 when facepunch finally releases it for full usage on servers
Error: ...ents/gm_io_events/garrysmod_common/premake/generator.lua:340: attempt to call a nil value (global 'externalincludedirs')
revert eec45c4 or define externalincludedirs
This is when using the x86-64 version I have tried including everything in the sourcesdk its only mathlib that doesnt work.
==== Building mathlib (release_x86_64) ==== box_buoyancy.cpp ../../../mathlib/box_buoyancy.cpp:329:106: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] 329 | const int32 ALIGN16 g_SIMD_signmask_W[4] ALIGN16_POST = { 0x80000000, 0x80000000, 0x80000000, 0xFFFFFFFF }; | ^ ../../../mathlib/box_buoyancy.cpp:329:106: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] ../../../mathlib/box_buoyancy.cpp:329:106: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] ../../../mathlib/box_buoyancy.cpp:329:106: error: narrowing conversion of ‘4294967295’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] ../../../mathlib/box_buoyancy.cpp:330:99: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] 330 | const int32 ALIGN16 g_SIMD_signmask_NoW[4] ALIGN16_POST = { 0x80000000, 0x80000000, 0x80000000, 0 }; | ^ ../../../mathlib/box_buoyancy.cpp:330:99: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] ../../../mathlib/box_buoyancy.cpp:330:99: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32’ {aka ‘int’} [-Wnarrowing] make[1]: *** [mathlib.make:257: x86_64/Release/intermediate/mathlib/box_buoyancy.o] Error 1 make: *** [Makefile:111: mathlib] Error 2
Im compiling it on ubuntu server 20.04
[ERROR] lua/test.lua:49: Couldn't load module library! (The specified module could not be found.)
When a require the module. It happens when I use a function from another lib. I tested with D++, curl and Discord game SDK. My project is to create a module that interacts with discord.
No beta branch
Multiplayer
Windows 11
I don't know why this error occurs. Thanks for the help :).
it works well on master, but it returns nullptr on x86-64-support-sourcesdk
reproduce:
#include <GarrysMod/Lua/Interface.h>
#include <GarrysMod/Interfaces.hpp>
#include <GarrysMod/InterfacePointers.hpp>
#include <icvar.h>
GMOD_MODULE_OPEN() {
ICvar* icvar = InterfacePointers::Cvar();
if (!icvar) {
LUA->PushSpecial(GarrysMod::Lua::SPECIAL_GLOB);
LUA->GetField(-1, "print");
LUA->PushString("Failed to get ICvar interface!");
LUA->Call(1, 0);
LUA->Pop();
}
return 0;
}
Do you know which os can compile gmod module. Or a wsl ?
This is still on even older version of LuaJIT 2.0.4, damn Daniel, this is outdated by two luashared updates...
(i don't remember the changes between 2.0.4 and 2.0.5, so you're on your own for updating that.)
The following is the set of changes I have noticed between LuaJIT 2.0.5 (previous luashared version) and LuaJIT 2.1.0-beta3 (current luashared version).
lauxlib.h
(click meee)luaL_getn
, luaL_setn
, lua_ref
, lua_unref
,lua_getref
and luaL_reg
luaL_setfuncs
, luaL_pushmodule
, luaL_testudata
and luaL_setmetatable
luaL_newlibtable
and luaL_newlib
lua.h
(click meee)LUA_OK
(0) for thread statusLUA_GCISRUNNING
(9) option for gclua_version
, lua_copy
, lua_tonumberx
, lua_tointegerx
and lua_isyieldable
luaconf.h
(click meee)luajit.h
(click meee)LUAJIT_VERSION
, LUAJIT_VERSION_NUM
and LUAJIT_VERSION_SYM
luaJIT_profile_callback
luaJIT_profile_start
, luaJIT_profile_stop
and luaJIT_profile_dumpstack
_,
Currently trying to use premake5 on WSL with Ubuntu 16.04. when I run premake5 --os=linux gmake under the serversecure folder it runs into an issue with garrysmod_common
vaas_net@VAASNET:/mnt/c/linux_compiles/serversecure/gmsv_serversecure$ premake5 --os=linux gmake
Error: ...ecure/garrysmod_common/premake/config.v2.default.lua:4: attempt to call field 'target' (a nil value)
I have tried with and without the --os=linux in the command but the same issue occurs
OS - Debian GNU/Linux 10 (buster)
Premake5 - premake5 (Premake Build Script Generator) 5.0.0-beta1
garrysmod_common - master branch 72f62b4
-- premake5.lua
PROJECT_GENERATOR_VERSION = 3
newoption {
trigger = "gmcommon",
description = "Sets the path to the garrysmod_common (https://github.com/danielga/garrysmod_common) directory",
value = "path to garrysmod_common directory"
}
gmcommon = _OPTIONS.gmcommon or os.getenv "GARRYSMOD_COMMON"
assert(gmcommon, "You didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory.")
include(gmcommon)
CreateWorkspace { name = "network" }
CreateProject { serverside = true }
IncludeHelpersExtended()
IncludeSDKTier0()
IncludeSDKTier1()
IncludeSDKCommon()
IncludeDetouring()
includedirs "third-party/lua_threading"
runner@runner-1:~/gmsv_network$ premake5 gmake --gmcommon="$HOME/garrysmod_common"
Selected version 3 of the project generator
Error: /usr/bin/bitmap:1: unexpected symbol near '<\127>'
Delete or move /usr/bin/bitmap
, so premake5 can't find it:
runner@runner-1:~/gmsv_network$ premake5 gmake --gmcommon="$HOME/garrysmod_common"
Selected version 3 of the project generator
Error: /usr/bin/bitmap:1: unexpected symbol near '<\127>'
runner@runner-1:~/gmsv_network$ sudo mv /usr/bin/bitmap /usr/bin/bitmap.old
runner@runner-1:~/gmsv_network$ premake5 gmake --gmcommon="$HOME/garrysmod_common"
Selected version 3 of the project generator
Building configurations...
Running action 'gmake'...
Generated projects/linux/gmake/Makefile...
Generated projects/linux/gmake/gmsv_network.make...
Generated ../garrysmod_common/projects/linux/gmake/helpers.make...
Generated ../garrysmod_common/projects/linux/gmake/helpers_extended.make...
Generated ../garrysmod_common/scanning/projects/linux/gmake/Makefile...
Generated ../garrysmod_common/sourcesdk-minimal/projects/linux/gmake/tier1.make...
Generated ../garrysmod_common/sourcesdk-minimal/projects/linux/gmake/LZMA.make...
Generated ../garrysmod_common/detouring/projects/linux/gmake/detouring.make...
Generated ../garrysmod_common/detouring/projects/linux/gmake/hde.make...
Generated ../garrysmod_common/detouring/projects/linux/gmake/minhook.make...
Done (684ms).
Also found simillar issue: hoelzro/linotify#18
Alternatively, change the package.cpath
(maybe works, not tested)
Current package.path
/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua
Current package.cpath
/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so;/usr/bin/?.so
But there must be another way. These options are a little hacky, maybe something in garrysmod_common is the problem? (exactly in it, but where?)
When executing make config=release_x86_64 all
I receive this error and the compilation is terminated
../../../tier1/KeyValues.cpp: In member function ‘bool KeyValues::WriteAsBinary(CUtlBuffer&)’:
../../../tier1/KeyValues.cpp:2669:56: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive]
2669 | buffer.PutUnsignedInt( (int)dat->m_pValue );
| ^~~~~~~~~~~~~~~~~~
../../../tier1/KeyValues.cpp: In member function ‘bool KeyValues::ReadAsBinary(CUtlBuffer&, int)’:
../../../tier1/KeyValues.cpp:2773:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
2773 | dat->m_pValue = (void*)buffer.GetUnsignedInt();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../public/tier0/platform.h:42,
from ../../../public/tier1/utlvector.h:20,
from ../../../public/tier1/KeyValues.h:25,
from ../../../tier1/KeyValues.cpp:18:
../../../public/tier0/threadtools.h: In instantiation of ‘CInterlockedIntT<T>::CInterlockedIntT() [with T = int]’:
../../../public/tier0/threadtools.h:1130:22: required from here
../../../public/tier0/threadtools.h:446:75: error: narrowing conversion of ‘-1’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing]
446 | CInterlockedIntT() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T) == sizeof(long) ); }
| ^~~~~~~~~~~~~~~~~~~
In file included from ../../../public/tier1/utlvector.h:21:
../../../public/tier0/threadtools.h:446:75: error: size ‘-1’ of array is negative
446 | CInterlockedIntT() : m_value( 0 ) { COMPILE_TIME_ASSERT( sizeof(T) == sizeof(long) ); }
| ^~~~~~~~~~~~~~~~~~~
make[1]: *** [tier1.make:232: x86_64/Release/intermediate/tier1/KeyValues.o] Error 1
make: *** [Makefile:106: tier1] Error 2
I triple checked that I am using the x86-64 branch of garrysmod_common and I also manually inserted the x86-64 branch of sourcesdk-minimal into my garrysmod_common directory (and renamed each to garrysmod_common/sourcesdk-minimal)
Premake config was executed with ./premake5 --os=linux --gmcommon=../garrysmod_common gmake2
PROJECT_GENERATOR_VERSION = 3
defines "_M_X64"
newoption({
trigger = "gmcommon",
description = "Sets the path to the garrysmod_common (https://github.com/danielga/garrysmod_common) directory",
value = "../garrysmod_common"
})
local gmcommon = assert(_OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON"),
"you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory")
include(gmcommon)
CreateWorkspace({name = "rustyprops", abi_compatible = false, path = "projects/" .. os.target() .. "/" .. _ACTION})
CreateProject({serverside = true, source_path = "source", manual_files = false})
IncludeLuaShared()
IncludeHelpersExtended()
IncludeSDKCommon()
IncludeSDKTier0()
IncludeSDKTier1()
IncludeSDKLZMA()
IncludeScanning()
IncludeDetouring()
When compiling on x64
I get the following errors (Using the same premake config and premake5.exe --os=windows --gmcommon=../garrysmod_common vs2022
)
Case "#if defined ARCHITECTURE_X86_64"
missing its
const Symbol net_sockets
https://github.com/danielga/garrysmod_common/blob/master/helpers_extended/source/Symbols.cpp#L54
** Warning: os.get() is deprecated, use 'os.target()' or 'os.host()'.
@C:/Users/Swadical/Data/garrysmod_common/config.lua(4)
** Warning: os.is() is deprecated, use 'os.istarget()' or 'os.ishost()'.
@...wadical/Data/garrysmod_common/premake/pkg_config.lua(1)
Hi there, I was wondering if there was an issue with the internal state within the module? I'm trying to use some internal lua functions (i.e: lua_gettop) which I pass in the state from (LUA->GetState()) but the server instantly crashes when it's executed. I'm using the x64 branch along with the x64 github branch. Example code is below which will cause a crash:
GMOD_MODULE_OPEN()
{
std::cout << "lua_gettop = " << lua_gettop(LUA->GetState()) << std::endl;
return 0;
}
Not sure if it's something I'm doing wrong or if there's an issue currently but feel free to correct me if I'm doing something wrong, thanks.
How do I compile a gmsv_project_win32.dll using gmake2 on linux?
Is the x64 support support finished for this?
Also, it seems that gmod-module-base has switched to CMake. Seeing as CMake is basically the defacto build tool for C++ (especially because of nice CMake is as of 3.13),.
Do you have any plans to switch this library to use CMake?
I've been trying to get the IClientEntityList pointer following the examples inside of InterfacePointers.cpp
but it seems that it cannot find it for some reason (I am compiling this in 32-bit and as a server module).
is there any guide on how to grab such interfaces? it would be nice to have a wiki section with this kind of information.
How come tier2 and tier3 libs aren't supported, and are there any future plans to support it?
If there aren't any future plans, is there a way to hack in the IMaterial system for x64?
It seems for some reason the ValueIsFalsy
function does not get imported correctly?
https://github.com/SpaceAgeMP/gm_luaerror/actions/runs/8515194689/job/23537569583
Just yields
ValueIsFalsy: D:\a\gm_luaerror\gm_luaerror\dependencies\garrysmod_common\build\build.ps1:17
Line |
17 | if (ValueIsFalsy $DISABLE_32BIT) {
| ~~~~~~~~~~~~
| The term 'ValueIsFalsy' is not recognized as a name of a cmdlet, function, script file, or executable program.
| Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The build code is effectively
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString("$env:BOOTSTRAP_URL")) # bootstrap.ps1
& "$env:BUILD_SCRIPT" # build.ps1
PowerShell (unlike bash) separates environment from other variables.
So setting DISABLE_64BIT = "true"
as an environment variable does in fact not propagate into $DISABLE_64BIT
but only into $env:DISABLE_64BIT
.
Or are those variables supposed to be set in another way?
In my PR I had the $env:
because I intended this to work with env vars initially.
edit: the enter key auto-posted this issue before I could write out the issue text...
Line 66 in c46222d
StaticRuntime
in the flags table...StaticRuntime
in the flags table still so just going to see what the github master of premake uses...
edit2: yeah, premake master seems to use staticruntime()
I wish hitting enter in an issues title didn't post...
I get this error when trying to compile serversecure:
Error: garrysmod_common-master/premake5.lua:197: invalid value 'C++11' for language
I've tried to use premake5 alpha 10 and premake5 alpha 11.
dunno when it happened but a working sig is
\x55\x8b\xec\x83\xec\x28\x53\x8b\x5d\x08\x83\x7b\x18\x10
The ABICompatibility check seems to fail on modern VS2022 versions
According to https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170#service-releases-starting-with-visual-studio-2017 the newest currently is 1940
.
This causes compilation to break on GitHub actions runner windows-2022
/ windows-latest
.
Is this the official repo for Garry's mod modules now?
👎 pls fix or i will report u to valve and facepunch and microsoft and apple and and and...
💀
Platform: Windows x64
Configuration: ReleaseWithSymbols
Error (active) E0147 declaration is incompatible with "const Symbol Symbols::Steam3Server" (declared at line 72 of "..\garrysmod_common\helpers_extended\source\Symbols.cpp") helpers_extended ..\garrysmod_common\helpers_extended\include\GarrysMod\Symbols.hpp 25
Can this be used to make 64 bit binaries and if so, am I missing something?
Is there an alternative to LUA->RunString?
I'm unsure why this would be the case but sv_parallel is critical for server performance on a populated Garry's mod server.
Using sourcenet or my basic module that detours this causes sv_parallel_sendsnapshot to no longer work so the server no longer uses a separate thread for networking.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.