pub fn execute(mut self, cx: &mut Context<'_, '_>, plan: &mut BuildPlan) -> CargoResult<()> {
        let _p = profile::start("executing the job graph");
        self.queue.queue_finished();

        let progress = Progress::with_style("Building", ProgressStyle::Ratio, cx.bcx.config);
        let state = DrainState {
            total_units: self.queue.len(),
            queue: self.queue,
            // 100 here is somewhat arbitrary. It is a few screenfulls of
            // output, and hopefully at most a few megabytes of memory for
            // typical messages. If you change this, please update the test
            // caching_large_output, too.
            messages: Arc::new(Queue::new(100)),
            diag_dedupe: DiagDedupe::new(cx.bcx.config),
            warning_count: HashMap::new(),
            active: HashMap::new(),
            compiled: HashSet::new(),
            documented: HashSet::new(),
            counts: self.counts,
            progress,
            next_id: 0,
            timings: self.timings,
            tokens: Vec::new(),
            rustc_tokens: HashMap::new(),
            to_send_clients: BTreeMap::new(),
            pending_queue: Vec::new(),
            print: DiagnosticPrinter::new(cx.bcx.config),
            finished: 0,
            per_package_future_incompat_reports: Vec::new(),
        };

        // Create a helper thread for acquiring jobserver tokens
        let messages = state.messages.clone();
        let helper = cx
            .jobserver
            .clone()
            .into_helper_thread(move |token| {
                messages.push(Message::Token(token));
            })
            .with_context(|| "failed to create helper thread for jobserver management")?;

        // Create a helper thread to manage the diagnostics for rustfix if
        // necessary.
        let messages = state.messages.clone();
        // It is important that this uses `push` instead of `push_bounded` for
        // now. If someone wants to fix this to be bounded, the `drop`
        // implementation needs to be changed to avoid possible deadlocks.
        let _diagnostic_server = cx
            .bcx
            .build_config
            .rustfix_diagnostic_server
            .borrow_mut()
            .take()
            .map(move |srv| srv.start(move |msg| messages.push(Message::FixDiagnostic(msg))));

        crossbeam_utils::thread::scope(move |scope| {
            match state.drain_the_queue(cx, plan, scope, &helper) {
                Some(err) => Err(err),
                None => Ok(()),
            }
        })
        .expect("child threads shouldn't panic")
    }
/// Executes all jobs necessary to build the dependency graph.
///
/// This function will spawn off `config.jobs()` workers to build all of the
/// necessary dependencies, in order. Freshness is propagated as far as
/// possible along each dependency chain.
Executes all jobs necessary to build the dependency graph.
This function will spawn off `config.jobs()` workers to build all of the
necessary dependencies, in order. Freshness is propagated as far as
possible along each dependency chain.
Executes all jobs necessary to build the dependency graph . This function will spawn off ` config . jobs () ` workers to build all of the necessary dependencies in order . Freshness is propagated as far as possible along each dependency chain .
pub fn execute(mut self, cx: &mut Context<'_, '_>, plan: &mut BuildPlan) -> CargoResult<()> {
        let _p = profile::start("executing the job graph");
        self.queue.queue_finished();
        let progress = Progress::with_style("Building", ProgressStyle::Ratio, cx.bcx.config);
        let state = DrainState {
            total_units: self.queue.len(),
            queue: self.queue,
            // 100 here is somewhat arbitrary. It is a few screenfulls of
            // output, and hopefully at most a few megabytes of memory for
            // typical messages. If you change this, please update the test
            // caching_large_output, too.
            messages: Arc::new(Queue::new(100)),
            diag_dedupe: DiagDedupe::new(cx.bcx.config),
            warning_count: HashMap::new(),
            active: HashMap::new(),
            compiled: HashSet::new(),
            documented: HashSet::new(),
            counts: self.counts,
            progress,
            next_id: 0,
            timings: self.timings,
            tokens: Vec::new(),
            rustc_tokens: HashMap::new(),
            to_send_clients: BTreeMap::new(),
            pending_queue: Vec::new(),
            print: DiagnosticPrinter::new(cx.bcx.config),
            finished: 0,
            per_package_future_incompat_reports: Vec::new(),
        };
        // Create a helper thread for acquiring jobserver tokens
        let messages = state.messages.clone();
        let helper = cx
            .jobserver
            .clone()
            .into_helper_thread(move |token| {
                messages.push(Message::Token(token));
            })
            .with_context(|| "failed to create helper thread for jobserver management")?;
        // Create a helper thread to manage the diagnostics for rustfix if
        // necessary.
        let messages = state.messages.clone();
        // It is important that this uses `push` instead of `push_bounded` for
        // now. If someone wants to fix this to be bounded, the `drop`
        // implementation needs to be changed to avoid possible deadlocks.
        let _diagnostic_server = cx
            .bcx
            .build_config
            .rustfix_diagnostic_server
            .borrow_mut()
            .take()
            .map(move |srv| srv.start(move |msg| messages.push(Message::FixDiagnostic(msg))));
        crossbeam_utils::thread::scope(move |scope| {
            match state.drain_the_queue(cx, plan, scope, &helper) {
                Some(err) => Err(err),
                None => Ok(()),
            }
        })
        .expect("child threads shouldn't panic")
    }
pub fn execute ( mut self , cx : & mut Context < ' _ , ' _ > , plan : & mut BuildPlan ) -> CargoResult < ( ) > { let _p = profile :: start ( " " ) ; self . queue . queue_finished ( ) ; let progress = Progress :: with_style ( " " , ProgressStyle :: Ratio , cx . bcx . config ) ; let state = DrainState { total_units : self . queue . len ( ) , queue : self . queue , // 100 here is somewhat arbitrary. It is a few screenfulls of // output, and hopefully at most a few megabytes of memory for // typical messages. If you change this, please update the test // caching_large_output, too. messages : Arc :: new ( Queue :: new ( 100 ) ) , diag_dedupe : DiagDedupe :: new ( cx . bcx . config ) , warning_count : HashMap :: new ( ) , active : HashMap :: new ( ) , compiled : HashSet :: new ( ) , documented : HashSet :: new ( ) , counts : self . counts , progress , next_id : 0 , timings : self . timings , tokens : Vec :: new ( ) , rustc_tokens : HashMap :: new ( ) , to_send_clients : BTreeMap :: new ( ) , pending_queue : Vec :: new ( ) , print : DiagnosticPrinter :: new ( cx . bcx . config ) , finished : 0 , per_package_future_incompat_reports : Vec :: new ( ) , } ; // Create a helper thread for acquiring jobserver tokens let messages = state . messages . clone ( ) ; let helper = cx . jobserver . clone ( ) . into_helper_thread ( move | token | { messages . push ( Message :: Token ( token ) ) ; } ) . with_context ( | | " " ) ? ; // Create a helper thread to manage the diagnostics for rustfix if // necessary. let messages = state . messages . clone ( ) ; // It is important that this uses `push` instead of `push_bounded` for // now. If someone wants to fix this to be bounded, the `drop` // implementation needs to be changed to avoid possible deadlocks. let _diagnostic_server = cx . bcx . build_config . rustfix_diagnostic_server . borrow_mut ( ) . take ( ) . map ( move | srv | srv . start ( move | msg | messages . push ( Message :: FixDiagnostic ( msg ) ) ) ) ; crossbeam_utils :: thread :: scope ( move | scope | { match state . drain_the_queue ( cx , plan , scope , & helper ) { Some ( err ) => Err ( err ) , None => Ok ( ( ) ) , } } ) . expect ( " " ) }
Executes all jobs necessary to build the dependency graph.
Executes all jobs necessary to build the dependency graph .
mut self
cx
&mut Context<'_, '_>
plan
&mut BuildPlan
mut self
cx
&mut Context<'_, '_>
plan
&mut BuildPlan