Просмотр исходного кода

fix(mods): BepInEx_Valheim prevents startup on systems with newer glibc (#4788)

* fix(mods): BepInEx_Valheim prevents startup on systems with newer glibc

Load the libdoorstop_x64.so solely for the dedicated server executable
and not for the whole startup routine, which causes errors in startup or
not loading the mods at all. (see #4149 and #4491)

* chore(prettier): format code

---------

Co-authored-by: Daniel Gibbs <me@danielgibbs.co.uk>
Co-authored-by: dgibbs64 <dgibbs64@users.noreply.github.com>
fwillo 2 дней назад
Родитель
Сommit
9fd21e5b9a

+ 8 - 8
.github/scripts/details-check-generate-matrix.sh

@@ -23,11 +23,11 @@ while read -r line; do
 	export distro
 	# Legacy servers that require older Ubuntu/Debian versions due to glibc compatibility
 	case "${shortname}" in
-		bfv|bf1942)
+		bfv | bf1942)
 			# Requires Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31 compatible)
 			runner="ubuntu-22.04"
 			;;
-		btl|onset)
+		btl | onset)
 			# Requires Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31 compatible)
 			runner="ubuntu-20.04"
 			;;
@@ -36,12 +36,12 @@ while read -r line; do
 			;;
 	esac
 	{
-		echo -n "{";
-		echo -n "\"shortname\":";
-		echo -n "\"${shortname}\"";
-		echo -n ",\"runner\":";
-		echo -n "\"${runner}\"";
-		echo -n "},";
+		echo -n "{"
+		echo -n "\"shortname\":"
+		echo -n "\"${shortname}\""
+		echo -n ",\"runner\":"
+		echo -n "\"${runner}\""
+		echo -n "},"
 	} >> "shortnamearray.json"
 done < <(tail -n +2 serverlist.csv)
 sed -i '$ s/.$//' "shortnamearray.json"

+ 38 - 38
.github/scripts/sync-game-labels.sh

@@ -20,8 +20,8 @@ normalize_label() {
 }
 
 if [[ ! -f "${SERVERLIST}" ]]; then
-  echo "ERROR: ${SERVERLIST} not found. Run from the repository root."
-  exit 1
+	echo "ERROR: ${SERVERLIST} not found. Run from the repository root."
+	exit 1
 fi
 
 declare -A EXISTING_COLORS=()
@@ -31,20 +31,20 @@ declare -A EXISTING_NAMES=()
 # Fetch all existing game label metadata once (up to 1000) and cache locally.
 echo "Fetching existing labels..."
 while IFS=$'\t' read -r NAME COLOR DESCRIPTION; do
-  [[ -n "${NAME}" ]] || continue
-  EXISTING_COLORS["${NAME}"]="${COLOR}"
-  EXISTING_DESCRIPTIONS["${NAME}"]="${DESCRIPTION}"
-  EXISTING_NAMES["$(normalize_label "${NAME}")"]="${NAME}"
+	[[ -n "${NAME}" ]] || continue
+	EXISTING_COLORS["${NAME}"]="${COLOR}"
+	EXISTING_DESCRIPTIONS["${NAME}"]="${DESCRIPTION}"
+	EXISTING_NAMES["$(normalize_label "${NAME}")"]="${NAME}"
 done < <(
-  gh label list --limit 1000 --json name,color,description ${REPO:+--repo "$REPO"} \
-    | jq -r '.[] | select(.name | startswith("game: ")) | [.name, .color, (.description // "")] | @tsv'
+	gh label list --limit 1000 --json name,color,description ${REPO:+--repo "$REPO"} \
+		| jq -r '.[] | select(.name | startswith("game: ")) | [.name, .color, (.description // "")] | @tsv'
 )
 
 # Parse unique game names from the CSV (column 3, skip header).
 mapfile -t GAMES < <(
-  tail -n +2 "${SERVERLIST}" \
-    | cut -d',' -f3 \
-    | sort -u
+	tail -n +2 "${SERVERLIST}" \
+		| cut -d',' -f3 \
+		| sort -u
 )
 
 CREATED=0
@@ -52,35 +52,35 @@ UPDATED=0
 UNCHANGED=0
 
 for GAME in "${GAMES[@]}"; do
-  LABEL="${LABEL_PREFIX}${GAME}"
-  DESCRIPTION="Issues related to ${GAME}"
-  NORMALIZED_LABEL="$(normalize_label "${LABEL}")"
+	LABEL="${LABEL_PREFIX}${GAME}"
+	DESCRIPTION="Issues related to ${GAME}"
+	NORMALIZED_LABEL="$(normalize_label "${LABEL}")"
 
-  if [[ -v EXISTING_NAMES["${NORMALIZED_LABEL}"] ]]; then
-    CURRENT_LABEL="${EXISTING_NAMES["${NORMALIZED_LABEL}"]}"
-    CURRENT_COLOR="${EXISTING_COLORS["${CURRENT_LABEL}"]}"
-    CURRENT_DESCRIPTION="${EXISTING_DESCRIPTIONS["${CURRENT_LABEL}"]}"
+	if [[ -v EXISTING_NAMES["${NORMALIZED_LABEL}"] ]]; then
+		CURRENT_LABEL="${EXISTING_NAMES["${NORMALIZED_LABEL}"]}"
+		CURRENT_COLOR="${EXISTING_COLORS["${CURRENT_LABEL}"]}"
+		CURRENT_DESCRIPTION="${EXISTING_DESCRIPTIONS["${CURRENT_LABEL}"]}"
 
-    if [[ "${CURRENT_LABEL}" != "${LABEL}" || "${CURRENT_COLOR}" != "${LABEL_COLOR}" || "${CURRENT_DESCRIPTION}" != "${DESCRIPTION}" ]]; then
-      echo "  update  ${LABEL}"
-      gh label edit "${CURRENT_LABEL}" \
-        --name "${LABEL}" \
-        --color "${LABEL_COLOR}" \
-        --description "${DESCRIPTION}" \
-        ${REPO:+--repo "$REPO"}
-      (( UPDATED++ )) || true
-    else
-      echo "  ok      ${LABEL}"
-      (( UNCHANGED++ )) || true
-    fi
-  else
-    echo "  create  ${LABEL}"
-    gh label create "${LABEL}" \
-      --color "${LABEL_COLOR}" \
-      --description "${DESCRIPTION}" \
-      ${REPO:+--repo "$REPO"}
-    (( CREATED++ )) || true
-  fi
+		if [[ "${CURRENT_LABEL}" != "${LABEL}" || "${CURRENT_COLOR}" != "${LABEL_COLOR}" || "${CURRENT_DESCRIPTION}" != "${DESCRIPTION}" ]]; then
+			echo "  update  ${LABEL}"
+			gh label edit "${CURRENT_LABEL}" \
+				--name "${LABEL}" \
+				--color "${LABEL_COLOR}" \
+				--description "${DESCRIPTION}" \
+				${REPO:+--repo "$REPO"}
+			((UPDATED++)) || true
+		else
+			echo "  ok      ${LABEL}"
+			((UNCHANGED++)) || true
+		fi
+	else
+		echo "  create  ${LABEL}"
+		gh label create "${LABEL}" \
+			--color "${LABEL_COLOR}" \
+			--description "${DESCRIPTION}" \
+			${REPO:+--repo "$REPO"}
+		((CREATED++)) || true
+	fi
 done
 
 echo ""

+ 1 - 1
lgsm/modules/fix_vh.sh

@@ -33,7 +33,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then
 		export DOORSTOP_TARGET_ASSEMBLY=./BepInEx/core/BepInEx.Preloader.dll
 
 		export LD_LIBRARY_PATH="./doorstop_libs:${LD_LIBRARY_PATH}"
-		export LD_PRELOAD="libdoorstop_x64.so:${LD_PRELOAD}"
+		preexecutable="LD_PRELOAD=\"libdoorstop_x64.so:${LD_PRELOAD}\" ${preexecutable}"
 
 		export SteamAppId=892970
 	fi