Skip to content

Commit 821982f

Browse files
committed
Crazy stuff
1 parent c570edb commit 821982f

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

.github/workflows/windows_source_build.yaml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Install FFmpeg
4747
run: |
48-
# Install FFmpeg and its development headers
48+
# Install FFmpeg and try to get development packages
4949
conda install "ffmpeg=${{ matrix.ffmpeg-version }}" -c conda-forge --quiet
5050
5151
ffmpeg -version
@@ -73,6 +73,10 @@ jobs:
7373
echo "CMAKE_PREFIX_PATH=$conda_env_path/Library" >> $GITHUB_ENV
7474
echo "LIBRARY_PATH=$library_lib_path" >> $GITHUB_ENV
7575
echo "INCLUDE_PATH=$library_include_path" >> $GITHUB_ENV
76+
77+
# Add the Library/lib directory to the linker path for Visual Studio
78+
echo "LIB=$library_lib_path;$LIB" >> $GITHUB_ENV
79+
echo "LIBPATH=$library_lib_path;$LIBPATH" >> $GITHUB_ENV
7680
7781
# Verify FFmpeg DLLs are accessible
7882
echo "Checking if FFmpeg DLLs are in PATH:"
@@ -85,6 +89,23 @@ jobs:
8589
# Install pkg-config and pybind11 which are needed for Windows builds
8690
conda install -y pkg-config pybind11 -c conda-forge --quiet
8791
92+
# Inspect what's actually in the Library directory
93+
echo "Contents of Library/lib:"
94+
ls -la "$CONDA_PREFIX/Library/lib/" | head -20
95+
echo "Looking for harfbuzz files:"
96+
find "$CONDA_PREFIX/Library/" -name "*harfbuzz*" 2>/dev/null || echo "No harfbuzz files found"
97+
echo "Looking for freetype files:"
98+
find "$CONDA_PREFIX/Library/" -name "*freetype*" 2>/dev/null || echo "No freetype files found"
99+
100+
# Check if the .lib files exist with the exact names pkg-config expects
101+
conda_env_path=$(conda info --base)/envs/build
102+
library_lib_path="$conda_env_path/Library/lib"
103+
104+
echo "Checking for specific .lib files in $library_lib_path:"
105+
ls -la "$library_lib_path/harfbuzz.lib" 2>/dev/null || echo "harfbuzz.lib not found"
106+
ls -la "$library_lib_path/freetype.lib" 2>/dev/null || echo "freetype.lib not found"
107+
ls -la "$library_lib_path/"*harfbuzz* 2>/dev/null || echo "No harfbuzz files in lib"
108+
ls -la "$library_lib_path/"*freetype* 2>/dev/null || echo "No freetype files in lib"
88109
89110
# Verify pkg-config can find FFmpeg
90111
echo "Testing pkg-config for FFmpeg libraries:"
@@ -124,9 +145,24 @@ jobs:
124145
# Build without BUILD_AGAINST_ALL_FFMPEG_FROM_S3 to use system FFmpeg
125146
echo "Building torchcodec from source using system FFmpeg..."
126147
127-
# On Windows, we may need to disable some CMake flags that cause linking issues
148+
# On Windows, try to work around the dependency linking issues
149+
# by setting CMAKE_ARGS to use dynamic linking where possible
128150
export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DTORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR=ON"
129151
152+
# Try to create symlinks for missing .lib files if the DLLs exist
153+
conda_env_path=$(conda info --base)/envs/build
154+
library_lib_path="$conda_env_path/Library/lib"
155+
library_bin_path="$conda_env_path/Library/bin"
156+
157+
# Check if we can create import libraries from DLLs for missing dependencies
158+
if [ ! -f "$library_lib_path/harfbuzz.lib" ] && [ -f "$library_bin_path/harfbuzz.dll" ]; then
159+
echo "Attempting to create harfbuzz.lib from harfbuzz.dll"
160+
# This is a workaround - we'll try to use lib.exe to create an import library
161+
# lib.exe /def:harfbuzz.def /out:harfbuzz.lib /machine:x64
162+
# But this requires a .def file which we don't have
163+
echo "harfbuzz.lib missing but harfbuzz.dll exists"
164+
fi
165+
130166
python -m pip install -e . --no-build-isolation -v
131167
132168
- name: Test torchcodec import

0 commit comments

Comments
 (0)