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 Build/Update Boost on Windows (non-PR-754 version) #789

Merged

Conversation

stephengtuggy
Copy link
Contributor

@stephengtuggy stephengtuggy commented Jun 19, 2023

Thank you for submitting a pull request and becoming a contributor to the Vega Strike Core Engine.

Please answer the following:

Code Changes:

Issues:

Purpose:

  • What is this pull request trying to do? Update Boost on Windows, on the master branch.
  • What release is this for? 0.9.x
  • Is there a project or milestone we should apply this to? 0.9.x

@stephengtuggy stephengtuggy added this to the 0.9.x milestone Jun 19, 2023
@stephengtuggy stephengtuggy self-assigned this Jun 19, 2023
@stephengtuggy
Copy link
Contributor Author

Please note also that this looks like a very large changed-line count, but probably at least 1,000 of those are just whitespace changes.

@BenjamenMeyer
Copy link
Member

BenjamenMeyer commented Jun 21, 2023

@stephengtuggy Some links to try out:

@stephengtuggy stephengtuggy mentioned this pull request Sep 4, 2023
1 task
engine/src/cmd/collide_map.cpp Outdated Show resolved Hide resolved
@royfalk
Copy link
Contributor

royfalk commented Sep 12, 2023

Gameplay seems fine. I'll try and review the code on my machine tomorrow.

Copy link
Contributor

@royfalk royfalk left a comment

Choose a reason for hiding this comment

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

Looks fine overall. I'd appreciate separating the cosmetic from the code and the code from the CICD stuff where possible.

cmakeGenerator: VS16Win64
- os: windows-2022
cmakeGenerator: Ninja
- os: windows-2019
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we really testing all these variants? It may be a bit excessive IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. We can probably cut back a bit.

Copy link
Member

Choose a reason for hiding this comment

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

let's just stick to 1 Windows build for the time being; that should at least get the ball rolling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about 2 Windows builds? One on Windows (Server) 2019, and one on Windows (Server) 2022. I think that will be enough even to satisfy me, haha.

Copy link
Member

Choose a reason for hiding this comment

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

@stephengtuggy if we need to

Copy link
Member

@BenjamenMeyer BenjamenMeyer Nov 12, 2023

Choose a reason for hiding this comment

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

well, VS2022 on Windows 2022 passed; while VS2019 on Windows 2019 failed. Just noting since we're going to merge this PR without fully fixing that.

# OpenGL_GL_PREFERENCE: 'GLVND'
# ENABLE_PIE: 'OFF'
# allow_failure: false
- FROM: 'ubuntu:kinetic'
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I think we need to restrict our officially supported everything. We are not a large corporation and even there I don't recall supporting so many versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. The policy we decided on last was to support the LTS versions of distros such as Ubuntu that are still in mainstream support, as well as the latest. We may have to revisit that a bit; it's turning out to be more than I can handle lately.

Copy link
Member

Choose a reason for hiding this comment

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

It's generally best effort right now. If we need to drop something because we don't have the bandwidth then that's fine - let's just document it and why.

That said, most of our distros are highly related with some simple packaging changes between them so I don't think it's a huge effort for Linux. Mac/Windows, OTOH, are still in a larger need of support and we could certainly use some help there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely.

Copy link
Member

Choose a reason for hiding this comment

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

So Kinetic is no longer supported since Manic is out. Will fix in master.

.github/workflows/gh-actions-pr.yml Show resolved Hide resolved
engine/CMakeLists.txt Outdated Show resolved Hide resolved
engine/src/cmd/base_init.cpp Show resolved Hide resolved
@@ -45,7 +43,7 @@ class Collidable {
Unit *unit;
unsigned int bolt_index;
}
ref;
ref{};
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do? I assume it's defined either way.
Also, can we fix the indentation. It's handing out there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the empty braces initializes the value of ref. It was uninitialized previously, as far as I can tell.

Copy link
Member

Choose a reason for hiding this comment

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

C++11 initialization method; we've generally stuck to constructor initialization but we've started getting more C++11 brace initialization in. We just have to make sure it's C++11 format and not C++20 feature in the process.

Copy link
Contributor

@royfalk royfalk Sep 16, 2023

Choose a reason for hiding this comment

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

Intuitively, it seemed to me it was initialized. However, on closer inspection, this is a non-static variable, so it really is uninitialized. it would be clearer if we were to specify :

   Unit *unit = nullptr;
   unsigned int bolt_index;
} ref;`

Copy link
Member

Choose a reason for hiding this comment

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

This initialization is for any kind of variable, not simply non-static. The C++ committee's idea is that the constructors don't need to do all the initialization of the class since they have this other means.
I think Strostroup's idea is that the constructor isn't necessary in 99% of cases and this lets them do that.

That said, I still kind of like having explicit constructors doing all the initialization.

engine/src/python/unit_exports.cpp Show resolved Hide resolved
@@ -162,15 +167,15 @@ class UnitWrapper : public UnitContainer {
boost::python::tuple GetOrientation() {
{
CHECKME VS_BOOST_MAKE_TUPLE(VS_BOOST_MAKE_TUPLE(0, 0, 0), VS_BOOST_MAKE_TUPLE(0, 0, 0), VS_BOOST_MAKE_TUPLE(0,
0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably better to just not break the line or break earlier for easier reading. Same for the rest of the file.

engine/src/universe_util_generic.cpp Show resolved Hide resolved
}
}
}
if (collision == false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you move this code block to an inner brace intentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me take another look. I think so, but now I'm not sure which way is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update: Yes, this was intentional. I think a previous PR of mine messed up the structure of this file a bit. This is an attempt to fix it.

@stephengtuggy stephengtuggy changed the title Update Boost on Windows (non-PR-754 version) Fix Build/Update Boost on Windows (non-PR-754 version) Sep 14, 2023
@royfalk royfalk mentioned this pull request Sep 16, 2023
1 task
@BenjamenMeyer
Copy link
Member

@stephengtuggy please merge in master

@BenjamenMeyer BenjamenMeyer mentioned this pull request Oct 7, 2023
3 tasks
@stephengtuggy
Copy link
Contributor Author

@stephengtuggy please merge in master

Done, I believe.

@BenjamenMeyer
Copy link
Member

@stephengtuggy please merge in master

Done, I believe.

Unfortunately not, or at least the merge didn't work right. It's failing at minimum because it can't find SDL2; and checking the bootstrap script it doesn't seem to be trying to install it so it doesn't have some of the required changes.
It's almost acting like it has the wrong Docker images too. Hopefully it's just the bootstrap scripts and some related CMake settings for SDL2.

@stephengtuggy
Copy link
Contributor Author

@stephengtuggy please merge in master

Done, I believe.

Unfortunately not, or at least the merge didn't work right. It's failing at minimum because it can't find SDL2; and checking the bootstrap script it doesn't seem to be trying to install it so it doesn't have some of the required changes. It's almost acting like it has the wrong Docker images too. Hopefully it's just the bootstrap scripts and some related CMake settings for SDL2.

@BenjamenMeyer I merged your PR into mine. 😃 Hopefully it works now. Thanks.

@BenjamenMeyer
Copy link
Member

BenjamenMeyer commented Nov 10, 2023

Well more successes than failures overall.

  • Windows 2022 passed; 2019 did not
  • most Mac builds failed, but 3 passed
  • all Linux builds passed except Ubuntu Kinetic
    So progress

NOTE: Kinetic seems to be missing from the Linux Bootstrap support; not sure why but that's likely the cause. (UPDATE: Doesn't seem to be in master either.) Surprised it took until SDL2 for it fail though.

@stephengtuggy
Copy link
Contributor Author

To me, the fact that we got any Windows builds to succeed at all this run was a success. Let alone macOS. And if Kinetic is the only Linux build that failed, I would say we can go ahead and merge this PR. We need to get unstuck, as far as our development efforts go. We can clean up around the edges later.

@stephengtuggy
Copy link
Contributor Author

(Yes, I know that's a change in tune from what I usually say 😄 )

@BenjamenMeyer
Copy link
Member

@stephengtuggy I can live with that.

Copy link
Member

@BenjamenMeyer BenjamenMeyer left a comment

Choose a reason for hiding this comment

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

We'll fix the Mac/Windows builds and swap Ubuntu Kinetic for Mantic on master.

@stephengtuggy stephengtuggy merged commit 524ea3b into vegastrike:master Nov 24, 2023
54 of 67 checks passed
@stephengtuggy
Copy link
Contributor Author

Merged, finally!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants