Skip to content

Commit 5a661fb

Browse files
(GH-1153) Update crate names for DSC resources
Prior to this change, the Rust crates for specific DSC resources used the binary name as the crate name. This causes a few problems: - When using `cargo` commands with the `--package`/`-p` option to limit which workspace packages to use for an operation, some of the packages, like `registry`, conflict with dependencies of the same name. - If we eventually publish any of these crates, they are not obviously related to DSC and might be mistaken as general purpose tools, which we don't currently plan to support. - It isn't obvious in the cargo lock file whether an item is for a workspace package or an external package. This change: 1. Renames the resource crates to `dsc-resource-<name>`. 1. Defines an entry in the `bin` table for the cargo manifest to ensure that the binary name remains the same as it was before the change. We _may_ want to consider renaming the binaries in a future, potentially breaking change, so it is always obvious when a resource is builtin / which binary to use. This change has no effect on the build scripts or workspace manifest, since we explicitly point to folder paths instead of using crate names.
1 parent dfdf6e7 commit 5a661fb

File tree

7 files changed

+102
-78
lines changed

7 files changed

+102
-78
lines changed

Cargo.lock

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/dscecho/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "dscecho"
2+
name = "dsc-resource-echo"
33
version = "1.0.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "dscecho"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
clap = { workspace = true }
812
rust-i18n = { workspace = true }

resources/osinfo/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "osinfo"
2+
name = "dsc-resource-osinfo"
33
version = "1.0.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "osinfo"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
# external dependencies
812
serde_json = { workspace = true }

resources/process/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "process"
2+
name = "dsc-resource-process"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "process"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
sysinfo = { workspace = true }
812
serde = { workspace = true }

resources/registry/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "registry"
2+
name = "dsc-resource-registry"
33
version = "1.0.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "registry"
8+
path = "src/main.rs"
9+
610
[package.metadata.i18n]
711
available-locales = ["en-us"]
812
default-locale = "en-us"

resources/runcommandonset/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "runcommandonset"
2+
name = "dsc-resource-run_command_on_set"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "runcommandonset"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
clap = { workspace = true }
812
rust-i18n = { workspace = true }

resources/sshdconfig/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[package]
2-
name = "sshdconfig"
2+
name = "dsc-resource-sshdconfig"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "sshdconfig"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
#external dependencies
812
chrono = { workspace = true }

0 commit comments

Comments
 (0)