Skip to content

Commit 1d369d8

Browse files
authored
Use absolute paths for build directories
Updated paths to use absolute references in build process.
1 parent 208d245 commit 1d369d8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ jobs:
225225
226226
# 2. LOCATE FILES
227227
VCPKG_LIB_DIR="$VCPKG_ROOT/installed/${{ matrix.triplet }}/lib"
228+
# USE ABSOLUTE PATH FOR BUILD DIR TO PREVENT 'cd' ERRORS
228229
BUILD_DIR="$(pwd)/build"
229230
230231
LIBOGG=$(find "$VCPKG_LIB_DIR" -name "*ogg.a" -o -name "*ogg.lib" | head -n 1)
@@ -242,6 +243,7 @@ jobs:
242243
libtool -static -o "$BUILD_DIR/libopusfile_combined.a" "$LIBOPUSFILE" "$LIBOPUS" "$LIBOGG"
243244
244245
# Safely copy individual files, avoiding copy-to-self error
246+
# checks if Source and Dest strings are different
245247
if [ "$LIBOPUSFILE" != "$BUILD_DIR/libopusfile.a" ]; then
246248
cp "$LIBOPUSFILE" "$BUILD_DIR/libopusfile.a"
247249
fi
@@ -255,11 +257,12 @@ jobs:
255257
else
256258
echo "Using ar repack (Windows/Linux/Android)..."
257259
258-
WORK_DIR="build/repack_work"
260+
# USE ABSOLUTE PATH FOR WORKSPACE
261+
WORK_DIR="$(pwd)/build/repack_work"
259262
rm -rf "$WORK_DIR"
260263
mkdir -p "$WORK_DIR/combined"
261264
262-
# Extract function that copies ALL files from archive, not just *.o
265+
# Extract function using Absolute Paths
263266
extract_lib() {
264267
local LIB_PATH="$1"
265268
local NAME="$2"
@@ -273,8 +276,7 @@ jobs:
273276
rm lib.a
274277
popd > /dev/null
275278
276-
# Copy ALL extracted content to combined (glob all files, ignore errors if empty but shouldn't be)
277-
# We use find . -type f to be safe against glob failure
279+
# Copy ALL extracted content to combined using find to avoid glob errors
278280
find "$DEST" -type f -exec cp {} "$WORK_DIR/combined/" \;
279281
}
280282
@@ -288,7 +290,7 @@ jobs:
288290
"$TOOL_RANLIB" "$BUILD_DIR/libopusfile_combined.a"
289291
290292
# Create Individual (Fix Thin Archive)
291-
# Reuse extracted files from their specific folders
293+
# Use absolute paths for cd to prevent 'No such file' errors
292294
cd "$WORK_DIR/ogg"
293295
"$TOOL_AR" crs "$BUILD_DIR/libogg.a" *
294296
"$TOOL_RANLIB" "$BUILD_DIR/libogg.a"

0 commit comments

Comments
 (0)