On 10/07/2024 13:59, Thomas Frohwein wrote: > On Tue, Jul 09, 2024 at 09:56:45PM +0100, Fabien Romano wrote: >> >>> >>> I'm still getting this error after deleting all those files. Seems to >>> me that there is a missing step, but I find pr-downloader stuff very >>> opaque... do you have any ideas?: >>> >>> Dependent archive "byar chobby test-2934-d9c546c" (resolved to "BYAR Chobby >>> test-2934-d9c546c") not found >> >> I also find pr-downloader stuff very opaque. Maybe you also have ~/.spring ? > > That was it! I deleted it and now it starts...
Good news, the last diff/script I sent should have work without deleting the directory as it now use --isolation mode. I guess this explains > why --isolation is the default upstream. I think I looked at isolation > a while ago. I felt there would be a way to also allow it to look in > /usr/local/share/games/spring/... > Could probably hack something up that would allow isolation in > ~/.local/state/B... and still let it access the recoil engine files > in /usr/local/share/games/spring... The --write-dir is already added to the list (see level 1 bellow). I'm fine with --isolation-dir ${TRUEPREFIX}/share/games/spring/ (see level 2 bellow). No need to further patch. Regarding patches the easiest would be to also add AddShareDirs() inside isolation block but it feels wrong regarding isolation purpose. rts/System/FileSystem/DataDirLocater.cpp void DataDirLocater::LocateDataDirs() { [...] // LEVEL 1: User defined write dirs { if (!forcedWriteDir.empty()) AddDirs(forcedWriteDir); const char* env = getenv("SPRING_WRITEDIR"); if (env != nullptr && *env != 0) AddDirs(env); // ENV{SPRING_WRITEDIR} } // LEVEL 2: automated dirs if (IsIsolationMode()) { // LEVEL 2a: Isolation Mode (either installDir or user set one) if (isolationModeDir.empty()) { AddPortableDir(); // better use curWorkDir? } else { AddDirs(isolationModeDir); } } else { // LEVEL 2b: InstallDir, HomeDirs & Shared dirs if (IsPortableMode()) AddPortableDir(); AddHomeDirs(); //AddCurWorkDir(); AddEtcDirs(); AddShareDirs(); } [...] } Without patch, using the default command with only isolation (without -dir) the binary location should be inside the share dir. There is also something to detect the portable mode (everything in the same directory). For both cases it will add something relative to the binary location, AddPortableDir(). void DataDirLocater::AddPortableDir() { const std::string dd_curWorkDir = GetBinaryLocation(); // This is useful in case of multiple engine/unitsync versions installed // together in a sub-dir of the data-dir // The data-dir structure then might look similar to this: // maps/ // games/ // engines/engine-0.83.0.0.exe // engines/engine-0.83.1.0.exe // unitsyncs/unitsync-0.83.0.0.exe // unitsyncs/unitsync-0.83.1.0.exe const std::string curWorkDirParent = FileSystem::GetParent(dd_curWorkDir); if (!curWorkDirParent.empty() && LooksLikeMultiVersionDataDir(curWorkDirParent)) AddDirs(curWorkDirParent); // "../" AddDirs(dd_curWorkDir); } With the official launcher you could play Alpha, Engine Test, Engine RmlUi, Dev Lobby and each of them may have a different engine version, looks like this design match more or less the description in AddPortableDir(). Finally, one more option could be to install a semi-portable mode with the spring binary which may be called by a wrapper in bin (wrapper can also raise memory limit). Which was my first idea to call spring from the official launcher, then I realise we could bring more than a wrapper ... a stupid launcher. Again, it also works with --isolation-dir ${TRUEPREFIX}/share/games/spring/ So we just need a README update now ? The last diff is ok ? I'm still missing a in-game multiplayer test. >> >> Isolation mode could help to reduce the scope. After spending some time >> reading >> I finally understand we could just set --isolation-dir to >> /usr/local/share/games/spring/ and avoid going crazy with >> rts/System/FileSystem/DataDirLocater.cpp. >> >> There is actualy one setting missing from the official launcher. >> Not sure what RapidTag is (pr-downloader stuff I guess) but this could be >> related to your issue. >> >>> RapidTagResolutionOrder = >>> repos-cdn.beyondallreason.dev;repos.beyondallreason.dev >> >> I raise limits to 8g. >> >> I replaced ~/.local/state/Beyond\ All\ Reason with ~/.local/state/BAR, >> mainly to >> compare with the official launcher. Both are ok with me. >> >> If someone asking, the official launcher is electron based. The two could be >> compatible to start the game so I choosed ~/.local/state/Beyond\ All\ Reason >> in >> first place. >> >> The script now append RapidTagResolutionOrder to springsettings.cfg. >> >> I also set REVISION so if this works this could go in. >> >> Cross fingers. Please send me byar-chobby output if there is an issue. >> >> >> Index: Makefile >> =================================================================== >> RCS file: /cvs/ports/games/recoil-rts/Makefile,v >> diff -u -p -r1.7 Makefile >> --- Makefile 7 Jul 2024 21:27:10 -0000 1.7 >> +++ Makefile 9 Jul 2024 20:23:20 -0000 >> @@ -13,8 +13,9 @@ MN = 1.1 >> BLD = 2511 >> HASH = g747f18b >> V = ${MJ}.${MN}pl${BLD} >> +REVISION = 0 >> # ${IN_ENGINE_V} is what recoil uses/displays internally >> -IN_ENGINE_V = "${MJ}.${MN}-${BLD}-${HASH} BAR${MJ}" >> +IN_ENGINE_V = "${MJ}.${MN}-${BLD}-${HASH} BAR${MJ}" >> >> # Prefix '0.' to avoid future EPOCH. Upstream has indicated future >> versioning >> # with YY.MM; once that has happened, remove '0.' >> @@ -110,5 +111,8 @@ SUBST_VARS += IN_ENGINE_V >> >> pre-configure: >> ${SUBST_CMD} ${WRKSRC}/rts/build/cmake/ConfigureVersion.cmake >> + >> +post-install: >> + ${SUBST_PROGRAM} ${FILESDIR}/byar-chobby ${PREFIX}/bin/byar-chobby >> >> .include <bsd.port.mk> >> Index: files/byar-chobby >> =================================================================== >> RCS file: files/byar-chobby >> diff -N files/byar-chobby >> --- /dev/null 1 Jan 1970 00:00:00 -0000 >> +++ files/byar-chobby 9 Jul 2024 20:23:20 -0000 >> @@ -0,0 +1,48 @@ >> +#!/bin/sh >> + >> +GAME_DIR=~/.local/state/BAR >> +DATASIZE="8388608" # 8g >> + >> +xm_log() { >> + echo -n "$@\nDo you want to run BAR anyway?\n\ >> +(If you don't increase these limits, spring might fail to work properly.)" >> | \ >> + ${X11BASE}/bin/xmessage -file - -center -buttons yes:0,no:1 >> -default no >> +} >> + >> +if [ $(ulimit -Sd) -lt ${DATASIZE} ]; then >> + ulimit -Sd ${DATASIZE} || \ >> + xm_log "Cannot increase datasize-cur to at least ${DATASIZE}" >> + [ $? -eq 0 ] || exit >> +fi >> + >> +# setup >> +[[ -d ${GAME_DIR} ]] || mkdir -p ${GAME_DIR} >> +cat > ${GAME_DIR}/chobby_config.json <<EOF >> +{ >> + "server": { >> + "address": "server4.beyondallreason.info", >> + "port": 8200, >> + "protocol": "spring", >> + "serverName": "BAR" >> + }, >> + "game": "byar" >> +} >> +EOF >> +cat >> ${GAME_DIR}/springsettings.cfg <<EOF >> +RapidTagResolutionOrder = >> repos-cdn.beyondallreason.dev;repos.beyondallreason.dev >> +EOF >> + >> +# update >> +PRD_HTTP_SEARCH_URL=https://files-cdn.beyondallreason.dev/find >> +PRD_RAPID_USE_STREAMER=false >> +PRD_RAPID_REPO_MASTER=https://repos-cdn.beyondallreason.dev/repos.gz >> +export PRD_HTTP_SEARCH_URL PRD_RAPID_USE_STREAMER PRD_RAPID_REPO_MASTER >> +${TRUEPREFIX}/bin/pr-downloader \ >> + --filesystem-writepath ${GAME_DIR} \ >> + --download-game byar:test \ >> + --download-game byar-chobby:test >> + >> +# start >> +${TRUEPREFIX}/bin/spring --write-dir ${GAME_DIR} \ >> + --isolation --isolation-dir ${TRUEPREFIX}/share/games/spring/ \ >> + --menu rapid://byar-chobby:test >> Index: pkg/PLIST >> =================================================================== >> RCS file: /cvs/ports/games/recoil-rts/pkg/PLIST,v >> diff -u -p -r1.1.1.1 PLIST >> --- pkg/PLIST 5 May 2024 17:18:13 -0000 1.1.1.1 >> +++ pkg/PLIST 9 Jul 2024 20:23:20 -0000 >> @@ -1,3 +1,4 @@ >> +bin/byar-chobby >> @bin bin/mapcompile >> @bin bin/mapdecompile >> @bin bin/pr-downloader -- Fabien Romano