Skip to content

Commit 4921aff

Browse files
committed
dirty subst hack to try and shorten paths
1 parent 6a72abe commit 4921aff

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
with:
9393
path: |
9494
~/.cargo
95-
nobodywho/target
95+
C:/b
9696
key: ${{ runner.os }}-cargo-home-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
9797
restore-keys: |
9898
${{ runner.os }}-cargo-home-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}-
@@ -120,18 +120,27 @@ jobs:
120120
- name: Build with Cargo
121121
# move things into a shortly-named dir in the root, because windows is made by fuckwits who think limiting paths to 260 chars is ok
122122
run: |
123-
mv ./nobodywho/* C:/
124-
cd C:/
125-
# Use an even shorter target directory to avoid path length issues with git dependencies
126-
cargo build -p nobodywho-${{ matrix.integration }} --verbose --target ${{ matrix.target }} ${{ matrix.profile == 'release' && '--release' || '' }} --locked --target-dir C:/t
123+
# Copy source to short path
124+
mkdir C:\s
125+
xcopy /E /I /Y .\nobodywho\* C:\s\
126+
cd C:\s
127+
# Create the full target directory structure
128+
mkdir -p C:\b\${{ matrix.target }}\${{ matrix.profile }}\build
129+
# Map Y: deep into the build path where llama-cpp-sys builds happen
130+
# This replaces "C:\b\x86_64-pc-windows-msvc\debug\build" with just "Y:"
131+
subst Y: C:\b\${{ matrix.target }}\${{ matrix.profile }}\build
132+
# Build using C:\b as target dir, but Y: will be used for the deep build paths
133+
cargo build -p nobodywho-${{ matrix.integration }} --verbose --target ${{ matrix.target }} ${{ matrix.profile == 'release' && '--release' || '' }} --locked --target-dir C:\b
127134
env:
128135
RUSTFLAGS: >-
129136
-l Advapi32
130137
131138
- name: "Rename built files"
132139
run: |
133-
cp C:/t/${{ matrix.target }}/${{ matrix.profile }}/nobodywho_${{ matrix.integration }}.dll ./nobodywho-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}.dll
134-
cp C:/t/${{ matrix.target }}/${{ matrix.profile }}/nobodywho_${{ matrix.integration }}.pdb ./nobodywho-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}.pdb
140+
cp C:\b\${{ matrix.target }}\${{ matrix.profile }}\nobodywho_${{ matrix.integration }}.dll .\nobodywho-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}.dll
141+
cp C:\b\${{ matrix.target }}\${{ matrix.profile }}\nobodywho_${{ matrix.integration }}.pdb .\nobodywho-${{ matrix.integration }}-${{ matrix.target }}-${{ matrix.profile }}.pdb
142+
# Clean up virtual drive
143+
subst Y: /d
135144
136145
- name: "Upload build artifacts"
137146
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)