File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,28 @@ impl DevelPack {
163163 /// Downloads a new PHP development pack, unzips it in the build script
164164 /// temporary directory.
165165 fn new ( version : & str , is_zts : bool , arch : Arch ) -> Result < DevelPack > {
166+ // If the PHP version is more than 8.4.1, use VS17 instead of VS16.
167+ let version_float = version
168+ . split ( '.' )
169+ . take ( 2 )
170+ . collect :: < Vec < _ > > ( )
171+ . join ( "." )
172+ . parse :: < f32 > ( )
173+ . context ( "Failed to parse PHP version as float" ) ?;
174+
175+ // PHP builds switched to VS17 in PHP 8.4.1.
176+ let visual_studio_version = if version_float >= 8.4f32 {
177+ "vs17"
178+ } else {
179+ "vs16"
180+ } ;
181+
182+
166183 let zip_name = format ! (
167184 "php-devel-pack-{}{}-Win32-{}-{}.zip" ,
168185 version,
169186 if is_zts { "" } else { "-nts" } ,
170- "vs16" , /* TODO(david): At the moment all PHPs supported by ext-php-rs use VS16 so
171- * this is constant. */
187+ visual_studio_version,
172188 arch
173189 ) ;
174190
You can’t perform that action at this time.
0 commit comments