Subversion Repositories DevTools

Rev

Rev 7079 | Rev 7081 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7079 Rev 7080
Line 993... Line 993...
993
                //  Insert all the WIPs and RIPPLES into the buildset. 
993
                //  Insert all the WIPs and RIPPLES into the buildset. 
994
                //  Generate a plan and see how much the time is extended.
994
                //  Generate a plan and see how much the time is extended.
995
                //
995
                //
996
                //  Don't modify mPackageCollection, although data in the 'Package' in the underlying packages may change
996
                //  Don't modify mPackageCollection, although data in the 'Package' in the underlying packages may change
997
                
997
                
998
                PlanResults fullPlan = null;           
-
 
999
                fullPlan = postRipplePlan("Full", basicPlan, true);
998
                PlanResults fullPlan = postRipplePlan("Full", basicPlan, true);
1000
                
999
                
1001
                //  Decide with plan to use
1000
                //  Decide with plan to use
1002
                //  At the moment we have, at most two.
1001
                //  At the moment we have, at most two.
1003
                //      - (basic) Current Release ripples
1002
                //      - (basic) Current Release ripples
1004
                //      - (full) Current Release + All WIPS and RIPPLES
1003
                //      - (full) Current Release + All WIPS and RIPPLES
1005
                //
1004
                //
1006
                //  If we have both then if the full plan is < 20% longer than the basic plan, use the full plan
1005
                //  If we have both then if the full plan is < 20% longer than the basic plan, use the full plan
1007
                //  Otherwise we use basic plan FOLLOWED by the a MODIFIED full plan (one without the natural ripples)
1006
                //  Otherwise we use basic plan FOLLOWED by the a MODIFIED full plan (one without the natural ripples)
1008
                //  Add the planned packages into the buildOrder
1007
                //  Add the planned packages into the buildOrder
1009
    
1008
    
1010
                if( !basicPlan.planCollection.isEmpty() && fullPlan != null )
1009
                if( !basicPlan.planCollection.isEmpty() && !fullPlan.planCollection.isEmpty() )
1011
                {
1010
                {
1012
                    mLogger.error("Two plan selection: {} {}, {} <= {}", basicPlan.planTime,fullPlan.planTime, basicPlan.planTime * 12, fullPlan.planTime * 10);
1011
                    mLogger.info("Two plan selection: {} {}, {} <= {}", basicPlan.planTime,fullPlan.planTime, basicPlan.planTime * 12, fullPlan.planTime * 10);
1013
                    if ( (basicPlan.planTime * 12) <= (fullPlan.planTime * 10) )
1012
                    if ( (basicPlan.planTime * 12) <= (fullPlan.planTime * 10) )
1014
                    {
1013
                    {
1015
                        //  Use the basic plan FOLLOWED by a plan that does not include
1014
                        //  Use the basic plan FOLLOWED by a plan that does not include
1016
                        //      Ripples done by the basic plan
1015
                        //      Ripples done by the basic plan
1017
                        //      WIPs/RIPPLES done in the course of doing the basic plan
1016
                        //      WIPs/RIPPLES done in the course of doing the basic plan
Line 1026... Line 1025...
1026
                    }
1025
                    }
1027
                } else if (!basicPlan.planCollection.isEmpty() ) {
1026
                } else if (!basicPlan.planCollection.isEmpty() ) {
1028
                    // Use the basic plan
1027
                    // Use the basic plan
1029
                    mBuildOrder.addAll(basicPlan.planCollection);
1028
                    mBuildOrder.addAll(basicPlan.planCollection);
1030
                    
1029
                    
1031
                } else if ( fullPlan != null ) {
1030
                } else if ( !fullPlan.planCollection.isEmpty() ) {
1032
                    // Use the full plan, but treat it as the basic plan so that we will mark level-0 builds
-
 
1033
                    basicPlan = fullPlan;
1031
                    // Use the full plan
1034
                    fullPlan = null;
-
 
1035
                    mBuildOrder.addAll(basicPlan.planCollection);
1032
                    mBuildOrder.addAll(basicPlan.planCollection);
1036
                    
1033
                    
1037
                } else {
1034
                } else {
1038
                    // Do not have a plan
1035
                    // Do not have a plan
1039
                    // May have tests requests
1036
                    // May have tests requests
Line 1121... Line 1118...
1121
                         // relevant (direct and indirect) excluded pv's in the database
1118
                         // relevant (direct and indirect) excluded pv's in the database
1122
                         if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
1119
                         if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
1123
                         {
1120
                         {
1124
                             // package is not reproducible, discard it and its consumers
1121
                             // package is not reproducible, discard it and its consumers
1125
                             //
1122
                             //
1126
                             mLogger.error("Excluded Package {}, {}", p.mAlias, be.mRootCause);                                     
1123
                             mLogger.info("Excluded Package {}, {}", p.mAlias, be.mRootCause);                                     
1127
                             
1124
                             
1128
                             ArrayList<Package> toExclude = new ArrayList<Package>();
1125
                             ArrayList<Package> toExclude = new ArrayList<Package>();
1129
                             toExclude.addAll(usedByAnyPackages(p, mPackageCollection ));
1126
                             toExclude.addAll(usedByAnyPackages(p, mPackageCollection ));
1130
                             
1127
                             
1131
                             //  Process packages that we need to exclude indirectly
1128
                             //  Process packages that we need to exclude indirectly
Line 1148... Line 1145...
1148
                                 
1145
                                 
1149
                                 if (!found)
1146
                                 if (!found)
1150
                                 {
1147
                                 {
1151
                                     BuildExclusion buildExclusion = new BuildExclusion(pkg.mId, p.mId, null, p.mTestBuildInstruction);
1148
                                     BuildExclusion buildExclusion = new BuildExclusion(pkg.mId, p.mId, null, p.mTestBuildInstruction);
1152
                                     it.add(buildExclusion);
1149
                                     it.add(buildExclusion);
1153
                                     mLogger.error("Indirectly Excluded Package {}", pkg.mAlias);  
1150
                                     mLogger.info("Indirectly Excluded Package {}", pkg.mAlias);  
1154
 
1151
 
1155
                                     ArrayList<Package> usedBy = usedByAnyPackages(p, mPackageCollectionAll );
1152
                                     ArrayList<Package> usedBy = usedByAnyPackages(p, mPackageCollectionAll );
1156
                                     toExclude.addAll(usedBy);
1153
                                     toExclude.addAll(usedBy);
1157
                                 }
1154
                                 }
1158
                             }
1155
                             }
Line 1206... Line 1203...
1206
    
1203
    
1207
            mLogger.error("Final Plan");
1204
            mLogger.error("Final Plan");
1208
            for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
1205
            for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
1209
            {
1206
            {
1210
                PlannedPackage p = it.next();
1207
                PlannedPackage p = it.next();
1211
                mLogger.error("Plan: {} {}", p.mBuildLevel, p.mPkg.mAlias);
1208
                mLogger.error("Plan: {} {} {}", p.mBuildLevel, p.mPkg.mAlias, p.mPkg.mId);
1212
            }
1209
            }
1213
               
1210
               
1214
    
1211
    
1215
        }
1212
        }
1216
 
1213
 
Line 1254... Line 1251...
1254
            if (p.mBuildFile < 0) {
1251
            if (p.mBuildFile < 0) {
1255
                exclude.add(p);
1252
                exclude.add(p);
1256
            }
1253
            }
1257
        }
1254
        }
1258
        
1255
        
-
 
1256
        //  Exclude packages that have failed to be built
-
 
1257
        //      These are recorded in mBuildExclusionCollection
-
 
1258
        for (ListIterator<BuildExclusion> it = mBuildExclusionCollection.listIterator(); it.hasNext(); )
-
 
1259
        {
-
 
1260
            BuildExclusion be = it.next();
-
 
1261
            if (be.mRootCause == null && be.mRootId == -1 )
-
 
1262
            {
-
 
1263
                for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
-
 
1264
                {
-
 
1265
                    Package p = it1.next();
-
 
1266
                    if (p.mId == be.mId) {
-
 
1267
                        p.mBuildFile  = -3;
-
 
1268
                        exclude.add(p);
-
 
1269
                        break;
-
 
1270
                    }
-
 
1271
                }
-
 
1272
            }
-
 
1273
        }
-
 
1274
 
-
 
1275
        
1259
        //  Process the list of packages to be excluded
1276
        //  Process the list of packages to be excluded
1260
        //  Add to the list packages that depend on the excluded package that have not already been excluded
1277
        //  Add to the list packages that depend on the excluded package that have not already been excluded
1261
        while( !exclude.isEmpty() )
1278
        while( !exclude.isEmpty() )
1262
        {
1279
        {
1263
            Package p = exclude.remove(0);
1280
            Package p = exclude.remove(0);
Line 1270... Line 1287...
1270
                Package pkg = it1.next();
1287
                Package pkg = it1.next();
1271
                if (pkg.mProcessed) {
1288
                if (pkg.mProcessed) {
1272
                    continue;
1289
                    continue;
1273
                }
1290
                }
1274
                
1291
                
1275
                for (Iterator<String> it = p.mDependencyCollection.iterator(); it.hasNext(); )
1292
                for (Iterator<String> it = pkg.mDependencyCollection.iterator(); it.hasNext(); )
1276
                {
1293
                {
1277
                    String alias = it.next();
1294
                    String alias = it.next();
1278
                    if ( p.mAlias.compareTo( alias ) == 0 ) {
1295
                    if ( p.mAlias.compareTo( alias ) == 0 ) {
1279
                        exclude.add(pkg);
1296
                        exclude.add(pkg);
1280
                    }
1297
                    }
Line 1441... Line 1458...
1441
                }
1458
                }
1442
                
1459
                
1443
                //  Sort the packages by buildOrder and buildTime
1460
                //  Sort the packages by buildOrder and buildTime
1444
                Collections.sort(ripplePlan, PlannedPackage.BuildOrderComparitor);
1461
                Collections.sort(ripplePlan, PlannedPackage.BuildOrderComparitor);
1445
                
1462
                
1446
                mLogger.error("Plan Build {} Time: {}", name, results.planTime);
1463
                mLogger.info("Plan Build {} Time: {}", name, results.planTime);
1447
                for (Iterator<PlannedPackage> it = ripplePlan.iterator(); it.hasNext(); )
1464
                for (Iterator<PlannedPackage> it = ripplePlan.iterator(); it.hasNext(); )
1448
                {
1465
                {
1449
                    PlannedPackage p = it.next();
1466
                    PlannedPackage p = it.next();
1450
                    mLogger.error("Plan: {} {}", p.mBuildLevel, p.mPkg.mAlias);
1467
                    mLogger.info("Plan: {} {}", p.mBuildLevel, p.mPkg.mAlias);
1451
                }
1468
                }
1452
            }
1469
            }
1453
            
1470
            
1454
            //  Daemon mode: Returning calculated plan
1471
            //  Daemon mode: Returning calculated plan
1455
            results.planCollection = ripplePlan;
1472
            results.planCollection = ripplePlan;
Line 1486... Line 1503...
1486
                        for (Iterator<PlannedPackage> it1 = basicPlan.planCollection.iterator(); it1.hasNext(); )
1503
                        for (Iterator<PlannedPackage> it1 = basicPlan.planCollection.iterator(); it1.hasNext(); )
1487
                        {
1504
                        {
1488
                            PlannedPackage pkg = it1.next();
1505
                            PlannedPackage pkg = it1.next();
1489
                            if (pkg.mPkg == p)
1506
                            if (pkg.mPkg == p)
1490
                            {
1507
                            {
1491
                                mLogger.error("Test Plan without {}", p.mAlias);
1508
                                mLogger.info("Test Plan without {}", p.mAlias);
1492
                                continue;
1509
                                continue;
1493
                            }
1510
                            }
1494
                        }
1511
                        }
1495
                    }
1512
                    }
1496
                    
1513
                    
1497
                    mLogger.error("Test Plan with {}", p.mAlias);
1514
                    mLogger.info("Test Plan with {}", p.mAlias);
1498
                    Package foundInRelease = mReleaseManager.findPackage(p.mAlias, fullPlanCollection);
1515
                    Package foundInRelease = mReleaseManager.findPackage(p.mAlias, fullPlanCollection);
1499
                    int foundIndex = mReleaseManager.findPackageLastIndex;
1516
                    int foundIndex = mReleaseManager.findPackageLastIndex;
1500
                    if (foundInRelease == ReleaseManager.NULL_PACKAGE)
1517
                    if (foundInRelease == ReleaseManager.NULL_PACKAGE)
1501
                    {
1518
                    {
1502
                        fullPlanCollection.add(p);
1519
                        fullPlanCollection.add(p);
Line 1955... Line 1972...
1955
                    //if (!buildExclusion.isProcessed())
1972
                    //if (!buildExclusion.isProcessed())
1956
                    {
1973
                    {
1957
                        xml.addComment(buildExclusion.info());
1974
                        xml.addComment(buildExclusion.info());
1958
                    }
1975
                    }
1959
                }
1976
                }
1960
                
1977
            }
1961
                // UTF Support
1978
            
-
 
1979
            // UTF Support (Also while trailing the changes)
1962
                // Insert build Plan
1980
            // Insert build Plan
1963
                if (mDaemon)
1981
            if (mDaemon)
-
 
1982
            {
-
 
1983
                xml.addComment("mBuildOrder");
-
 
1984
                for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
1964
                {
1985
                {
1965
                    xml.addComment("mBuildOrder");
-
 
1966
                    for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
-
 
1967
                    {
-
 
1968
                        PlannedPackage p = it.next();
1986
                    PlannedPackage p = it.next();
1969
                        String comment =
1987
                    String comment =
1970
                                "pvid="+ p.mPkg.mId +
1988
                            "pvid="+ p.mPkg.mId +
1971
                                " order=" + p.mBuildLevel +
1989
                            " order=" + p.mBuildLevel +
1972
                                " time=" + p.mPkg.mBuildTime +
1990
                            " time=" + p.mPkg.mBuildTime +
1973
                                " name=\"" + p.mPkg.mAlias + "\"";
1991
                            " name=\"" + p.mPkg.mAlias + "\"";
1974
                        xml.addComment(comment);
1992
                    xml.addComment(comment);
1975
                    }
-
 
1976
                }
1993
                }
1977
            }
1994
            }
1978
 
1995
 
1979
            //  Generate Taskdef information
1996
            //  Generate Taskdef information
1980
            generateTaskdef(xml);
1997
            generateTaskdef(xml);