Print this page
make: remove more distributed mode code

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/parallel.cc
          +++ new/usr/src/cmd/make/bin/parallel.cc
↓ open down ↓ 92 lines elided ↑ open up ↑
  93   93  static  pid_t           run_rule_commands(char *host, char **commands);
  94   94  static  Property        *set_conditionals(int cnt, Name *targets);
  95   95  static  void            store_conditionals(Running rp);
  96   96  
  97   97  
  98   98  /*
  99   99   *      execute_parallel(line, waitflg)
 100  100   *
 101  101   *      DMake 2.x:
 102  102   *      parallel mode: spawns a parallel process to execute the command group.
 103      - *      distributed mode: sends the command group down the pipe to rxm.
 104  103   *
 105  104   *      Return value:
 106  105   *                              The result of the execution
 107  106   *
 108  107   *      Parameters:
 109  108   *              line            The command group to execute
 110  109   */
 111  110  Doname
 112  111  execute_parallel(Property line, Boolean waitflg, Boolean local)
 113  112  {
↓ open down ↓ 62 lines elided ↑ open up ↑
 176  175          for (rule = line->body.line.command_used;
 177  176               rule != NULL;
 178  177               rule = rule->next) {
 179  178                  if (posix && (touch || quest) && !rule->always_exec) {
 180  179                          continue;
 181  180                  }
 182  181                  if (vpath_defined) {
 183  182                          rule->command_line =
 184  183                            vpath_translation(rule->command_line);
 185  184                  }
 186      -                if (dmake_mode_type == distributed_mode) {
 187      -                        cmd_options = 0;
 188      -                        if(local) {
 189      -                                cmd_options |= local_host_mask;
 190      -                        }
 191      -                } else {
 192      -                        silent_flag = false;
 193      -                        ignore = 0;
 194      -                }
      185 +                
      186 +                silent_flag = false;
      187 +                ignore = 0;
      188 +
 195  189                  if (rule->command_line->hash.length > 0) {
 196  190                          if (++argcnt == MAXRULES) {
 197      -                                if (dmake_mode_type == distributed_mode) {
 198      -                                        /* XXX - tell rxm to execute on local host. */
 199      -                                        /* I WAS HERE!!! */
 200      -                                } else {
 201      -                                        /* Too many rules, run serially instead. */
 202      -                                        return build_serial;
 203      -                                }
      191 +                                return build_serial;
 204  192                          }
 205  193                          {
 206  194                                  if (rule->silent && !silent) {
 207  195                                          silent_flag = true;
 208  196                                  }
 209  197                                  if (rule->ignore_error) {
 210  198                                          ignore++;
 211  199                                  }
 212  200                                  /* XXX - need to add support for + prefix */
 213  201                                  if (silent_flag || ignore) {
↓ open down ↓ 1005 lines elided ↑ open up ↑
1219 1207                   * that target.
1220 1208                   */
1221 1209                  if (rp->state == build_ok || rp->state == build_failed) {
1222 1210                          *rp_prev = rp->next;
1223 1211                          if (rp->next == NULL) {
1224 1212                                  running_tail = rp_prev;
1225 1213                          }
1226 1214                          if ((line2 = rp->command) == NULL) {
1227 1215                                  line2 = get_prop(rp->target->prop, line_prop);
1228 1216                          }
1229      -                        if (dmake_mode_type == distributed_mode) {
1230      -                                if (rp->make_refd) {
1231      -                                        maybe_reread_make_state();
1232      -                                }
1233      -                        } else {
1234      -                                /*
1235      -                                 * Check if there were any job output
1236      -                                 * from the parallel build.
1237      -                                 */
1238      -                                if (rp->stdout_file != NULL) {
1239      -                                        if (stat(rp->stdout_file, &out_buf) < 0) {
1240      -                                                fatal(catgets(catd, 1, 130, "stat of %s failed: %s"),
1241      -                                                      rp->stdout_file,
1242      -                                                      errmsg(errno));
1243      -                                        }
1244      -                                        if ((line2 != NULL) &&
1245      -                                            (out_buf.st_size > 0)) {
1246      -                                                cmds_length = 0;
1247      -                                                for (rule = line2->body.line.command_used,
1248      -                                                     silent_flag = silent;
1249      -                                                     rule != NULL;
1250      -                                                     rule = rule->next) {
1251      -                                                        cmds_length += rule->command_line->hash.length + 1;
1252      -                                                        silent_flag = BOOLEAN(silent_flag || rule->silent);
1253      -                                                }
1254      -                                                if (out_buf.st_size != cmds_length || silent_flag ||
1255      -                                                    output_mode == txt2_mode) {
1256      -                                                        dump_out_file(rp->stdout_file, false);
1257      -                                                }
1258      -                                        }
1259      -                                        (void) unlink(rp->stdout_file);
1260      -                                        retmem_mb(rp->stdout_file);
1261      -                                        rp->stdout_file = NULL;
1262      -                                }
1263 1217  
1264      -                                if (!out_err_same && (rp->stderr_file != NULL)) {
1265      -                                        if (stat(rp->stderr_file, &out_buf) < 0) {
1266      -                                                fatal(catgets(catd, 1, 130, "stat of %s failed: %s"),
1267      -                                                      rp->stderr_file,
1268      -                                                      errmsg(errno));
     1218 +
     1219 +                        /*
     1220 +                         * Check if there were any job output
     1221 +                         * from the parallel build.
     1222 +                         */
     1223 +                        if (rp->stdout_file != NULL) {
     1224 +                                if (stat(rp->stdout_file, &out_buf) < 0) {
     1225 +                                        fatal(catgets(catd, 1, 130, "stat of %s failed: %s"),
     1226 +                                            rp->stdout_file,
     1227 +                                            errmsg(errno));
     1228 +                                }
     1229 +
     1230 +                                if ((line2 != NULL) &&
     1231 +                                    (out_buf.st_size > 0)) {
     1232 +                                        cmds_length = 0;
     1233 +                                        for (rule = line2->body.line.command_used,
     1234 +                                                 silent_flag = silent;
     1235 +                                             rule != NULL;
     1236 +                                             rule = rule->next) {
     1237 +                                                cmds_length += rule->command_line->hash.length + 1;
     1238 +                                                silent_flag = BOOLEAN(silent_flag || rule->silent);
1269 1239                                          }
1270      -                                        if ((line2 != NULL) &&
1271      -                                            (out_buf.st_size > 0)) {
1272      -                                                dump_out_file(rp->stderr_file, true);
     1240 +                                        if (out_buf.st_size != cmds_length || silent_flag ||
     1241 +                                            output_mode == txt2_mode) {
     1242 +                                                dump_out_file(rp->stdout_file, false);
1273 1243                                          }
1274      -                                        (void) unlink(rp->stderr_file);
1275      -                                        retmem_mb(rp->stderr_file);
1276      -                                        rp->stderr_file = NULL;
1277 1244                                  }
     1245 +                                (void) unlink(rp->stdout_file);
     1246 +                                retmem_mb(rp->stdout_file);
     1247 +                                rp->stdout_file = NULL;
     1248 +                        }
     1249 +
     1250 +                        if (!out_err_same && (rp->stderr_file != NULL)) {
     1251 +                                if (stat(rp->stderr_file, &out_buf) < 0) {
     1252 +                                        fatal(catgets(catd, 1, 130, "stat of %s failed: %s"),
     1253 +                                            rp->stderr_file,
     1254 +                                            errmsg(errno));
     1255 +                                }
     1256 +                                if ((line2 != NULL) &&
     1257 +                                    (out_buf.st_size > 0)) {
     1258 +                                        dump_out_file(rp->stderr_file, true);
     1259 +                                }
     1260 +                                (void) unlink(rp->stderr_file);
     1261 +                                retmem_mb(rp->stderr_file);
     1262 +                                rp->stderr_file = NULL;
1278 1263                          }
     1264 +                        
1279 1265                          check_state(rp->temp_file);
1280 1266                          if (rp->temp_file != NULL) {
1281 1267                                  free_name(rp->temp_file);
1282 1268                          }
1283 1269                          rp->temp_file = NULL;
1284 1270                          if (rp->state == build_failed) {
1285 1271                                  line = get_prop(rp->target->prop, line_prop);
1286 1272                                  if (line != NULL) {
1287 1273                                          line->body.line.command_used = NULL;
1288 1274                                  }
↓ open down ↓ 636 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX