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 server build on Ubuntu 20.04 and 22.04 #82

Merged
merged 2 commits into from
Apr 24, 2023

Conversation

Quipyowert2
Copy link
Contributor

@Quipyowert2 Quipyowert2 commented Apr 23, 2023

This fixes the linker error when building the server on Ubuntu 20.04 in #77.

The second commit fixes the packaging error during the Ubuntu 22.04 CI build for PR #77. The oldest Ubuntu version specified in either that PR or in .travis.yml is 16.04 which has version 9 of debhelper. Ubuntu 22.04 build in PR #77 fails because debhelper 13 isn't backward compatible with version 6. The packaging guide for debian recommends using version 10 but says compatibility level 9 can be used for builds on older systems.

In case the build log expires, the last several lines of the build log are:

Build log from Ubuntu 20.04 in GitHub actions
 g++ -o build/src/YOGServerRouterAdministratorCommands.o -c -g -Wall -fPIC -DYOG_SERVER_ONLY -DHAVE_CONFIG_H -D_REENTRANT -Ilibgag/include -I. -Ilibusl/src -I/usr/include/SDL2 src/YOGServerRouterAdministratorCommands.cpp
g++ -o build/src/YOGServerRouterAdministrator.o -c -g -Wall -fPIC -DYOG_SERVER_ONLY -DHAVE_CONFIG_H -D_REENTRANT -Ilibgag/include -I. -Ilibusl/src -I/usr/include/SDL2 src/YOGServerRouterAdministrator.cpp
g++ -o build/src/YOGServerRouter.o -c -g -Wall -fPIC -DYOG_SERVER_ONLY -DHAVE_CONFIG_H -D_REENTRANT -Ilibgag/include -I. -Ilibusl/src -I/usr/include/SDL2 src/YOGServerRouter.cpp
g++ -o build/src/YOGServerRouterManager.o -c -g -Wall -fPIC -DYOG_SERVER_ONLY -DHAVE_CONFIG_H -D_REENTRANT -Ilibgag/include -I. -Ilibusl/src -I/usr/include/SDL2 src/YOGServerRouterManager.cpp
g++ -o build/src/YOGServerRouterPlayer.o -c -g -Wall -fPIC -DYOG_SERVER_ONLY -DHAVE_CONFIG_H -D_REENTRANT -Ilibgag/include -I. -Ilibusl/src -I/usr/include/SDL2 src/YOGServerRouterPlayer.cpp
g++ -o build/src/glob2-server -g -Wall build/src/AINames.o build/src/BasePlayer.o build/src/BaseTeam.o build/src/BitArray.o build/src/GameHeader.o build/src/LANGameInformation.o build/src/LogFileManager.o build/src/MapHeader.o build/src/NetBroadcaster.o build/src/NetConnection.o build/src/NetConnectionThread.o build/src/NetConnectionThreadMessage.o build/src/NetGamePlayerManager.o build/src/NetListener.o build/src/NetMessage.o build/src/NetReteamingInformation.o build/src/NetTestSuite.o build/src/Order.o build/src/Race.o build/src/UnitType.o build/src/Utilities.o build/src/YOGConsts.o build/src/YOGGameInfo.o build/src/YOGGameResults.o build/src/YOGMessage.o build/src/YOGPlayerSessionInfo.o build/src/YOGPlayerStoredInfo.o build/src/BuildingUtils.o build/src/Bullet.o build/src/EntityType.o build/src/Glob2.o build/src/GlobalContainer.o build/src/Map.o build/src/MapThumbnail.o build/src/Sector.o build/src/Settings.o build/src/UnitUtils.o build/src/YOGAfterJoinGameInformation.o build/src/YOGDownloadableMapInfo.o build/src/WinningConditions.o build/src/YOGServerAdministratorCommands.o build/src/YOGServerAdministrator.o build/src/YOGServerAdministratorList.o build/src/YOGServerBannedIPListManager.o build/src/YOGServerChatChannel.o build/src/YOGServerChatChannelManager.o build/src/YOGServer.o build/src/YOGServerFileDistributationManager.o build/src/YOGServerFileDistributor.o build/src/YOGServerGame.o build/src/YOGServerGameLog.o build/src/YOGServerGameRouter.o build/src/YOGServerMapDatabank.o build/src/YOGServerPasswordRegistry.o build/src/YOGServerPlayer.o build/src/YOGServerPlayerScoreCalculator.o build/src/YOGServerPlayerStoredInfoManager.o build/src/YOGServerRouterAdministratorCommands.o build/src/YOGServerRouterAdministrator.o build/src/YOGServerRouter.o build/src/YOGServerRouterManager.o build/src/YOGServerRouterPlayer.o build/libgag/src/libgag_server.a -lz -lboost_thread -lboost_system -lpthread -lSDL2_net -lSDL2
/bin/ld: build/src/Settings.o: in function `Settings::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/home/runner/work/glob2/glob2/src/Settings.cpp:129: undefined reference to `GAGGUI::Screen::scrollWheelEnabled'
collect2: error: ld returned 1 exit status
scons: *** [build/src/glob2-server] Error 1
scons: building terminated because of errors.
make: *** [debian/rules:32: build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
Error: Process completed with exit code 2.

and the 22.04 build log end with:

Build log from Ubuntu 22.04 in GitHub actions
g++ -o build/src/glob2 -g -Wall build/src/AICastor.o build/src/AI.o build/src/AIDescriptionScreen.o build/src/AIEcho.o build/src/AINames.o build/src/AINicowar.o build/src/AINull.o build/src/AINumbi.o build/src/AIToubib.o build/src/AIWarrush.o build/src/BasePlayer.o build/src/BaseTeam.o build/src/BitArray.o build/src/Brush.o build/src/Building.o build/src/BuildingsTypes.o build/src/BuildingType.o build/src/BuildingUtils.o build/src/Bullet.o build/src/Campaign.o build/src/CampaignEditor.o build/src/CampaignMainMenu.o build/src/CampaignMenuScreen.o build/src/CampaignSelectorScreen.o build/src/ChooseMapScreen.o build/src/CPUStatisticsManager.o build/src/CreditScreen.o build/src/CustomGameOtherOptions.o build/src/CustomGameScreen.o build/src/DynamicClouds.o build/src/EditorMainMenu.o build/src/EndGameScreen.o build/src/Engine.o build/src/EntityType.o build/src/Fatal.o build/src/FertilityCalculatorDialog.o build/src/FertilityCalculatorThread.o build/src/FertilityCalculatorThreadMessage.o build/src/Game.o build/src/GameEvent.o build/src/GameGUI.o build/src/GameGUIDefaultAssignManager.o build/src/GameGUIDialog.o build/src/GameGUIGhostBuildingManager.o build/src/GameGUIKeyActions.o build/src/GameGUILoadSave.o build/src/GameGUIMessageManager.o build/src/GameGUIToolManager.o build/src/GameHeader.o build/src/GameHints.o build/src/GameObjectives.o build/src/GameUtilities.o build/src/Glob2.o build/src/Glob2Screen.o build/src/Glob2Style.o build/src/GlobalContainer.o build/src/Gradient.o build/src/GUIGlob2FileList.o build/src/GUIMapPreview.o build/src/HeightMapGenerator.o build/src/IntBuildingType.o build/src/IRC.o build/src/IRCTextMessageHandler.o build/src/IRCThread.o build/src/IRCThreadMessage.o build/src/KeyboardManager.o build/src/LANFindScreen.o build/src/LANGameInformation.o build/src/LANMenuScreen.o build/src/LogFileManager.o build/src/MainMenuScreen.o build/src/Map.o build/src/MapEdit.o build/src/MapEditDialog.o build/src/MapEditKeyActions.o build/src/MapGenerationDescriptor.o build/src/MapGenerator.o build/src/MapHeader.o build/src/MapScript.o build/src/MapScriptError.o build/src/MapScriptUSL.o build/src/MapThumbnail.o build/src/MarkManager.o build/src/Minimap.o build/src/MultiplayerGame.o build/src/MultiplayerGameEvent.o build/src/MultiplayerGameEventListener.o build/src/MultiplayerGameScreen.o build/src/NetBroadcaster.o build/src/NetBroadcastListener.o build/src/NetConnection.o build/src/NetConnectionThread.o build/src/NetConnectionThreadMessage.o build/src/NetEngine.o build/src/NetGamePlayerManager.o build/src/NetListener.o build/src/NetMessage.o build/src/NetReteamingInformation.o build/src/NetTestSuite.o build/src/NewMapScreen.o build/src/Order.o build/src/OverlayAreas.o build/src/PerlinNoise.o build/src/Player.o build/src/Race.o build/src/ReplayReader.o build/src/ReplayWriter.o build/src/Ressource.o build/src/RessourcesTypes.o build/src/ScriptEditorScreen.o build/src/Sector.o build/src/Settings.o build/src/SettingsScreen.o build/src/SGSL.o build/src/SimplexNoise.o build/src/SoundMixer.o build/src/Team.o build/src/TeamStat.o build/src/UnitConsts.o build/src/Unit.o build/src/UnitEditorScreen.o build/src/UnitSkin.o build/src/UnitsSkins.o build/src/UnitType.o build/src/UnitUtils.o build/src/Utilities.o build/src/VoiceRecorder.o build/src/WinningConditions.o build/src/YOGAfterJoinGameInformation.o build/src/YOGClientBlockedList.o build/src/YOGClientChatChannel.o build/src/YOGClientChatListener.o build/src/YOGClientCommandManager.o build/src/YOGClientCommands.o build/src/YOGClient.o build/src/YOGClientDownloadableMapList.o build/src/YOGClientDownloadableMapListener.o build/src/YOGClientDownloadingMapScreen.o build/src/YOGClientEvent.o build/src/YOGClientEventListener.o build/src/YOGClientFileAssembler.o build/src/YOGClientGameConnectionDialog.o build/src/YOGClientGameListListener.o build/src/YOGClientGameListManager.o build/src/YOGClientLobbyScreen.o build/src/YOGClientMapDownloader.o build/src/YOGClientMapDownloadScreen.o build/src/YOGClientMapUploader.o build/src/YOGClientMapUploadScreen.o build/src/YOGClientOptionsScreen.o build/src/YOGClientPlayerListListener.o build/src/YOGClientPlayerListManager.o build/src/YOGClientRatedMapList.o build/src/YOGClientRouterAdministrator.o build/src/YOGConsts.o build/src/YOGDownloadableMapInfo.o build/src/YOGGameInfo.o build/src/YOGGameResults.o build/src/YOGLoginScreen.o build/src/YOGMessage.o build/src/YOGPlayerPrivateInfo.o build/src/YOGPlayerSessionInfo.o build/src/YOGPlayerStoredInfo.o build/src/YOGRegisterScreen.o build/src/YOGServerAdministratorCommands.o build/src/YOGServerAdministrator.o build/src/YOGServerAdministratorList.o build/src/YOGServerBannedIPListManager.o build/src/YOGServerChatChannel.o build/src/YOGServerChatChannelManager.o build/src/YOGServer.o build/src/YOGServerFileDistributationManager.o build/src/YOGServerFileDistributor.o build/src/YOGServerGame.o build/src/YOGServerGameLog.o build/src/YOGServerGameRouter.o build/src/YOGServerMapDatabank.o build/src/YOGServerPasswordRegistry.o build/src/YOGServerPlayer.o build/src/YOGServerPlayerScoreCalculator.o build/src/YOGServerPlayerStoredInfoManager.o build/src/YOGServerRouterAdministratorCommands.o build/src/YOGServerRouterAdministrator.o build/src/YOGServerRouter.o build/src/YOGServerRouterManager.o build/src/YOGServerRouterPlayer.o build/libgag/src/libgag.a build/libusl/src/libusl.a -lz -lboost_thread -lboost_system -lpthread -lGL -lGLU -lfribidi -lSDL2_net -lvorbisfile -lSDL2_ttf -lSDL2_image -lspeex -lSDL2
scons: done building targets.
dpkg-buildpackage: info: source package glob2
dpkg-buildpackage: info: source version 0.9.5.0
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Nikolay Epifanov <nick.time at yahoo dot com>
 dpkg-source -I.hg --before-build .
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
QUILT_PATCHES=debian/patches \
	quilt --quiltrc /dev/null pop -a -R || test $? = 2
No patch removed
rm -rf .pc debian/stamp-patched
dh_testdir
dh_testroot
rm -f build-stamp
dh_clean
dh_clean: error: Compatibility levels before 7 are no longer supported (level 6 requested)
make: *** [debian/rules:45: clean] Error 25
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
Error: Process completed with exit code 2.

This fixes the packaging error during the Ubuntu 22.04 CI build for PR Globulation2#77.
@Quipyowert2 Quipyowert2 changed the title Fix undefined reference to Screen::scrollWheelEnabled. Fix server build on Ubuntu 20.04 and 22.04 Apr 23, 2023
@stephanemagnenat stephanemagnenat merged commit f16de59 into Globulation2:master Apr 24, 2023
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.

2 participants