-
Notifications
You must be signed in to change notification settings - Fork 218
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
Xmake Improvements #494
Xmake Improvements #494
Conversation
Does this PR need to update the docs for creating a C++ mod ? |
Does this eventually link into the work you were doing for linux port? If so, some communication on where you are at for that would be nice. If not, improvements are nice and all, but there is not really much point in it if linux port remains stuck, as it being stuck for too long may warrant the switch back to cmake and try to fix the issues we had with it from that end instead, and your work here will be limited to an educational time expense. |
I am unclear on what the current blockers for the linux port are. I provided the workaround for triggering patternsleuth rebuild I also indicated what flag changes needed to be made for compilation without any manual setting of flags from the cli ["cxflags"] = {
"clang::-fno-delete-null-pointer-checks",
"clang::-stdlib=libc++",
"clang::-fexperimental-library"
},
["ldflags"] = {
"-stdlib=libc++",
"-fuse-ld=lld"
} If the linux contributors are opposed to using the workarounds for the time being then I'll submit a PR which includes the automatic patternsleuth rebuild without the aforementioned workaround. The rust behavior is the same on windows and linux so that work needs to be done anyways. That rust work is based on this PR, but I suppose I can extrapolate that work and submit a separate PR against main branch with the rust improvements. |
I don't know if there's a consensus surrounding which one of your solutions is preferred, but I made my opinion known on that. This doesn't seem like much of a blocker regardless because if I recall correctly, without solving this, at most it will require some extra effort when you make changes to PS or external dependencies. As far as compile and link flags are concerned, I don't know if the they've been implemented in the linux PR but this also shouldn't be a blocker since it's a solved problem as far as I know. Waiting on @Buckminsterfullerene02 to clarify if there's anything else blocking the linux PR when it comes to the build system. |
I thought there was still a blockage since nothing had been done on it in terms of actually implementing one of the solutions bitonality provided. I read that he was working on something with xmake which I thought was the Linux port implementing a preferred solution, but now I know it's this PR, so that clears up that miscommunication. In terms of Linux port, who is going to take responsibility for implementing whichever required solution? Currently it feels like everyone is assuming someone else is doing it when in fact it seems no one has. Perhaps @localcc ? Or are we waiting on other maintainers to provide their thoughts on their preferred solution? |
I am happy to work on the linux port xmake, just assumed that someone else was already doing it, I'll take it then |
As it is @Yangff that created the PR, I've pretty much been waiting for them to implement one of the solutions from @bitonality, but I'm sure they won't mind if @localcc gets it up and running so that they can get unblocked for the rest of the PR. As far as which solution, I can't tell you that but I can tell you that if I were taking up charge of the PR, I'd go with my stated preference because no one suggested anything else nor objected to it and you can only wait so long before continuing before it becomes entirely unreasonable to wait any longer. |
Also I'd like to point out that the last release was on Feb 14 and I don't believe the Linux port will be ready at any point soon, but please correct me if I'm wrong. |
imo we should do a 3.1 release with TSet support and linux can come later, we can't delay for much longer so we don't get another 3.0 incident. |
@localcc Did you mean to approve this PR even though your questions (that seem important, especially the second one) has yet to be answered, and are currently unresolved ? |
I agree with this. Who is in charge of making releases these days anyway ? |
hmm.. I was told that someone else is solving the rust issue with xmake.. and it would be nice if @localcc can solve that . After all, I'm not familiar with how xmake works internally.. Also, imgui (with graphical one) seems to work fine in their locales, although I can't get it to compile correctly.. |
I think for ci it should build without problem because it will be clean build anyway (correct me ?), and it's more about the development experience I think.. |
I agree that we don't want another 3.0, however there are some good reasons why I have not considered making a new release yet: build system C++ mod versioning If C++ developers update their mods to work on latest ue4ss version, it will not for the older versions, which most users will still be using. If some developers update their mods for latest and some don't, users will be forced to choose the version they want to stay on and thus have to lose access to the mod (or mod updates for older ones on new version) that is not on the version they are on. The issue is worsened due to the fact that mod managers don't really provide the same flexibility as manual install - that is, when a mod update is pushed, all users will recieve that update, and likely including the new dependency on new ue4ss version, which breaks all the other C++ mods not updated yet. Users have to manually downgrade to an older version of the C++ mod and ue4ss (if they understand this, which most users won't unless being explicitly told) until most/all of the C++ mod developers have updated their mods for the newest version of ue4ss. All this is to say, that frequent ue4ss updates that change ABI are no longer a luxury. We need to have a think about what to do before releasing updates, and updates should ideally be tested heavily before release (unlike 3.0 was, we had some last minute changes that were not tested well and thus caused bugs that were not acceptable to have in a major release; I take full responsibility for that) - as hotfixes (especially if spaced too far apart) will excarberate the problem. data table support Apologies for the mini essay but hope this clears up roughly what is going on in my head at least. |
This is the wrong place for this conversation but I'm confused why it would be "3.1" when xmake is the most breaking change possible. There are other breaking changes as well. |
Yes, much greater thought should be put into how we deal with releases. First of all, hotfixes are not supposed to be breaking in any way at all, that was never the intent. I think having dedicated branches for every version would be very helpful, that way we can make pull requests and upon merging into main we can also decide to back-port it into the current non-breaking version when it's appropriate. |
As far as end-users are concerned, the change to xmake theoretically doesn't have to be a breaking change but it's entirely possible (and probably likely) that the command lines that our xmake configs are generating are different to what our old cmake configs were generating which could cause the change to xmake to be breaking. As far as developers are concerned, I don't know if bumping the version number is appropriate for a build system change, because the version number is primarily meant to be used by end-users and mod developers to understand what versions of UE4SS their mods are compatible with. |
Continued in #498 let's keep the rest of discussions here for just this PR. |
Yeah the questions were clarified in DMs and should be clarified here as well, but the general state of the PR is green. |
xmake is supported by linux and works fine there, the issues we are having are caused by the lack of experience with it currently, but that's nothing that can't be fixed and definitely nothing that would warrant a switch back. data tables are pending and this requires the DynamicType library integration which I am slowly working on. |
@bitonality C++ mod docs needs updating - mod xmake.lua is wrong |
Everything seems to work good! |
This pull request attempts to:
Major improvements include:
Leveraging xmake
rules
to allow for modularon_config
,on_load
, etc overrides.Instead of having a globally defined
on_config()
function that automatically gets applied to all targets, we should use xmakerules
. Rules have their ownon_xxx()
functions that automatically get applied to any targets that have the rule assigned to them. This gives us finer control of which parts of the build system are responsible for applying any settings. The current setup of a globalon_config()
is that each target can only have ONEon_config()
. This means that any targets that need special logic in theiron_xxx()
functions have to duplicate code to call the commonon_xxx()
and then run their own logic. This leads to code duplication and increases the chance of developer error since each overriddenon_xxx()
lives in the target'sxmake.lua
file which makes tracking down these errors more difficult. Using rules to define theon_xxx()
behavior allows us to define the applying of settings in a single location.Here's a code based example to supplement the prior description:
But what if we want to add a "dog" define ONLY to the dog target?
Leveraging rules simplifies this whole process
Decrease the amount of mode parsing in the description scope
Previously, every call to
is_mode_debug()
andget_mode_runtimes()
required astring.gmatch()
to determine if the unreal mode (Game__Shipping__Win64
, etc.) had "Debug" or "Dev" as the middle part of the triple. This ends up being called a lot since we had to callis_mode_debug()
andget_mode_runtimes()
every time werequire()
a package to determine which flavor of the package to use (debug/release + MD/MDd). I've opted to leverageset_runtimes(get_mode_runtimes())
in the global scope which does the following:Applies the correct runtimes to every target - Removes the need to
Applies the correct runtimes to every package.
Add a directory for our custom xmake modules
Instead of having to store a
ue4ssScriptsRoot
or similar variable, I've opted to provide a directory to store any code that we want toimport()
into the lua script context.This also helps enforce scope segregation. Code defined in a module is intended to be used in the script scope (ex.
on_config()
,on_load()
,after_xxx()
, etc. It is intentionally impossible toimport()
in the description scope, so this helps make the intent more clear and promotes good code reuse.Use rules instead of custom metadata values for the UE4SS Dependency logic
Previously, any ue4ss dependencies had a special
set_values("ue4ssDep", true)
in their target definition. This is used to indicate that the target needs to add -D defines withRC_TARGET_EXPORTS
andRC_TARGET_BUILD_STATIC
. I've opted to create rules for these instead of setting an arbitraryue4ssDep
flag to indicate if we need to add the aforementioned defines.Streamline UE4SS installation
We can now use
xmake install --installdir=xxx
to copy the UE4SS.dll, UE4SS.pdb, and dwmapi.dll to the--installdir
. Nothing groundbreaking, but a nice quality of life addition.