@@ -160,7 +160,7 @@ impl BuildContextBuilder {
160160 }
161161
162162 let ( strip, include_debuginfo, auditwheel) =
163- Self :: resolve_build_flags ( strip, & build_options, pyproject) ;
163+ Self :: resolve_build_flags ( strip, & build_options, pyproject, & target ) ;
164164
165165 let sbom = Self :: resolve_sbom_config ( & build_options, pyproject) ;
166166
@@ -319,6 +319,7 @@ impl BuildContextBuilder {
319319 strip : Option < bool > ,
320320 build_options : & BuildOptions ,
321321 pyproject : Option < & PyProjectToml > ,
322+ target : & Target ,
322323 ) -> ( bool , bool , AuditWheelMode ) {
323324 let strip = strip. unwrap_or_else ( || pyproject. map ( |x| x. strip ( ) ) . unwrap_or_default ( ) ) ;
324325 let include_debuginfo = if strip && build_options. output . include_debuginfo {
@@ -331,15 +332,20 @@ impl BuildContextBuilder {
331332 } ;
332333 let skip_auditwheel = pyproject. map ( |x| x. skip_auditwheel ( ) ) . unwrap_or_default ( )
333334 || build_options. platform . skip_auditwheel ;
335+ let default_mode = if skip_auditwheel {
336+ AuditWheelMode :: Skip
337+ } else if target. is_linux ( ) {
338+ AuditWheelMode :: Repair
339+ } else {
340+ // macOS and Windows repair support is newer;
341+ // default to Warn so we don't break existing workflows.
342+ AuditWheelMode :: Warn
343+ } ;
334344 let auditwheel = build_options
335345 . platform
336346 . auditwheel
337347 . or_else ( || pyproject. and_then ( |x| x. auditwheel ( ) ) )
338- . unwrap_or ( if skip_auditwheel {
339- AuditWheelMode :: Skip
340- } else {
341- AuditWheelMode :: Repair
342- } ) ;
348+ . unwrap_or ( default_mode) ;
343349 ( strip, include_debuginfo, auditwheel)
344350 }
345351
0 commit comments