@@ -98,21 +98,23 @@ jobs:
9898 if : matrix.config.os == 'macos-latest'
9999 run : brew install geos
100100
101+ # Dynamically set a short target directory on Windows to bypass 260-char MinGW limits,
102+ # while keeping paths standard on Mac/Linux.
103+ - name : Configure Target Directory
104+ shell : bash
105+ run : |
106+ if [ "$RUNNER_OS" == "Windows" ]; then
107+ echo "SEDONADB_TARGET_DIR=D:/a/t" >> $GITHUB_ENV
108+ echo "CACHE_WORKSPACE=. -> D:/a/t" >> $GITHUB_ENV
109+ else
110+ echo "SEDONADB_TARGET_DIR=$(pwd)/r/sedonadb/src/rust/target" >> $GITHUB_ENV
111+ echo "CACHE_WORKSPACE=. -> r/sedonadb/src/rust/target" >> $GITHUB_ENV
112+ fi
113+
101114 - uses : Swatinem/rust-cache@v2
102115 with :
103- # Update this key to force a new cache
104116 prefix-key : " r-v4"
105- # The R package uses its own target directory
106- workspaces : " . -> r/sedonadb/src/rust/target"
107-
108- # Explicitly specify for Windows, which otherwise chooses a shorter version
109- # to work around a path length limitation when building from longer starting paths.
110- # This allows us to use a common cache configuration for Windows, MacOS, and Linux
111- - name : Set R/Rust target directory
112- if : matrix.config.os == 'windows-latest'
113- run : |
114- echo "SEDONADB_TARGET_DIR=$(pwd -W)/r/sedonadb/src/rust/target" >> $GITHUB_ENV
115- shell : bash
117+ workspaces : ${{ env.CACHE_WORKSPACE }}
116118
117119 - uses : r-lib/actions/setup-r-dependencies@v2
118120 with :
0 commit comments