Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BaerMitUmlaut
Copy link
Member

@BaerMitUmlaut BaerMitUmlaut commented Nov 13, 2017

When merged this pull request will:

  • Make some minor tweaks to allow compiling the extensions on Linux
  • Conform SQF extensions check for Linux server extensions support
    • Sub-class extensions with windows, linux, client and server properties
  • Add *.so support to build tools

I had to disable the advanced ballistics extension, the errors I was getting were in regards to a constexpr which I assume was because the lack of sufficient C++17 support in my gcc version (5.4). If somebody else wants to give it a try, be my guest.

@jonpas jonpas added this to the 3.13.0 milestone Nov 14, 2017
@dedmen
Copy link
Contributor

dedmen commented Dec 12, 2017

I'd still recommend Git LFS.
The Linux extensions add 5.6MB to the repo.
And the Linux extensions are all bigger than the Windows ones. I wonder why.

@jonpas
Copy link
Member

jonpas commented Dec 12, 2017

Probably wrong compiler flags, I did not look into that, just built them for testing.

@dedmen
Copy link
Contributor

dedmen commented Aug 15, 2018

Just got told by a dev working on the port that extension support is not there yet? I thought it was 🤔
Neither dll nor .so work on ports.

https://discordapp.com/channels/105462288051380224/105467328782692352/479182870984785921

@BaerMitUmlaut
Copy link
Member Author

Which is weird, they definitely work to some degree, I've tested them.

@fbt
Copy link

fbt commented Aug 20, 2018

The linux dedicated server has .so support, but not the client, apparently.
Were you testing on the server, by chance?

@jonpas jonpas self-assigned this Mar 23, 2019
@thojkooi
Copy link
Contributor

This will allow us to drop the sqf implementation for ACE medical wounds.

@dedmen
Copy link
Contributor

dedmen commented Mar 23, 2019

For reference on compiler flags to push the size down:
https://github.com/dedmen/ArmaScriptProfiler/blob/master/src/CMakeLists.txt#L104

@jonpas
Copy link
Member

jonpas commented Mar 25, 2019

Built extensions work:

"ace_medical" callExtension "version"
-> "3.12.0-af807b6"

Didn't manage to reduce file size yet though. Statically linking libgcc and libstdc++ takes majority of space but is pretty much required.

@dedmen's solution should work but I had trouble adding it to our extension setup so far.

@jonpas jonpas removed their assignment Mar 25, 2019
@dedmen
Copy link
Contributor

dedmen commented Mar 26, 2019

Statically linking libgcc and libstdc++ takes majority of space but is pretty much required.

I assume the linker doesn't optimize them and just takes them as a whole.

I'll do some testing, see if I can get size reduction.

This will allow us to drop the sqf implementation for ACE medical wounds.

Actually.. We only need medical right? These only work on dedicated server.
Advanced ballistics never runs on dedicated.
clipboard neither.
fcs also doesn't
break_line is only for rendering and also doesn't.
parse_imagepath is also only for interaction menu afaik?

@TheMagnetar
Copy link
Member

Yes. At the moment is only used for medical. However, if we can get rid of microsoft C/C++ extensions it would be better.

@dedmen
Copy link
Contributor

dedmen commented Mar 26, 2019

I had to disable the advanced ballistics extension, the errors I was getting were in regards to a constexpr which I assume was because the lack of sufficient C++17 support in my gcc version (5.4). If somebody else wants to give it a try, be my guest.

compiled just fine for me. on GCC 9 trunk. Not even a single warning.

Wow.. without static libc and libc++ medical goes down to 54K.

Couldn't find anything yet. The problem is definitely the static linking, Can't find any gcc commands to optimize statically linked libraries. If we really wanted to we could compile libc and libc++ ourselves with
-ffunction-sections -fdata-sections flags set, linking these should give the linker the ability to optimize everything out that it doesn't need.

Actually.. compiling libc is kinda hard. But! Libc is only about 40KB in linking. The rest 1,3MB are libc++. Which compiling yourself looks rather easy to do.

However, if we can get rid of microsoft C/C++ extensions it would be better.

What do you mean by that?

@jonpas
Copy link
Member

jonpas commented Mar 26, 2019

So you'd rather add 9 MB of yet another file than have 1 MB extension with library inside of it?

@dedmen
Copy link
Contributor

dedmen commented Mar 26, 2019

Only if you'd still stay on wanting all the libraries built for linux.
With all extensions present, we would have the 9MB back in after the second update of the extensions.

Maybe there is a better solution than putting it into the repo. CMake buildscript could just download it. CMake has built-in support for downloading.

@jonpas
Copy link
Member

jonpas commented Mar 26, 2019

we would have the 9MB back in after the second update of the extensions.

Final zip size would not change. And git history is really not a concern, run git gc --aggressive from time to time and you are good. GitHub reports it as less than 400 MB in size.

@jonpas jonpas self-assigned this May 11, 2019
@jonpas
Copy link
Member

jonpas commented May 13, 2019

Meeting note: Compile only medical extension, ignore unbuilt ones on Linux server in SQF checker.

Merge into medicalExtensionWork.

@jonpas jonpas changed the base branch from master to medicalExtensionWork September 6, 2019 11:51
Only Medical extension will be built for Linux
@jonpas
Copy link
Member

jonpas commented Sep 6, 2019

Note: Build extension in medicalExtensionWork after all other changes are part of that as well.

@jonpas
Copy link
Member

jonpas commented Sep 6, 2019

Confirmed working on Linux server with latest changes:

20:29:38 CallExtension loaded:   ace_medical (/home/jonpas/Data/Games/SteamLib/steamapps/common/arma3/mods/ACE3/ace_medical.so) [������]
20:29:38 [ACE] (common) INFO: Extension version: ace_medical: 3.12.3-14307c7

Version in [] is not showing, because Linux doesn't have metadata like Windows which Arma reads.

Copy link
Member

@jonpas jonpas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need info on where extensions might be used (client/server).

extensions[] += {"ace_advanced_ballistics"};
class ace_advanced_ballistics {
windows = 1;
client = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

extensions[] += {"ace_fcs"};
class ace_fcs {
windows = 1;
client = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

extensions[] += {"ace_break_line", "ace_parse_imagepath"};
class ace_break_line {
windows = 1;
client = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Could this be used on server theoretically?

};
class ace_parse_imagepath {
windows = 1;
client = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Could this be used on server theoretically?

@jonpas
Copy link
Member

jonpas commented Sep 28, 2019

One change this PR makes is it disables checks on server, something we currently actually do. I guess that's not a problem as anyone can still use it if they really want to, but the mission load is still faster due to less extension loading. So what @dedmen mentions above, we don't actually fix a security issue, we just officially don't support it (and won't build them for that platform).

This is ready to merge into medicalExtensionWork (changes from that branch included and required for this PR). No requirement to rebuild DLLs at this time.

@jonpas jonpas merged commit b36f787 into medicalExtensionWork Sep 28, 2019
jonpas pushed a commit that referenced this pull request Sep 28, 2019
* Fix Medical HandleDamageWounds memory leak (#6809)

* Use strncpy and disable MSVC unsafe warnings (#7171)
* Set 64-bit correctly from generator string, Disable SSE2 flag on 64-bit (non-existent)

* Tweaks for Linux extensions (#5762)
* Tweak CMakeLists for Linux compilation
* Conform SQF extensions check for Linux server extensions support
* Add *.so to tools
* Split extension check into Windows and Linux
* Disable Medical extension loading for now
* Add client/server separation to extension loading
* Add Arma config documentation on extension creation
@jonpas jonpas deleted the linux-extensions branch December 18, 2019 17:34
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.13.0-temp3 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Release Notes: **IMPROVED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants