Skip to content
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

Fix UE4 plugin compilation error in AgonesHook.h. #1358

Merged
merged 1 commit into from
Feb 24, 2020
Merged

Fix UE4 plugin compilation error in AgonesHook.h. #1358

merged 1 commit into from
Feb 24, 2020

Conversation

drichardson
Copy link
Contributor

@drichardson drichardson commented Feb 24, 2020

Moved AgonesHook.h and Model directory under Public, since two files, Model/GameServer.h
and Model/GameServerObjectMeta.h, are required to be public due to their
use in AgonesHook.h.

Arrange all C++ files under Private or Public directories to reduce
chance of this kind of problem happening again and to follow UE4
standard module layout.

Error observed before fix

  Building 4 actions with 6 processes...
    [1/4] Module.Agones.cpp
    In file included from E:/UnrealEngine/botg/Intermediate/Build/Linux/B4D820EA/ShooterGameServer/Development/Agones/Module.Agones.cpp:2:
    In file included from E:/UnrealEngine/botg/Plugins/Agones/Source/Agones/Agones.cpp:15:
    E:\UnrealEngine\botg\Plugins\Agones\Source\Agones\Public\Agones.h(19,10): fatal error: 'AgonesHook.h' file not found
    #include "AgonesHook.h"
             ^~~~~~~~~~~~~~
    1 error generated.

Testing Done

  1. Create default UE4 4.24.2 C++ project.
  2. Add Agones plugin
  3. Compile with DefaultBuildSettings = BuildSettingsVersion.V2 and DefaultBuildSettings = BuildSettingsVersion.V1 in Target.cs.

Compilation succeeds.

No functional tests performed.

Moved AgonesHook.h and Model directory under Public, since two files,
Model/GameServer.h and Model/GameServerObjectMeta.h, are required to be
public due to their use in AgonesHook.h.

Arrange all C++ files under Private or Public directories to reduce
chance of this kind of problem happening again and to follow UE4
standard module layout.
@drichardson
Copy link
Contributor Author

/assign @roberthbailey

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9e201fc9-27c4-47b6-813e-693420121dc4

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 9d2bb3ac-7987-463c-a0be-afdd26b2019f

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1358/head:pr_1358 && git checkout pr_1358
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.4.0-ebdc862

@domgreen
Copy link
Contributor

@drichardson would it be worth adding a README about the expected structure of UE4 plugins and a link to some docs ... when looking at this we found it hard to understand how to structure plugins.

@drichardson
Copy link
Contributor Author

@drichardson would it be worth adding a README about the expected structure of UE4 plugins and a link to some docs ... when looking at this we found it hard to understand how to structure plugins.

Yes, I think it would be worth it so that at least all UE4 plugin contributors are on the same page and that documentation, where available, can be directly referenced.

I'll create a separate PR for this.

@roberthbailey
Copy link
Member

would it be worth adding a README about the expected structure of UE4 plugins and a link to some docs

From the change it looks like the general idea is to put all header files into the public directory and all cpp files into the private directory. Is the guidance more complex than that?

@roberthbailey
Copy link
Member

The sdk conformance tests failed:

make[2]: *** [run-sdk-conformance-no-build] Error 1
includes/sdk.mk:139: recipe for target 'run-sdk-conformance-no-build' failed
make[1]: *** [run-sdk-conformance-test] Error 2
includes/sdk.mk:146: recipe for target 'run-sdk-conformance-test' failed
includes/sdk.mk:156: recipe for target 'run-sdk-conformance-test-go' failed
make: *** [run-sdk-conformance-test-go] Error 2

but since this SDK isn't part of the conformance tests, it's just a coincidence.

I'm going to re-start the tests to see if it's a flake.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: drichardson, roberthbailey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@drichardson
Copy link
Contributor Author

would it be worth adding a README about the expected structure of UE4 plugins and a link to some docs

From the change it looks like the general idea is to put all header files into the public directory and all cpp files into the private directory. Is the guidance more complex than that?

Yes, that's all the guidance that is needed for this change. The Public/Private separation is widely used in the engine's own modules, though the Private part is in fact optional, since anything not in Public (or one of the other explicitly listed in the build files PublicIncludePaths setting) will be private.

If you think the directory structure makes more documentation unnecessary, then fine. Otherwise let me know and I will create a README that explicitly talks about this.

Additionally, is there any way we can get a Windows machine to setup a build bot for the UE4 plugin so that we can at least catch compilation errors?

@roberthbailey
Copy link
Member

If you think the directory structure makes more documentation unnecessary, then fine. Otherwise let me know and I will create a README that explicitly talks about this.

I think a short README would be really helpful, and it gives us a place to put other guidance we want to add in the future so that it's easy for new contributors to find.

Additionally, is there any way we can get a Windows machine to setup a build bot for the UE4 plugin so that we can at least catch compilation errors?

This might be tricky. @markmandel and I have been talking about what it would take (licensing wise) to get some CI in place for UE and I don't think we have a satisfactory answer yet.

@drichardson
Copy link
Contributor Author

drichardson commented Feb 24, 2020

This might be tricky. @markmandel and I have been talking about what it would take (licensing wise) to get some CI in place for UE and I don't think we have a satisfactory answer yet.

In that case, can we at least add a pre-release checklist item to compile the plugin on:

  • the minimum supported version of UE4
  • the latest released version of UE4 (currently 4.24.2)

Otherwise, we will continue to have released versions of Agones whose UE4 SDKs don't even compile (e.g. #1320).

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 54b89dde-a2f6-44d8-b80a-2c1ca1ddaca9

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1358/head:pr_1358 && git checkout pr_1358
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.4.0-a2a59e5

@domgreen
Copy link
Contributor

Unsure why we didn't catch this locally ☹️ will investigate.

Would be great to have some pre-release checklists. Unreal licencing can be difficult to navigate.

@Ludea
Copy link
Contributor

Ludea commented Feb 24, 2020

I asked Azure to add Unreal on their platform #367

@roberthbailey roberthbailey merged commit f71ce2d into googleforgames:master Feb 24, 2020
@drichardson drichardson deleted the fix_compile_errors branch February 24, 2020 21:56
@markmandel markmandel added this to the 1.4.0 milestone Feb 26, 2020
@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs. labels Feb 26, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
Moved AgonesHook.h and Model directory under Public, since two files,
Model/GameServer.h and Model/GameServerObjectMeta.h, are required to be
public due to their use in AgonesHook.h.

Arrange all C++ files under Private or Public directories to reduce
chance of this kind of problem happening again and to follow UE4
standard module layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs. lgtm size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants