Page MenuHomeWildfire Games

Add a safeguard for users trying to use an old system NVTT
ClosedPublic

Authored by Itms on May 24 2020, 6:50 PM.

Details

Summary

A lot of users try to build the development version --with-system-nvtt, which is not the default, but is recommended since we match upstream. Unfortunately, a lot of package managers distribute nvtt only for 0ad releases, so they are behind, as was alpha 23. Users of the old NVTT will experience a crash on startup, which is otherwise fixed by cleaning the cache (try this first).

This patch prevents building with an old NVTT and suggests using the bundled version.

Test Plan

Check that this prevents building with an old system NVTT.

Check that this works with the bundled copy (Jenkins will make sure of that).

If possible, check that this works with an up-to-date system NVTT.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Itms created this revision.May 24 2020, 6:50 PM
Owners added a subscriber: Restricted Owners Package.May 24 2020, 6:51 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/810/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2220/display/redirect

Itms planned changes to this revision.May 27 2020, 8:37 AM

GunChleoc reports it doesn't correctly detect an old NVTT version.

Itms requested review of this revision.Jul 6 2020, 10:31 AM

As reported on Trac, the patch works for me, I have no news of GunChleoc. If someone with an Ubuntu, or derived, could test this... I am also interested in users of various distributions where the system nvtt creates the issue.

Lubuntu 18:

libnvtt-dev/bionic,now 2.0.8-1+dfsg-8.1 amd64 [installed]
  NVIDIA Texture Tools (Header)

libnvtt2/bionic,now 2.0.8-1+dfsg-8.1 amd64 [installed,automatic]
  NVIDIA Texture Tools

This is what you'd like, right?

TextureConverter.cpp
../../../source/graphics/TextureConverter.cpp:44:2: error: #error Please use NVTT 2.1.0 or newer.If your system does not provide it, you should use the bundled version by NOT passing --with-system-nvtt to premake.
 #error Please use NVTT 2.1.0 or newer.\
  ^~~~~
graphics.make:371: recipe for target 'obj/graphics_Release/TextureConverter.o' failed
make[1]: *** [obj/graphics_Release/TextureConverter.o] Error 1
Makefile:116: recipe for target 'graphics' failed
make: *** [graphics] Error 2
Stan added a subscriber: Stan.Aug 18 2020, 4:16 PM

For posterity (Discussion in a PM)

From: @GunChleoc
I am now getting an error message, so the patch should be good.

TerrainProperties.cpp
TerrainTextureEntry.cpp
TerrainTextureManager.cpp
TerritoryBoundary.cpp
TerritoryTexture.cpp
TextRenderer.cpp
TextureConverter.cpp
TextureManager.cpp
Unit.cpp
../../../source/graphics/TextureConverter.cpp:45:2: error: #error Please use NVTT 2.1.0 or newer.If your system does not provide it, you should use the bundled version by NOT passing --with-system-nvtt to premake.
 #error Please use NVTT 2.1.0 or newer.\
  ^~~~~
UnitAnimation.cpp
UnitManager.cpp
This revision was not accepted when it landed; it landed in state Needs Review.Aug 18 2020, 7:30 PM
This revision was automatically updated to reflect the committed changes.