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

Update resource-building scripts for future compatibility. #656

Merged
merged 4 commits into from
May 21, 2020

Conversation

Deledrius
Copy link
Member

This updates the resource.dat creation to render the SVG assets using a newer, maintained Python module "CairoSVG" instead of relying on the Pycairo/rsvg pair which is no longer actively maintained for Python on Windows. Also included are a few Python 3.x+ fixes which should allow the scripts and build system to function with the newer interpreter.

This is a foundation for fixes coming in #650.

@Deledrius Deledrius requested a review from Hoikas May 18, 2020 14:03
Copy link
Member

@zrax zrax left a comment

Choose a reason for hiding this comment

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

Should we also update the appveyor.yml to install/use CairoSVG instead of PyGTK?

@Deledrius
Copy link
Member Author

Yes! I knew I forgot something. I'll add that.

Hoikas
Hoikas previously requested changes May 20, 2020
Copy link
Member

@Hoikas Hoikas left a comment

Choose a reason for hiding this comment

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

Missing requirements.txt with the contents:

cairosvg==1.0.22
pillow

@Deledrius
Copy link
Member Author

We aren't currently using that method. Are you requesting that it be added to this PR?

@Hoikas
Copy link
Member

Hoikas commented May 20, 2020

Yes, we want want to expose on master the packages needed for these scripts to work on Py2.7.

@Deledrius
Copy link
Member Author

Alright, will do.

@Deledrius Deledrius force-pushed the resource_updates branch 6 times, most recently from 857b78e to 3d1dcfd Compare May 20, 2020 17:17
Copy link
Member

@Hoikas Hoikas left a comment

Choose a reason for hiding this comment

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

This might be nit-picky, but I feel like the requirements.txt should live in the same directory as the resource generation script. The game scripts, for example, don't require the modules listed therein.

requirements.txt Outdated Show resolved Hide resolved
@@ -12,6 +12,7 @@ jobs:
sudo apt install cmake libcurl4-openssl-dev libopenal-dev libssl-dev \
libogg-dev libopus-dev libspeex-dev uuid-dev libvpx-dev \
libvorbis-dev qtbase5-dev
sudo pip install -r ${GITHUB_WORKSPACE}/requirements.txt
Copy link
Member

Choose a reason for hiding this comment

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

Too bad the resource.dat is never built on linux-ci since it's part of the plClient build :trollface:

Copy link
Member Author

Choose a reason for hiding this comment

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

Not currently, but hopefully that will change. I know the scripts run on there because I've done so. :trollface:

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the requirements file allows specifications based on environment (such as OS), it makes sense to add this to both build systems for consistency (and to watch for accidental breakages).

@Deledrius
Copy link
Member Author

Deledrius commented May 20, 2020

I feel like the requirements.txt should live in the same directory as the resource generation script.

I considered this, but then the question is when is this step executed?

I think this is redundant. We currently install all dependencies in the apt-get/vcpkg steps, and let CMake work out what's enabled and available. This is consistent with that approach. If these Python modules are unavailable, or not requested in the build, CMake will respond appropriately.

Also, a dependency-installation step that requires a file nested deep inside the project tree seems prone to breakage. Unless we want to have CMake handle running PIP as a custom command inside the step that sets CAN_BUILD_RESOURCE_DAT on, I don't see a better way to do this (and installing dependencies during configuration seems like an equally bad idea).

I see this file as a project-wide dependencies install list, which just happens to only be used by a single sub-project currently. That would appear to be the general intent of it. We can also nest them... perhaps you'd prefer that? If this requirements file referenced nested ones for any projects that need it, then the CI steps still only need reference the base file.

Copy link
Member

@Hoikas Hoikas left a comment

Choose a reason for hiding this comment

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

LGTM

@Hoikas Hoikas merged commit e86eaf3 into H-uru:master May 21, 2020
@Deledrius Deledrius deleted the resource_updates branch May 21, 2020 18:01
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.

None yet

3 participants