Skip to content

Commit 31d1402

Browse files
(GH-1152) Define cargo workspace
Prior to this change, the project didn't use a cargo workspace. Instead, every crate independently managed its dependencies and we associated crates with Rust Analyzer in VS Code through the configuration settings. This change: - Defines a virtual workspace at the repository root, including every crate as a workspace member, defining the release profile, and defining every crate dependency. - Updates the cargo manifest for every crate to inherit their dependencies from the workspace. - Replaces the per-crate cargo lock files with the workspace-level lock file. Now dependency management happens with a single manifest and lock file. - Makes minor changes to the build script to ensure functionality continues as previously defined. Note that this change on its own doesn't drastically improve build times. For build times to improve substantially, we need to: 1. Restructure the build to compile all crates with a single command. When we use `cargo build` at the repository root or the `--workspace` flag, cargo builds every crate and its dependencies together. Cargo uses the dependency graph to only compile each dependency crate once during the build, instead of recompiling every dependency when we compile on a crate-by-crate basis. 1. Enable the use of caching, like with `sccache`. When we enable cached builds, only crates that have been modified since the last build will be recompiled. This _substantially_ improves build times for local development and when we invoke tests after initial compilation. However, both of these changes require more substantial modifications to the build script, so they aren't addressed in this change. Those changes will be addressed in a future commit.
1 parent f272f86 commit 31d1402

File tree

36 files changed

+789
-13793
lines changed

36 files changed

+789
-13793
lines changed

.vscode/settings.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
{
2-
"rust-analyzer.linkedProjects": [
3-
"./dsc/Cargo.toml",
4-
"./dsc_lib/Cargo.toml",
5-
"./dscecho/Cargo.toml",
6-
"./osinfo/Cargo.toml",
7-
"./registry/Cargo.toml",
8-
"./runcommandonset/Cargo.toml",
9-
"./tools/test_group_resource/Cargo.toml",
10-
"./tools/dsctest/Cargo.toml",
11-
"./tree-sitter-dscexpression/Cargo.toml",
12-
"./y2j/Cargo.toml"
13-
],
142
"rust-analyzer.showUnlinkedFileNotification": true,
153
"json.schemas": [
164
{

0 commit comments

Comments
 (0)