Skip to content

Commit

Permalink
Add both path and version dependencies (#69)
Browse files Browse the repository at this point in the history
* Add both path and version dependencies

A previous commit removed the version specification for the path
dependencies in the repository. This all works fine, until the crates
are published. Crates on crates.io may not have path dependencies, but
there is no version to use.

The accepted solution appears to be to specify _both_ path and version
dependencies. The former is used when building from source, the latter
when publishing.

* Pin exact versions and add some background
  • Loading branch information
bnaecker committed Nov 22, 2022
1 parent fdd1ba4 commit eb7bcfa
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dtrace-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dtrace-parser"
version = "0.1.13"
version = "0.1.14"
authors = ["Benjamin Naecker <ben@oxidecomputer.com>",
"Adam H. Leventhal <ahl@oxidecomputer.com>"]
edition = "2018"
Expand Down
6 changes: 3 additions & 3 deletions usdt-attr-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "usdt-attr-macro"
version = "0.3.3"
version = "0.3.4"
authors = ["Benjamin Naecker <ben@oxide.computer>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -11,12 +11,12 @@ repository = "https://github.com/oxidecomputer/usdt.git"
proc-macro = true

[dependencies]
dtrace-parser = { path = "../dtrace-parser" }
dtrace-parser = { path = "../dtrace-parser", version = "= 0.1.14" }
proc-macro2 = "1"
serde_tokenstream = "0.1"
syn = { version = "1", features = ["full"] }
quote = "1"
usdt-impl = { path = "../usdt-impl", default-features = false }
usdt-impl = { path = "../usdt-impl", default-features = false, version = "= 0.3.4" }

[features]
default = ["asm"]
Expand Down
8 changes: 4 additions & 4 deletions usdt-impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "usdt-impl"
version = "0.3.3"
version = "0.3.4"
authors = ["Benjamin Naecker <ben@oxidecomputer.com>",
"Adam H. Leventhal <ahl@oxidecomputer.com>"]
edition = "2018"
Expand All @@ -10,7 +10,7 @@ repository = "https://github.com/oxidecomputer/usdt.git"

[dependencies]
byteorder = "1"
dtrace-parser = { path = "../dtrace-parser" }
dtrace-parser = { path = "../dtrace-parser", version = "= 0.1.14" }
libc = "0.2"
proc-macro2 = "1"
quote = "1"
Expand All @@ -24,10 +24,10 @@ thread-id = "4"
version_check = "0.9.4"

[target.'cfg(target_os = "macos")'.dependencies]
dof = { path = "../dof", optional = true, default-features = false }
dof = { path = "../dof", optional = true, default-features = false, version = "= 0.1.5" }

[target.'cfg(not(target_os = "macos"))'.dependencies]
dof = { path = "../dof", default-features = false }
dof = { path = "../dof", default-features = false, version = "= 0.1.5" }

[features]
default = ["asm"]
Expand Down
6 changes: 3 additions & 3 deletions usdt-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "usdt-macro"
version = "0.3.3"
version = "0.3.4"
authors = ["Benjamin Naecker <ben@oxidecomputer.com>",
"Adam H. Leventhal <ahl@oxidecomputer.com>"]
edition = "2018"
Expand All @@ -9,12 +9,12 @@ description = "Procedural macro for generating Rust macros for USDT probes"
repository = "https://github.com/oxidecomputer/usdt.git"

[dependencies]
dtrace-parser = { path = "../dtrace-parser" }
dtrace-parser = { path = "../dtrace-parser", version = "= 0.1.14" }
proc-macro2 = "1"
serde_tokenstream = "0.1"
syn = { version = "1", features = ["full"] }
quote = "1"
usdt-impl = { path = "../usdt-impl", default-features = false }
usdt-impl = { path = "../usdt-impl", default-features = false, version = "= 0.3.4" }

[features]
default = ["asm"]
Expand Down
17 changes: 12 additions & 5 deletions usdt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
[package]
name = "usdt"
version = "0.3.3"
version = "0.3.4"
authors = ["Benjamin Naecker <ben@oxidecomputer.com>",
"Adam H. Leventhal <ahl@oxidecomputer.com>"]
edition = "2018"
license = "Apache-2.0"
description = "Dust your Rust with USDT probes"
repository = "https://github.com/oxidecomputer/usdt.git"

# NOTE: The use of path and version dependencies is deliberate and load-bearing.
#
# When building from source, this will select the version in the workspace, by
# path. When publishing the specific version will be used. Combined with the
# exact version requirements, this prevents issues like oxidecomputer/usdt#69,
# where the public-facing `usdt` crate may pick up different versions of the
# internal implementation crates.
[dependencies]
dtrace-parser = { path = "../dtrace-parser", optional = true }
dtrace-parser = { path = "../dtrace-parser", optional = true, version = "= 0.1.14" }
serde = "1"
usdt-impl = { path = "../usdt-impl", default-features = false }
usdt-macro = { path = "../usdt-macro", default-features = false }
usdt-attr-macro = { path = "../usdt-attr-macro", default-features = false }
usdt-impl = { path = "../usdt-impl", default-features = false, version = "= 0.3.4" }
usdt-macro = { path = "../usdt-macro", default-features = false, version = "= 0.3.4" }
usdt-attr-macro = { path = "../usdt-attr-macro", default-features = false, version = "= 0.3.4" }

[features]
default = ["asm"]
Expand Down

0 comments on commit eb7bcfa

Please sign in to comment.