From 4f15a084c081c6f0dae2b3637d4a5b6552601801 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Thu, 16 Jul 2026 20:37:48 +0100 Subject: [PATCH] Minor tweaks to the layered.sh build script (#34300) I struggled to understand what was going on in my failing build. Clean up some comments, and try to make the console output a bit more helpful. --- scripts/layered.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/layered.sh b/scripts/layered.sh index 912ef56a32..5b172aaaae 100755 --- a/scripts/layered.sh +++ b/scripts/layered.sh @@ -4,7 +4,7 @@ set -ex # Creates a layered environment with the full repo for the app and SDKs cloned # and linked. This gives an element-web dev environment ready to build with -# matching branches of react-sdk's dependencies so that changes can be tested +# matching branches of matrix-js-sdk so that changes can be tested # in element-web. # Note that this style is different from the recommended developer setup: this @@ -22,13 +22,15 @@ export PR_REPO=element-web js_sdk_dep=$(jq -r '.dependencies["matrix-js-sdk"]' < $(pnpm -w root)/../apps/web/package.json) -# Set up the js-sdk first (unless package.json pins a specific version) +# Set up the js-sdk (unless package.json pins a specific version) if [ "$js_sdk_dep" = "github:matrix-org/matrix-js-sdk#develop" ]; then + echo "layered.sh: Cloning matching branch of matrix-js-sdk" scripts/fetchdep.sh matrix-org matrix-js-sdk develop if [ -n "$JS_SDK_GITHUB_BASE_REF" ]; then + echo "layered.sh: Switching js-sdk to $JS_SDK_GITHUB_BASE_REF" git -C matrix-js-sdk fetch --depth 1 origin $JS_SDK_GITHUB_BASE_REF - git -C matrix-js-sdk checkout $JS_SDK_GITHUB_BASE_REF + git -C matrix-js-sdk -c advice.detachedHead=false checkout $JS_SDK_GITHUB_BASE_REF fi pnpm -C matrix-js-sdk install --frozen-lockfile --ignore-scripts @@ -36,5 +38,5 @@ if [ "$js_sdk_dep" = "github:matrix-org/matrix-js-sdk#develop" ]; then pnpm -C apps/web link ./matrix-js-sdk pnpm link ./matrix-js-sdk else - echo "Skipping matrix-js-sdk fetch and link as package.json pins $js_sdk_dep" + echo "layered.sh: Skipping matrix-js-sdk fetch and link as package.json pins $js_sdk_dep" fi