Release: fix portable runtime and updater
This commit is contained in:
1 parent
1ff935b727
commit
fb8fb69532
21 files changed
+252
-29
No files matched your search
@@ -63,6 +63,7 @@ mkdir -p \
|
||||
"$bundle/bin" \
|
||||
"$bundle/lib" \
|
||||
"$bundle/service" \
|
||||
"$bundle/share/echoion/certs" \
|
||||
"$bundle/share/echoion/web" \
|
||||
"$bundle/share/echoion/tools"
|
||||
install -m 0755 /bin/true "$bundle/bin/echoiond"
|
||||
@@ -74,6 +75,8 @@ printf '%s\n' '[Service]' >"$bundle/service/echoion.service.in"
|
||||
printf '%s\n' '[Service]' >"$bundle/service/echoion-updater.service.in"
|
||||
printf '%s\n' '[Timer]' >"$bundle/service/echoion-updater.timer.in"
|
||||
printf '%s\n' '{}' >"$bundle/share/echoion/config.example.json"
|
||||
printf '%s\n' 'test trust bundle' \
|
||||
>"$bundle/share/echoion/certs/ca-certificates.crt"
|
||||
install -m 0755 "$source_root/scripts/validate-release-manifest.py" \
|
||||
"$bundle/share/echoion/tools/validate-release-manifest.py"
|
||||
ln -s Echoion.ts "$bundle/lib/Echoion-current.ts"
|
||||
@@ -117,6 +120,7 @@ assert manifest["core"] == "lib/Echoion.ts"
|
||||
paths = [entry["path"] for entry in manifest["files"]]
|
||||
assert paths == sorted(paths)
|
||||
assert "share/echoion/web/index.html" in paths
|
||||
assert "share/echoion/certs/ca-certificates.crt" in paths
|
||||
link = next(entry for entry in manifest["files"] if entry["path"].endswith("current.ts"))
|
||||
assert link == {
|
||||
"path": "lib/Echoion-current.ts",
|
||||
|
||||
@@ -7,7 +7,7 @@ if [[ $# != 1 ]]; then
|
||||
fi
|
||||
|
||||
source_root=$(realpath -e -- "$1")
|
||||
for command_name in cmake patchelf readelf python3; do
|
||||
for command_name in cmake ldd patchelf readelf python3; do
|
||||
command -v "$command_name" >/dev/null || {
|
||||
echo "missing test command: $command_name" >&2
|
||||
exit 2
|
||||
@@ -147,7 +147,8 @@ cmake \
|
||||
"-DBUNDLE_SEED_FILES=$seed_lib/libstdc++.so.6" \
|
||||
"-DPATCHELF_EXECUTABLE=$(command -v patchelf)" \
|
||||
-P "$source_root/cmake/BundleRuntimeDependencies.cmake"
|
||||
patchelf --set-rpath "\$ORIGIN/../../../../../lib" "$bundle_plugin"
|
||||
plugin_runpath="\$ORIGIN/../../../../../../current/lib:\$ORIGIN/../../current/lib:\$ORIGIN/lib"
|
||||
patchelf --set-rpath "$plugin_runpath" "$bundle_plugin"
|
||||
|
||||
python3 - "$source_root/scripts/validate-release-elf.py" <<'PY'
|
||||
import importlib.util
|
||||
@@ -230,8 +231,38 @@ if python3 "$source_root/scripts/validate-release-elf.py" \
|
||||
fi
|
||||
grep -F $'NEEDED\tlib/Echoion.ts\tlibechoion-dependency.so.1\tbundled' "$report"
|
||||
grep -F $'NEEDED\tbin/echoiond\tlibc.so.6\tsystem' "$report"
|
||||
grep -F $'ELF\tshare/echoion/bootstrap-plugins/fixture-shortener/1.0.0/fixture-shortener.so\tRUNPATH=$ORIGIN/../../../../../lib' "$report"
|
||||
grep -F \
|
||||
$'ELF\tshare/echoion/bootstrap-plugins/fixture-shortener/1.0.0/fixture-shortener.so\tRUNPATH=$ORIGIN/../../../../../../current/lib:$ORIGIN/../../current/lib:$ORIGIN/lib' \
|
||||
"$report"
|
||||
grep -F $'NEEDED\tshare/echoion/bootstrap-plugins/fixture-shortener/1.0.0/fixture-shortener.so\tlibechoion-dependency.so.1\tbundled' "$report"
|
||||
|
||||
installed="$temporary/installed"
|
||||
managed_plugin="$installed/state/plugins/.managed/fixture-shortener/versions/1.0.0/fixture-shortener.so"
|
||||
portable_plugin="$installed/state/plugins/fixture-shortener.so"
|
||||
mkdir -p "$installed/current/lib" "$(dirname -- "$managed_plugin")" \
|
||||
"$(dirname -- "$portable_plugin")"
|
||||
cp -a "$bundle/lib/." "$installed/current/lib/"
|
||||
cp "$bundle_plugin" "$managed_plugin"
|
||||
cp "$bundle_plugin" "$portable_plugin"
|
||||
for installed_plugin in "$managed_plugin" "$portable_plugin"; do
|
||||
ldd_report="$temporary/$(basename -- "$(dirname -- "$installed_plugin")").ldd"
|
||||
env -u LD_LIBRARY_PATH ldd "$installed_plugin" >"$ldd_report" 2>&1
|
||||
resolved_dependency=$(awk '
|
||||
$1 == "libechoion-dependency.so.1" && $2 == "=>" {
|
||||
print $3
|
||||
exit
|
||||
}
|
||||
' "$ldd_report")
|
||||
[[ -n $resolved_dependency ]]
|
||||
[[ $(realpath -e -- "$resolved_dependency") == \
|
||||
$(realpath -e -- "$installed/current/lib/libechoion-dependency.so.1") ]]
|
||||
if grep -Fq 'not found' "$ldd_report"; then
|
||||
echo "installed plugin did not resolve its bundled dependency closure" >&2
|
||||
cat "$ldd_report" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if python3 "$source_root/scripts/validate-release-elf.py" \
|
||||
--root "$bundle" \
|
||||
--forbid-content-prefix /tmp/echoion-plugin-forbidden-build-path \
|
||||
@@ -266,7 +297,7 @@ if python3 "$source_root/scripts/validate-release-elf.py" \
|
||||
echo "incorrect bootstrap plugin RUNPATH unexpectedly passed validation" >&2
|
||||
exit 1
|
||||
fi
|
||||
patchelf --set-rpath "\$ORIGIN/../../../../../lib" "$bundle_plugin"
|
||||
patchelf --set-rpath "$plugin_runpath" "$bundle_plugin"
|
||||
|
||||
patchelf --set-rpath /tmp/unsafe-build-path "$bundle/lib/Echoion.ts"
|
||||
if python3 "$source_root/scripts/validate-release-elf.py" \
|
||||
|
||||
Reference in new issue
Block a user