Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Initialize RlsExecutor during new() instead of during init()#448

Merged
nrc merged 1 commit intorust-lang:masterfrom
Xanewok:simplify-executor-init
Aug 20, 2017
Merged

Initialize RlsExecutor during new() instead of during init()#448
nrc merged 1 commit intorust-lang:masterfrom
Xanewok:simplify-executor-init

Conversation

@Xanewok
Copy link
Copy Markdown
Contributor

@Xanewok Xanewok commented Aug 20, 2017

init() is called each time rustc command is prepared, so we ended up calling it as many times as there were rustc invocations for the package/workspace.
To initialize the packages we only need Workspace, which we do create already when creating RlsExecutor - so just pass it and use it when calling RlsExecutor::new().

@nrc as you said when I first introduced the workspace_mode, this should probably be in a separate enum to better split cur_package_id and member_packages logic/storage, but I think it'd be good to do once the workspace_mode design stabilises a bit.

Related: rust-lang/cargo#4416

`fn init()` is called each time `rustc` command is prepared, so we ended up calling it as many times as there were `rustc` invocations for the package/workspace.
To initialize the packages we only need `Workspace`, which we do create already when creating `RlsExecutor` - so just pass it and use it when calling `RlsExecutor::new()`.
@nrc nrc merged commit a3b05b6 into rust-lang:master Aug 20, 2017
@Xanewok Xanewok deleted the simplify-executor-init branch August 20, 2017 22:08
nrc pushed a commit that referenced this pull request Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants