Skip to content

fix: UNetTransportEditor compiler error#2217

Closed
DenninDalke wants to merge 1 commit intodevelopfrom
fix/wrap_unettransporteditor
Closed

fix: UNetTransportEditor compiler error#2217
DenninDalke wants to merge 1 commit intodevelopfrom
fix/wrap_unettransporteditor

Conversation

@DenninDalke
Copy link
Copy Markdown
Contributor

When UNet isn't present, it currently throws these compiler errors:

c:\com.unity.netcode.gameobjects-4\com.unity.netcode.gameobjects\Editor\HiddenScriptEditor.cs(2,32): error CS0234: The type or namespace name 'UNET' does not exist in the namespace 'Unity.Netcode.Transports' (are you missing an assembly reference?)
c:\com.unity.netcode.gameobjects-4\com.unity.netcode.gameobjects\Editor\HiddenScriptEditor.cs(27,26): error CS0246: The type or namespace name 'UNetTransport' could not be found (are you missing a using directive or an assembly reference?)

This PR fixes that by wrapping the dependency in an ifdef.

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

@DenninDalke DenninDalke requested a review from a team as a code owner September 23, 2022 01:12
@@ -1,5 +1,4 @@
using Unity.Netcode.Components;
using Unity.Netcode.Transports.UNET;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the fix but I think this should've been caught by CI — are we not testing any Unity version without UNet? I think we need to add that newer Unity version into our CI pipeline so that we could catch future UNet-related issues earlier @ashwinimurt

(also, which Unity version you were using @DenninDalke?)

Copy link
Copy Markdown
Contributor

@ashwinimurt ashwinimurt Sep 23, 2022

Choose a reason for hiding this comment

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

thanks for the fix but I think this should've been caught by CI — are we not testing any Unity version without UNet? I think we need to add that newer Unity version into our CI pipeline so that we could catch future UNet-related issues earlier @ashwinimurt

(also, which Unity version you were using @DenninDalke?)

@ThusSpokeNomad We do not run any 2022.2 / trunk CI (where Unet is removed) as part of our PR checks. So the PR got merged. The nightlies would have failed anyway.
Should I add a 2022.2 config to the PR triggers?
edit: the nightlies just failed for 2022.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the fix but I think this should've been caught by CI — are we not testing any Unity version without UNet? I think we need to add that newer Unity version into our CI pipeline so that we could catch future UNet-related issues earlier @ashwinimurt

(also, which Unity version you were using @DenninDalke?)

@ThusSpokeNomad @DenninDalke I believe this is better fix #2214
Lets close this PR and merge @ShadauxCat's PR above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIK, 2022.2 is still a pre-release, so I can't really tell whether or not to "absolutely" add it to CI pipeline — but if you think it'd be a low-effort and we don't have huge blockers preventing us from doing it, I do find it beneficial to add 2022.2 (or 2022.x in general) to our CI pipeline.

I also agree that #2214 seems like a more proper fix for this issue with asmdef guarding.

I'll leave CI changes decision up to you @ashwinimurt, whenever you think we should, we will.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have 2022.2 in CI, its not part of PR Triggers, it runs nightly. I can add one of the 2022.2 configs to PR triggers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was testing it with 2022.2.0b5 I'll close this PR, thanks for the insights!

Copy link
Copy Markdown
Collaborator

@ShadauxCat ShadauxCat left a comment

Choose a reason for hiding this comment

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

Please see #2214 which was already created to fix this and does so in a more ideal way.

Comment thread com.unity.netcode.gameobjects/Editor/HiddenScriptEditor.cs
Comment thread com.unity.netcode.gameobjects/Editor/HiddenScriptEditor.cs
@DenninDalke DenninDalke deleted the fix/wrap_unettransporteditor branch September 23, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants