|
45 | 45 |
|
46 | 46 | - name: Install FFmpeg |
47 | 47 | run: | |
48 | | - # Install FFmpeg and its development headers |
| 48 | + # Install FFmpeg and try to get development packages |
49 | 49 | conda install "ffmpeg=${{ matrix.ffmpeg-version }}" -c conda-forge --quiet |
50 | 50 | |
51 | 51 | ffmpeg -version |
|
73 | 73 | echo "CMAKE_PREFIX_PATH=$conda_env_path/Library" >> $GITHUB_ENV |
74 | 74 | echo "LIBRARY_PATH=$library_lib_path" >> $GITHUB_ENV |
75 | 75 | 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 |
76 | 80 |
|
77 | 81 | # Verify FFmpeg DLLs are accessible |
78 | 82 | echo "Checking if FFmpeg DLLs are in PATH:" |
|
85 | 89 | # Install pkg-config and pybind11 which are needed for Windows builds |
86 | 90 | conda install -y pkg-config pybind11 -c conda-forge --quiet |
87 | 91 | |
| 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" |
88 | 109 | |
89 | 110 | # Verify pkg-config can find FFmpeg |
90 | 111 | echo "Testing pkg-config for FFmpeg libraries:" |
@@ -124,9 +145,24 @@ jobs: |
124 | 145 | # Build without BUILD_AGAINST_ALL_FFMPEG_FROM_S3 to use system FFmpeg |
125 | 146 | echo "Building torchcodec from source using system FFmpeg..." |
126 | 147 | |
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 |
128 | 150 | export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DTORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR=ON" |
129 | 151 | |
| 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 | + |
130 | 166 | python -m pip install -e . --no-build-isolation -v |
131 | 167 |
|
132 | 168 | - name: Test torchcodec import |
|
0 commit comments