@@ -601,35 +601,42 @@ fn activate(
601601 )
602602 // and associate dep with that edge
603603 . push ( dep. clone ( ) ) ;
604- let cs: Vec < PackageId > = cx
605- . public_dependency
606- . get ( & candidate_pid)
607- . iter ( )
608- . flat_map ( |x| x. values ( ) )
609- . filter_map ( |x| if x. 1 { Some ( & x. 0 ) } else { None } )
610- . chain ( & Some ( candidate_pid) )
611- . cloned ( )
612- . collect ( ) ;
613- for c in cs {
614- let mut stack = vec ! [ ( parent_pid, dep. is_public( ) ) ] ;
615- while let Some ( ( p, public) ) = stack. pop ( ) {
616- match cx. public_dependency . entry ( p) . or_default ( ) . entry ( c. name ( ) ) {
617- im_rc:: hashmap:: Entry :: Occupied ( mut o) => {
618- assert_eq ! ( o. get( ) . 0 , c) ;
619- if o. get ( ) . 1 {
620- continue ;
604+ // For now the interaction of public dependency conflicts with renamed and
605+ // 'cfg({})' dependencies is not clear. So we disable public checks if the
606+ // other functionality is used.
607+ // TODO: this disable is not a long term solution.
608+ // This needs to be removed before public dependencies are stabilized!
609+ if dep. platform ( ) . is_none ( ) && dep. explicit_name_in_toml ( ) . is_none ( ) {
610+ let cs: Vec < PackageId > = cx
611+ . public_dependency
612+ . get ( & candidate_pid)
613+ . iter ( )
614+ . flat_map ( |x| x. values ( ) )
615+ . filter_map ( |x| if x. 1 { Some ( & x. 0 ) } else { None } )
616+ . chain ( & Some ( candidate_pid) )
617+ . cloned ( )
618+ . collect ( ) ;
619+ for c in cs {
620+ let mut stack = vec ! [ ( parent_pid, dep. is_public( ) ) ] ;
621+ while let Some ( ( p, public) ) = stack. pop ( ) {
622+ match cx. public_dependency . entry ( p) . or_default ( ) . entry ( c. name ( ) ) {
623+ im_rc:: hashmap:: Entry :: Occupied ( mut o) => {
624+ assert_eq ! ( o. get( ) . 0 , c) ;
625+ if o. get ( ) . 1 {
626+ continue ;
627+ }
628+ if public {
629+ o. insert ( ( c, public) ) ;
630+ }
621631 }
622- if public {
623- o . insert ( ( c, public) ) ;
632+ im_rc :: hashmap :: Entry :: Vacant ( v ) => {
633+ v . insert ( ( c, public) ) ;
624634 }
625635 }
626- im_rc:: hashmap:: Entry :: Vacant ( v) => {
627- v. insert ( ( c, public) ) ;
628- }
629- }
630- if public {
631- for & ( grand, ref d) in cx. parents . edges ( & p) {
632- stack. push ( ( grand, d. iter ( ) . any ( |x| x. is_public ( ) ) ) ) ;
636+ if public {
637+ for & ( grand, ref d) in cx. parents . edges ( & p) {
638+ stack. push ( ( grand, d. iter ( ) . any ( |x| x. is_public ( ) ) ) ) ;
639+ }
633640 }
634641 }
635642 }
@@ -774,26 +781,35 @@ impl RemainingCandidates {
774781 // we have to reject this candidate. Additionally this candidate may already have been
775782 // activated and have public dependants of its own,
776783 // all of witch also need to be checked the same way.
777- for & t in cx
778- . public_dependency
779- . get ( & b. summary . package_id ( ) )
780- . iter ( )
781- . flat_map ( |x| x. values ( ) )
782- . filter_map ( |x| if x. 1 { Some ( & x. 0 ) } else { None } )
783- . chain ( & Some ( b. summary . package_id ( ) ) )
784- {
785- let mut stack = vec ! [ ( parent, dep. is_public( ) ) ] ;
786- while let Some ( ( p, public) ) = stack. pop ( ) {
787- // TODO: dont look at the same thing more then once
788- if let Some ( o) = cx. public_dependency . get ( & p) . and_then ( |x| x. get ( & t. name ( ) ) ) {
789- if o. 0 != t {
790- conflicting_prev_active. insert ( p, ConflictReason :: PublicDependency ) ;
791- continue ' main;
784+
785+ // For now the interaction of public dependency conflicts with renamed and
786+ // 'cfg({})' dependencies is not clear. So we disable public checks if the
787+ // other functionality is used.
788+ // TODO: this disable is not a long term solution.
789+ // This needs to be removed before public dependencies are stabilized!
790+ if dep. platform ( ) . is_none ( ) && dep. explicit_name_in_toml ( ) . is_none ( ) {
791+ for & t in cx
792+ . public_dependency
793+ . get ( & b. summary . package_id ( ) )
794+ . iter ( )
795+ . flat_map ( |x| x. values ( ) )
796+ . filter_map ( |x| if x. 1 { Some ( & x. 0 ) } else { None } )
797+ . chain ( & Some ( b. summary . package_id ( ) ) )
798+ {
799+ let mut stack = vec ! [ ( parent, dep. is_public( ) ) ] ;
800+ while let Some ( ( p, public) ) = stack. pop ( ) {
801+ // TODO: dont look at the same thing more then once
802+ if let Some ( o) = cx. public_dependency . get ( & p) . and_then ( |x| x. get ( & t. name ( ) ) )
803+ {
804+ if o. 0 != t {
805+ conflicting_prev_active. insert ( p, ConflictReason :: PublicDependency ) ;
806+ continue ' main;
807+ }
792808 }
793- }
794- if public {
795- for & ( grand, ref d ) in cx . parents . edges ( & p ) {
796- stack . push ( ( grand , d . iter ( ) . any ( |x| x . is_public ( ) ) ) ) ;
809+ if public {
810+ for & ( grand , ref d ) in cx . parents . edges ( & p ) {
811+ stack . push ( ( grand, d . iter ( ) . any ( |x| x . is_public ( ) ) ) ) ;
812+ }
797813 }
798814 }
799815 }
0 commit comments